[R] Preferable contrasts?

Grathwohl,Dominik,LAUSANNE,NRC/NT dominik.grathwohl at rdls.nestle.com
Tue Nov 12 12:15:46 CET 2002


Dear experts,

I would like to thank the experts for the fast and fruitful advises 
concerning my posted problem. Some would like to know 
where contr.SAS comes from. It is part of the NLME library 
and it could be found in the SASmixed library. 
However, I think it's not crucial where it comes from 
to present my problem. My problem was more of general nature 
about the impact of contrasts to the p-value of parameter estimates 
than to this special case of contr.SAS. I'm aware that there is some 
impact but it was surprising for me that I could choose whether PRO 
is significant or PRE is significant depending on contrasts. 
Now I would like to summarize the answers.

Vito Muggio recommends using Likelihood Ratio Test instead.
> 1-pchisq(2*pro.pre$loglik[2]-2*pre$loglik[2], df=1) # impact of pro
[1] 0.1962388
> 1-pchisq(2*pro.pre$loglik[2]-2*pro$loglik[2], df=1) # impact of pre
[1] 0.1259392
PRO and PRE seems not to contribute in a significant way.
 
Brian Ripley advice that the interpretation of main effects in the presence
of interactions depends on the coding except for a few special cases
(least squares fitting, balance and true contrasts (e.g. not
contr.treatment nor contr.SAS) spring to mind).  One extreme
view is never to look at the coefficients, only at predictions, and
although a counsel of perfection it contains a lot of merit.
In addition, he refers to chapter 6 of MASS. 

John Fox writes that parameter estimates should interpret in 
conformity with the coding employed. 
When using 0/1 coding in a model with interactions, you 
shouldn't think of the coefficients for factor(PRO) and factor(PRE) as 
"main effects." 

Frank E. Harrell Jr. also recommend to predict values and 
pointed me to an example of his contrast.Design, part of the Design library.
> contrast(f, list(PRO=1,PRE=0),list(PRO=0, PRE=0))
 PRE  Contrast      S.E.      Lower    Upper    Z Pr(>|z|)
   0 0.6576294 0.3020151 0.06569076 1.249568 2.18   0.0294
> contrast(f, list(PRO=0,PRE=1),list(PRO=0, PRE=0))
 PRO  Contrast      S.E.      Lower     Upper    Z Pr(>|z|)
   0 0.0680866 0.3040376 -0.5278161 0.6639893 0.22   0.8228
Rising PRO by 1 seems to be a significant effect, PRE not.

In summary, all experts point me to use something, 
which is independent of a certain contrast matrix. 
Personally, I would like to prefer the prediction 
rather than the LR-test, because I have really to spell out 
what I want to see.

Thank you all,

Dominik

> -----Original Message-----
> From: Grathwohl,Dominik,LAUSANNE,NRC/NT 
> Sent: jeudi, 7. novembre 2002 10:37
> To: r-help at stat.math.ethz.ch
> Subject: [R] Preferable contrasts?
> 
> 
> Dear all,
> 
> 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?
> 
> Kind regards,
> 
> Dominik
> 
> Dominik Grathwohl 
> Biostatistician 
> Nestlé Research Center 
> PO Box 44, CH-1000 Lausanne 26 
> Phone: + 41 21 785 8034 
> Fax: + 41 21 785 8556 
> e-mail: dominik.grathwohl at rdls.nestle.com 
> 
> 
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
> -.-.-.-.-.-.-.-.-
> 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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._.
_._
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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