I’m trying to set up Cox Proptional Hazard model with interactions between
time and the covariates (which are categorical). The problem that I face is
that how to define the interactions, i.e. “x+cutStart:x”, properly.

The code below illustrates the problem. R gives the error message ” X matrix
deemed to be singular”, because “x+cutStart:x” includes too many
combinations of the dummies in the model. 

Any help is much appreciated!

aml2=survSplit(aml,cut=c(10,20,30),end='time',event='status',start='start')
aml2$cutStart=as.factor(aml2$start)
coxph(Surv(start,time,status)~x+cutStart:x,data=aml2)





--
View this message in context: 
http://r.789695.n4.nabble.com/coxph-how-to-define-interaction-terms-tp4679162.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
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.

Reply via email to