Description Usage Arguments Details Value References Author(s) See Also Examples
Estimates a logistic regression model by maximising the conditional
likelihood. Uses a model formula of the form
case.status~exposure+strata(matched.set)
.
The default is to use the exact conditional likelihood, a commonly
used approximate conditional likelihood is provided for compatibility
with older software.
1 2 3 
formula 
Model formula 
data 
data frame 
weights 
optional, names the variable containing case weights 
subset 
optional, subset the data 
na.action 
optional na.action argument. By default the
global option 
method 
use the correct (exact) calculation in the conditional likelihood or one of the approximations 
... 
optional arguments, which will be passed to

It turns out that the loglikelihood for a conditional logistic regression model = loglik from a Cox model with a particular data structure. Proving this is a nice homework exercise for a PhD statistics class; not too hard, but the fact that it is true is surprising.
When a well tested Cox model routine is available many packages use this ‘trick’ rather than writing a new software routine from scratch, and this is what the clogit routine does. In detail, a stratified Cox model with each case/control group assigned to its own stratum, time set to a constant, status of 1=case 0=control, and using the exact partial likelihood has the same likelihood formula as a conditional logistic regression. The clogit routine creates the necessary dummy variable of times (all 1) and the strata, then calls coxph.
The computation of the exact partial likelihood can be very slow, however. If a particular strata had say 10 events out of 20 subjects we have to add up a denominator that involves all possible ways of choosing 10 out of 20, which is 20!/(10! 10!) = 184756 terms. Gail et al describe a fast recursion method which partly ameliorates this; it was incorporated into version 2.3611 of the survival package. The computation remains infeasible for very large groups of ties, say 100 ties out of 500 subjects, and may even lead to integer overflow for the subscripts – in this latter case the routine will refuse to undertake the task. The Efron approximation is normally a sufficiently accurate substitute.
Most of the time conditional logistic modeling is applied data with 1 case + k controls per set, in which case all of the approximations for ties lead to exactly the same result. The 'approximate' option maps to the Breslow approximation for the Cox model, for historical reasons.
Case weights are not allowed when the exact option is used, as the likelihood is not defined for fractional weights. Even with integer case weights it is not clear how they should be handled. For instance if there are two deaths in a strata, one with weight=1 and one with weight=2, should the likelihood calculation consider all subsets of size 2 or all subsets of size 3? Consequently, case weights are ignored by the routine in this case.
An object of class "clogit"
, which is a wrapper for a
"coxph"
object.
Michell H Gail, Jay H Lubin and Lawrence V Rubinstein. Likelihood calculations for matched casecontrol studies and survival studies with tied death times. Biometrika 68:703707, 1980.
John A. Logan. A multivariate model for mobility tables. Am J Sociology 89:324349, 1983.
Thomas Lumley
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15  ## Not run: clogit(case ~ spontaneous + induced + strata(stratum), data=infert)
# A multinomial response recoded to use clogit
# The revised data set has one copy per possible outcome level, with new
# variable tocc = target occupation for this copy, and case = whether
# that is the actual outcome for each subject.
# See the reference below for the data.
resp < levels(logan$occupation)
n < nrow(logan)
indx < rep(1:n, length(resp))
logan2 < data.frame(logan[indx,],
id = indx,
tocc = factor(rep(resp, each=n)))
logan2$case < (logan2$occupation == logan2$tocc)
clogit(case ~ tocc + tocc:education + strata(id), logan2)

Call:
clogit(case ~ tocc + tocc:education + strata(id), logan2)
coef exp(coef) se(coef) z p
toccfarm 1.896463 0.150099 1.380782 1.37 0.1696
toccoperatives 1.166750 3.211539 0.565646 2.06 0.0391
toccprofessional 8.100549 0.000303 0.698724 11.59 < 2e16
toccsales 5.029230 0.006544 0.770086 6.53 6.5e11
tocccraftsmen:education 0.332284 0.717283 0.056868 5.84 5.1e09
toccfarm:education 0.370286 0.690537 0.116410 3.18 0.0015
toccoperatives:education 0.422219 0.655591 0.058433 7.23 5.0e13
toccprofessional:education 0.278247 1.320812 0.051021 5.45 4.9e08
toccsales:education NA NA 0.000000 NA NA
Likelihood ratio test=666 on 8 df, p=0
n= 4190, number of events= 838
Warning message:
In coxph(formula = Surv(rep(1, 4190L), case) ~ tocc + tocc:education + :
X matrix deemed to be singular; variable 9
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.