[R] treatment of factors and errors in ridge() function with coxph

Jessica Myers jmyers6 at PARTNERS.ORG
Wed Apr 27 18:16:50 CEST 2011

I am trying to fit a large Cox model with many predictors.  Because  
there are many predictors, I would like to use the ridge() function to  
get penalized ml estimates for all coefficients.  The problems are that:

1.  When I include a factor (like race) in the ridge() function, dummy  
variables are not created.  The resulting model has a single  
coefficient for the race variable, and I have no idea what is the  
interpretation of this coefficient.  Obviously, I can create the dummy  
variables myself, but it would be better not to.

2.  When I include a large number of predictors in ridge() [> ~ 35],  
coxph does not complete and I get the error:  Error in  
model.matrix.default(Terms, m) :
  model frame and formula mismatch in model.matrix()
Using a smaller subset of the same covariates, I don't get this error  
and it doesn't seem to matter which subset of covariates I use.

Any help with these problems would be greatly appreciated!


Jessica Myers
Instructor in Medicine
Division of Pharmacoepidemiology
Brigham and Women's Hospital

The information in this e-mail is intended only for the ...{{dropped:7}}

More information about the R-help mailing list