Skip to content

complex contrasts and logistic regression

3 messages · Nicholas Lewin-Koh, Frank E Harrell Jr

#
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
#
Nicholas Lewin-Koh wrote:
For logistic regression you can also use Design's lrm function which 
gives you more options.
If by posthoc you mean that the covariate is measured after baseline, it 
is difficult to get an interpretable analysis.
You mean regression coefficient on the log odds ratio scale.  This is 
easy to do with the contrast( ) function in Design.  Do ?contrast.Design 
for details and examples.
contrast( ) is for contrasts (differences).  Sounds like you want 
predicted values.  Do ?predict  ?predict.lrm  ?predict.Design.  Also do 
?gendata which will generate a data frame for getting predictors, with 
unspecified predictors set to reference values such as medians.

Frank

  
    
9 days later
#
Hi,
Sorry to take so long to reply, I was travelling last week. Thanks for
your
suggestions. Actually in this case contrast and predict gave the same
result,
and what I was looking at was the correct odds from the model. 

What is still confusing me is the 1st part of my question,
looking for a trend in odds ratios. From what I understand
testing the interaction:
fit1<-glmD(survived ~ as.numeric(Covariate)+Therapy +
confounder,myDat,X=TRUE, Y=TRUE, family=binomial())
fit2<-glmD(survived ~ as.numeric(Covariate)*Therapy +
confounder,myDat,X=TRUE, Y=TRUE, family=binomial()) 
lrtest(fit1,fit2)

Would be effectively testing for a trend in odds ratios? 
Do I have to fiddle with contrasts to make sure I am testing the correct
parameter?

Thanks
Nicholas

On Sat, 16 Jun 2007 11:14:12 -0500, "Frank E Harrell Jr"
<f.harrell at vanderbilt.edu> said: