[R] Preferable contrasts?

John Fox jfox at mcmaster.ca
Thu Nov 7 15:25:00 CET 2002


Dear Dominik,

I'm not familiar with contr.SAS (where does it come from?), but from the 
output I'd guess that it simply sets a different baseline category for the 
contrasts -- the last category (in your, case, coded 1 apparently) rather 
than the first (i.e., coded 0), which is what contr.treatment does. Notice 
that you have the same estimate and standard error for the interaction in 
both cases, which is consistent with my guess. To verify the codings try 
contrasts(factor(PRO)) in each case.

In general, you should interpret parameter estimates in conformity with the 
coding employed. When using 0/1 coding in a model with interactions, you 
shouldn't think of the the coefficients for factor(PRO) and factor(PRE) as 
"main effects." None of this is specific to the Cox regression model.

I hope that this helps,
John


At 10:36 AM 11/7/2002 +0100, Grathwohl,Dominik,LAUSANNE,NRC/NT wrote:

>I'm working with Cox-regression, because data could be censored.
>But in this particular case not.
>Now I have a simple example: PRO and PRE are (0,1) coded.
>The response is not normal distributed.
>We are interested in a model which could describe interaction.
>But my results are depending strongly in the choose of the contrast option.
>It is clear that there is some dependence in the contrasts, but in this
>simple case
>I could get the vice versa effect.
>My R output:
>
> > options(contrasts = c(unordered = "contr.treatment", ordered =
>"contr.poly"))
> > summary(coxph(Surv(ILOG, alive) ~ factor(PRO)*factor(PRE)))
>...
>                              coef exp(coef) se(coef)      z     p
>factor(PRO)1               0.6576     1.930    0.302  2.177 0.029
>factor(PRE)1               0.0681     1.070    0.304  0.224 0.820
>factor(PRO)1:factor(PRE)1 -0.7703     0.463    0.431 -1.789 0.074
>...
> > options(contrasts = c(unordered = "contr.SAS", ordered = "contr.poly"))
> > summary(coxph(Surv(ILOG, alive) ~ factor(PRO)*factor(PRE)))
>...
>                             coef exp(coef) se(coef)      z     p
>factor(PRO)0               0.113     1.119    0.304  0.370 0.710
>factor(PRE)0               0.702     2.018    0.299  2.350 0.019
>factor(PRO)0:factor(PRE)0 -0.770     0.463    0.431 -1.789 0.074
>...
>
>What would the experts recommend?

-----------------------------------------------------
John Fox
Department of Sociology
McMaster University
Hamilton, Ontario, Canada L8S 4M4
email: jfox at mcmaster.ca
phone: 905-525-9140x23604
web: www.socsci.mcmaster.ca/jfox
-----------------------------------------------------

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list