Skip to content
Prev 140629 / 398506 Next

Defining reference category for a cph model summary inside of a "for" loop

Wells, Brian wrote:
Your code is confusing.  What is to the right of ~ in a formula is a 
predictor variable name, not a value.  If your variables are named A, B, 
C, ... you are OK.

'1st Quartile' has no special meaning to R or Design, and you can't pass 
a character string as a second argument to summary and expect it to work.

You will need parse(text=paste(...)) to create an appropriate expression.

But Design gives you inter-quartile range hazard ratios by default anyway.

Beware of getting hazard ratios that are not adjusted for other 
variables needed in the model.

Frank Harrell