[Rd] Application of step to coxph using method="exact" (PR#6646)

kolassa at stat.rutgers.edu kolassa at stat.rutgers.edu
Thu Mar 4 18:14:52 MET 2004


Full_Name: John E. Kolassa
Version: Version 1.8.1
OS: Solaris
Submission from: (NULL) (128.6.76.36)


Stepwise model selection for coxph appears to fail with method="exact".
The code

step(coxph(Surv(1:100,rep(1,100))~factor(rep(1:4,25)),method="exact"))

produces the error message 

Start:  AIC= 733.07 
 Surv(1:100, rep(1, 100)) ~ factor(rep(1:4, 25)) 

Error in "[<-"(`*tmp*`, i + 1, , value = extractAIC(nfit, scale, k = k,  : 
        number of items to replace is not a multiple of replacement length

The same code without specifying method 
step(coxph(Surv(1:100,rep(1,100))~factor(rep(1:4,25))))

runs through, and gives what looks like a reasonable answer.  Thanks, John
Kolassa



More information about the R-devel mailing list