2
$\begingroup$

I am working on a project for a professor, and I have been asked to construct a confidence interval for the likelihood ratio test from clogit() using R.

clogit(obesity_status ~ bmi + strata(pair), data = twindata)

It looks like clogit() returns 3 p-values for the likelihood ratio test, Wald test, and score test. More specifically, when I run summary(model), it returns:

Likelihood ratio test= 2.41  on 1 df,   p=0.02
Wald test            = 3.25  on 1 df,   p=0.06
Score (logrank) test = 4.42  on 1 df,   p=0.02

But, when I run confint(model), it gives me a confidence interval of:

0.7, 95

But how could this be if the p-value for the LRT is < 0.05? Is it because it's returning a CI based on the Wald test? If so, is there a way to get the confidence interval based on the likelihood ratio test with p = 0.02?

Thank you for your help.

$\endgroup$

1 Answer 1

4
$\begingroup$

It's a Wald confidence interval. There is no built-in support for likelihood or score confidence intervals for clogit, but it's fairly straightforward to get a likelihood interval by profiling in this single-parameter case. We can use the offset function to force a specific value of the coefficient and work out the resulting likelihood.

Example, from the survival package since you didn't supply one

> data(infert)
> clogit(case ~ spontaneous +  strata(stratum), data=infert)
Call:
clogit(case ~ spontaneous + strata(stratum), data = infert)

              coef exp(coef) se(coef)     z        p
spontaneous 1.1768    3.2441   0.2315 5.083 3.71e-07

Likelihood ratio test=33.76  on 1 df, p=6.228e-09
n= 248, number of events= 83 
> clogit(case ~ spontaneous +  strata(stratum), data=infert)$loglik
[1] -90.77935 -73.89824

Now

> threshold<- -73.89824 -qchisq(0.95,1)
> threshold
[1] -77.7397
> f<-function(beta) clogit(eval(bquote(case ~ offset(.(beta)*spontaneous) +  strata(stratum))), data=infert)$loglik-threshold
> f(1.176)
[1] 3.841457

We need a number above the true upper limit and a number below the true lower limit. I'll pick 2 and 0

> uniroot(f,lower=1.1768,upper=2)$root
[1] 1.890439
> uniroot(f,upper=1.1768,lower=0)$root
[1] 0.5850132

So, (0.585,1.89) is the confidence interval.

$\endgroup$
2
  • $\begingroup$ Thank you. To construct the CI for the odds ratio (exp(coef)), I would just have to take the exp() of the CI generated from this method right? $\endgroup$
    – tealove12
    Commented Oct 23 at 1:48
  • 1
    $\begingroup$ Yes, that's correct $\endgroup$ Commented Oct 23 at 2:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.