[R] complex contrasts and logistic regression

Nicholas Lewin-Koh nikko at hailmail.net
Fri Jun 15 19:29:10 CEST 2007


Hi,
I am doing a retrospective analysis on a cohort from a designed trial,
and I am fitting
the model

fit<-glmD(survived ~ Covariate*Therapy + confounder,myDat,X=TRUE,
Y=TRUE, family=binomial()) 

My covariate has three levels ("A","B" and "C") and therapy has two
(treated and control), confounder is a continuous variable.
Also patients were randomized to treatment in the trial, but Covariate
is something that is measured
posthoc and can vary in the population.
 
I am trying to wrap my head around how to calculate a few quantities
from the model
and get reasonable confidence intervals for them, namely I would like to
test

H0: gamma=0, where gamma is the regression coefficient of the odds
ratios of surviving
             under treatment vs control at each level of Covariate
             (adjusted for the confounder)

and I would like to get the odds of surviving at each level of Covariate
under treatment and control
for each level of covariate adjusted for the confounder. I have looked
at contrast in the Design 
library but I don't think it gives me the right quantity, for instance 

contrast(fit,list(covariate="A", Therapy="Treated",
confounder=median(myDat$confounder), X=TRUE)
( "A" is the baseline level of Covariate) 

gives me beta0 + beta_Treated + beta_confounder*68  

Is this correctly interpreted as the conditional odds of dying? 
As to the 1st contrast I am not sure how to get it, would it be using
type = 'average' with some weights 
in contrast? The answers are probably staring me in the face, i am just
not seeing them today.

Nicholas



More information about the R-help mailing list