* using log directory '/CRANPkg/check/gcmrec.Rcheck' * using R version 2.1.1, 2005-06-20 * checking for file 'gcmrec/DESCRIPTION' ... OK * this is package 'gcmrec' version '0.9-1' * checking if this is a source package ... OK * checking whether package 'gcmrec' can be installed ... OK * checking package directory ... OK * checking for portable file names ... OK * checking for sufficient/correct file permissions ... OK * checking DESCRIPTION meta-information ... OK * checking package dependencies ... OK * checking index information ... OK * checking package subdirectories ... OK * checking R files for syntax errors ... OK * checking R files for library.dynam ... OK * checking S3 generic/method consistency ... OK * checking replacement functions ... OK * checking foreign function calls ... OK * checking Rd files ... OK * checking for missing documentation entries ... OK * checking for code/documentation mismatches ... OK * checking Rd \usage sections ... OK * checking for CRLF line endings in C/C++/Fortran sources/headers ... OK * creating gcmrec-Ex.R ... OK * checking examples ... ERROR Running examples in gcmrec-Ex.R failed. The error most likely occurred in: > ### * gcmrec > > flush(stderr()); flush(stdout()) > > ### Name: gcmrec > ### Title: General Class of Models for recurrent event data > ### Aliases: gcmrec > ### Keywords: survival > > ### ** Examples > > > > ################################### > ## Models using different data formats > ################################### > > # > # Data input as a data frame > # > > # We use the well-known bladder cancer data set from survival package > > library(survival) Loading required package: splines Attaching package: 'survival' The following object(s) are masked from package:boot : aml > data(bladder2) Warning in data(bladder2) : data set 'bladder2' not found > > # we compute the interocurrence time > bladder2$time<-bladder2$stop-bladder2$start > > # If we execute: > # gcmrec(Survr(id,time,event)~rx+size+number,data=bladder2,s=2060) > > # We will obtain the following error message: > # Error in Survr(id, time, event) : Data doesn't match... > > # This means that we have some patients without right-censoring time. So, > # we understand that the last event coincides with the end of study. > # Consequently,we need to add a line with time 0 and status value equal > # to 0, too. To do so, we can use the function "addCenTime" as follows: > > bladderOK<-addCenTime(bladder2) > > # Now, we can fit the model using this new data set: > > gcmrec(Survr(id,time,event)~rx+size+number,data=bladderOK,s=2060) Call: gcmrec(formula = Survr(id, time, event) ~ rx + size + number, data = bladderOK, s = 2060) coef exp(coef) se(coef) z p rx -0.3189 0.727 0.2051 -1.555 0.1200 size -0.0154 0.985 0.0695 -0.222 0.8200 number 0.1354 1.145 0.0511 2.649 0.0081 General class model parameter estimates rho function: Alpha to k alpha (s.e.): 0.983 (0.0737) log-likelihood= -521.42 n= 85 n times= 197 number of iterations: 5 Newton-Raphson > > > # > # Data as a list. See either GeneratedData or hydraulic data > # sets as an example. > # > > # > # We can fit the model by transforming our data in a data frame > # using "List.to.Dataframe" function: > # > > data(hydraulic) > hydraulicOK<-List.to.Dataframe(hydraulic) > gcmrec(Survr(id,time,event)~covar.1+covar.2,data=hydraulicOK,s=4753) Call: gcmrec(formula = Survr(id, time, event) ~ covar.1 + covar.2, data = hydraulicOK, s = 4753) coef exp(coef) se(coef) z p covar.1 -0.0764 0.926 0.201 -0.381 0.70 covar.2 -0.0537 0.948 0.206 -0.261 0.79 General class model parameter estimates rho function: Alpha to k alpha (s.e.): 1.03 (0.0107) log-likelihood= -612.33 n= 6 n times= 158 number of iterations: 4 Newton-Raphson > > > # > # Our model allows us to incorporate effective age information > # > # To illustrate this example, we will use a simulated data set generated > # under the minimal repair model with probability of perfect repair equal to 0.6 > # > # As we have the data in a list, first we need to obtain a data frame containing > # the time, event, and covariates information: > # > > data(GeneratedData) > temp<-List.to.Dataframe(GeneratedData) > > # then, we can fit the model incorporating the information about the effective > # age in the effageData argument: > > gcmrec(Survr(id,time,event)~covar.1+covar.2, data=temp, + effageData=GeneratedData, s=100) Call: gcmrec(formula = Survr(id, time, event) ~ covar.1 + covar.2, data = temp, effageData = GeneratedData, s = 100) coef exp(coef) se(coef) z p covar.1 0.498 1.65 0.227 2.20 2.8e-02 covar.2 1.018 2.77 0.155 6.57 5.0e-11 General class model parameter estimates rho function: Alpha to k alpha (s.e.): 0.995 (0.0163) log-likelihood= -393.61 n= 10 n times= 135 number of iterations: 7 Newton-Raphson > > > > ##################################################################### > ## How to fit minimal or perfect repair models, with and without frailties > ##################################################################### > > # Model with frailties > > mod.Fra<-gcmrec(Survr(id,time,event)~rx+size+number,data=bladderOK,s=2060,Frailty=TRUE) > print(mod.Fra) Call: gcmrec(formula = Survr(id, time, event) ~ rx + size + number, data = bladderOK, s = 2060, Frailty = TRUE) coef exp(coef) se(coef) z p rx -0.3189 0.727 NA NA NA size -0.0154 0.985 NA NA NA number 0.1354 1.145 NA NA NA General class model parameter estimates rho function: Alpha to k alpha (s.e.): 0.983 (NA) Frailty parameter, Xi (s.e. Jacknife): 3.17e+13 ( NA ) Marginal log-likelihood= -521.42 n= 85 n times= 197 number of iterations: 13 EM steps > > # effective age function: perfect repair and minimal repair models > # (models without frailties) > > data(readmission) > > # perfect > mod.per<-gcmrec(Survr(id,time,event)~as.factor(dukes),data=readmission, + s=3000,typeEffage="per") > print(mod.per) Call: gcmrec(formula = Survr(id, time, event) ~ as.factor(dukes), data = readmission, s = 3000, typeEffage = "per") coef exp(coef) se(coef) z p as.factor(dukes)2 0.365 1.44 0.112 3.26 1.1e-03 as.factor(dukes)3 0.965 2.63 0.133 7.24 4.4e-13 General class model parameter estimates rho function: Alpha to k alpha (s.e.): 1.13 (0.0143) log-likelihood= -2726.23 n= 403 n times= 861 number of iterations: 7 Newton-Raphson > > # minimal > mod.min<-gcmrec(Survr(id,time,event)~as.factor(dukes),data=readmission, + s=3000,typeEffage="min") > print(mod.min) Call: gcmrec(formula = Survr(id, time, event) ~ as.factor(dukes), data = readmission, s = 3000, typeEffage = "min") coef exp(coef) se(coef) z p as.factor(dukes)2 0.402 1.50 0.112 3.60 0.00032 as.factor(dukes)3 1.214 3.37 0.134 9.03 0.00000 General class model parameter estimates rho function: Alpha to k alpha (s.e.): 1.21 (0.0150) log-likelihood= -2448.15 n= 403 n times= 861 number of iterations: 8 Newton-Raphson > > ##################################################################### > ## How to fit models with \rho function equal to identity > ##################################################################### > > data(lymphoma) > > gcmrec(Survr(id, time, event) ~ as.factor(distrib), + data = lymphoma, s = 1000, Frailty = TRUE, rhoFunc = "Ident") Error in gcmrec(Survr(id, time, event) ~ as.factor(distrib), data = lymphoma, : NA/NaN/Inf in foreign function call (arg 19) Execution halted