[R] clogit and general conditional logistic regression

Thomas Lumley tlumley at u.washington.edu
Tue Dec 10 16:35:03 CET 2002


On Tue, 10 Dec 2002 Ted.Harding at nessie.mcc.ac.uk wrote:

> Can someone clarify what I cannot make out from the
> documentation?
>
> The function 'clogit' in the 'survival' package is
> described as performing a "conditional logistic regression".
> Its return value is stated to be "an object of class clogit
> which is a wrapper for a coxph object."
>
> This suggests that its usefulness is confined to the sort of
> data which arise in survival/proportional hazard applications.
>
> My question is: is 'clogit' capable of a general conditional
> logistic analysis?

Yes.


> E.g. given a set of data on binomial experiments with Y=1
> r_i times out of n_i, associated with levels A_i and B_i
> of factors A and B at N_A and N_B levels, would
>
>   clogit(Y ~ A+B, method=c(Exact"))
>
> generate something sensible containing the results of a standard
> exact conditional logistic regression of Y on A and B?

Well, you need a stratum variable -- conditional logistic regression is
for matched sets. If you don't have strata it's just a very slow way of
doing logistic regression.  Also, when it says `exact' it means it's using
the exact conditional likelihood, not that it is doing permutation tests
the way LogXact does.

Look at the example on the help page. It has data from a matched
case-control study with two predictors and a stratifying variable. The
example has the variables (with values 0,1,2) in a linear term, but you
could use factor() around them if you wanted to.

The conditional likelihood for logistic regression is (proportional to)
the partial likelihood for a stratified Cox model in which the event times
are all the same. That's why it works and why it's in the survival
package.


	-thomas




More information about the R-help mailing list