[R] coxph and ordinal variables?

Thomas Lumley tlumley at u.washington.edu
Thu Sep 9 18:06:19 CEST 2010


On Wed, 8 Sep 2010, Paul Johnson wrote:

> run it with factor() instead of ordered().  You don't want the
> "orthogonal polynomial" contrasts that result from ordered if you need
> to compare against Stata.

If you don't want polynomial contrasts for ordered factors, you can just tell R not to use them.

options(contrasts=c("contr.treatment","contr.treatment"))

It's like the Good Old Days when you had to use options() to tell S-PLUS not to use Helmert contrasts.


    -thomas

Thomas Lumley
Professor of Biostatistics
University of Washington, Seattle



More information about the R-help mailing list