3
$\begingroup$

I am using Cox regression to model my data (time to an event). One of the covariates has 29 categories. I would like to compare the categories to one another and identify which category has shortest time to event. Besides creating indicator variables for the 29 categories, what would be another approach to do so? Should I consider another model?

There is no relationship between the 29 categories and no hierarchical structure.

$\endgroup$
2
  • $\begingroup$ Welcome to Cross Validated! I thought this was a nice first question. On this site there's no need to say "thank you" at the end of your post - it might seem rude at first, but it's part of the philosophy of this site (tour) to "Ask questions, get answers, no distractions" and it means future readers of your question don't need to read through the pleasantries. $\endgroup$
    – Silverfish
    Commented Feb 19, 2016 at 18:27
  • $\begingroup$ (Re "Besides creating indicator variables for the 29 categories" ... of course, you might only create indicator variables for 28 of them, keeping the other one as a baseline. Some statistical software, like R, can do this automatically for you.) $\endgroup$
    – Silverfish
    Commented Feb 19, 2016 at 18:29

1 Answer 1

2
$\begingroup$

If you're worried about overfitting, you can take a similar approach to one you would use with a normal regression model with a categorical variable with many categories. For example, one option could be to use a penalized regression model, like the elasticnet, to shrink some coefficients to zero. Another option would be to model the categorical predictor as a random effect, helping to control for multiple comparisons. Both of these options have implementations in R, by using either the glmnet package for the elasticnet approach or the coxme package for the random effect approach.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.