[R] StepAIC with coxph

Neil Leonard nleonard at tartarus.uwa.edu.au
Tue Nov 2 16:51:16 CET 2004


Hi,

I'm having a bit of trouble with using StepAIC with a coxph model.

Can anybody tell me if there is anything wrong with what I am doing  
here (I've removed a few of the variables for the purpose of this  
email, I had about 20 before):

start<- 
coxph(Surv(entryage2,age_at_death_yr,death)~finih5+prev+magegp+zpluralgp 
,data=project_model1)
fmAIC1 <- stepAIC(start,direction="backward",scope=list(lower = ~  
1,upper = ~ finih5+prev+magegp+zpluralgp,data=project_model1))

This is the error I'm getting after it goes through a few times:

Error in stepAIC(start, direction = "backward", scope = list(lower =  
~1,  :
	number of rows in use has changed: remove missing values?
In addition: There were 24 warnings (use warnings() to see them)

The warning messages are all of the form:
1: X matrix deemed to be singular; variable 11 27 28 29 in:  
coxph(formula = Surv(entryage2, age_at_death_yr, death) ~ prev +   ...

These arise because there are no deaths for a particular variable and  
haven't been a problem when I have been creating my own coxph model.


Thanks,
Neil




More information about the R-help mailing list