Dear all, I'm trying to use the fold function as described here: http://cran.r-project.org/doc/contrib/Fox-Companion/appendix-cox-regression.pdf Page9
It does say that you can use this when you have more than one time varying covariate: in the description of the argument cov it says: "cov: A vector giving the column numbers of the time-dependent covariate in data, or a list of vectors if there is more than one time-dependent covariate." But I'm struggling with the syntax to list these vectors (I have 2 time varying covariates). But this just gives me an error message. >d6#my data SURVIVAL DEAD STARTYEAR SMALLINNO TOTALINNO ADVERTISE WAGE PRICECOST CAPITAL ENTRYRATE CR4 1 1 0 1999 1.724 1.724 0.3580 6.154 22.422 5.480 22.92 42.24 2 1 0 1999 1.942 1.942 0.2262 8.197 24.161 12.534 24.75 28.29 3 1 0 1999 1.942 1.942 0.2262 8.197 24.161 12.534 24.75 28.29 MSE OWNER PROV STARTSIZE NEWPROD1 NEWPROD2 NEWPROD3 NEWPROD4 NEWPROD5 NEWPROD6 NEWPROD7 1 46236 1 42 0.8769 0 NA NA NA NA NA NA 2 93340 1 42 0.1926 0 NA NA NA NA NA NA 3 93340 1 43 0.0000 0 NA NA NA NA NA NA NEWPROD8 RD1 RD2 RD3 RD4 RD5 RD6 RD7 RD8 1 NA 0 NA NA NA NA NA NA NA 2 NA 0 NA NA NA NA NA NA NA 3 NA 0 NA NA NA NA NA NA NA > d4<-fold(d6,time='survival',event='dead',cov=c(16:23,24:31),cov.names=c('newproduct','R&D')) > Error in dimnames(x) <-dn: length of 'dimnames' [2] not equal to array extent Would you mind give me some advice? Thanks in advance 2010-04-07 Mingqian [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.