Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Conditional logistic regression for matched pairs

Tags:

plot

r

I'm trying to run a conditional logistic regression for data which is similar to the example below:

table.10.3 <-  data.frame(pair=rep(1:144,rep(2,144)),
                         MI=rep(c(0,1),144),
                         diabetes=c(rep(c(1,1),9),
                                    rep(c(1,0),16),
                                    rep(c(0,1),37),
                                    rep(c(0,0),82))
                          )
# head(table.10.3)
# pair MI diabetes
#    1  0        1
#    1  1        1
#    2  0        1
#    2  1        1
#    3  0        1
#    3  1        1

library("survival")
fit.CLR <- clogit(MI ~ diabetes + strata(pair), method="exact", data=table.10.3)

summary(fit.CLR)

I get the summary. My question is how do I regpresent the result graphically? I need held as I am very new to R plotting. I tried vcd package. I am able to get the mosaic plot for some other dummy data. But I want to plot the results of the clogit model.

like image 582
user3228463 Avatar asked Jan 23 '14 15:01

user3228463


1 Answers

I don't think you can get to a survival curve via clogit. Conditional logistic regression doesn't automatically account for survival time; it just deals with membership in strata that contain matched cases and controls the way a Cox model deals with survival times (hence its appearance in the 'survival' package).

If you're interested in estimating the baseline survival and hazard functions, I think you'll need to use a survival model like coxph, or you could just estimate the survival curve directly with survfit.

like image 126
ulfelder Avatar answered Sep 28 '22 11:09

ulfelder