(Ted Harding)
2002-Dec-10 12:57 UTC
[R] clogit and general conditional logistic regression
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? 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? With thanks, Ted. -------------------------------------------------------------------- E-Mail: (Ted Harding) <Ted.Harding at nessie.mcc.ac.uk> Fax-to-email: +44 (0)870 167 1972 Date: 10-Dec-02 Time: 11:35:16 ------------------------------ XFMail ------------------------------
Hi Ted, The conditional exact (log)-Lik for a conditional logistic model (i.e. data with matched pairs), and the exact (log)-Lik for a PH Cox model are *the same* (1 matched pair== risk set), therefore clogit() is a wrapper for coxph() (You can estimate conditional logistic model by means of coxph())> My question is: is 'clogit' capable of a general conditional > logistic analysis?Yes, however I don't know if "general" means something else that I ignore, best, vito ----- Original Message ----- From: "Ted Harding" <Ted.Harding at nessie.mcc.ac.uk> To: <r-help at stat.math.ethz.ch> Sent: Tuesday, December 10, 2002 12:35 PM Subject: [R] clogit and general conditional logistic regression> 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? > > 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? > > With thanks, > Ted. > > > -------------------------------------------------------------------- > E-Mail: (Ted Harding) <Ted.Harding at nessie.mcc.ac.uk> > Fax-to-email: +44 (0)870 167 1972 > Date: 10-Dec-02 Time: 11:35:16 > ------------------------------ XFMail ------------------------------ > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > http://www.stat.math.ethz.ch/mailman/listinfo/r-help
Thomas Lumley
2002-Dec-10 16:35 UTC
[R] clogit and general conditional logistic regression
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
(Ted Harding)
2002-Dec-10 17:17 UTC
[R] clogit and general conditional logistic regression
Thanks to Vito Muggeio & Tony Rossini for pointing out that the form of the partial likelihood in the Cox PH model and the conditional logistic regression model are the same. However, that is a theoretical truth! What I was really asking (and apologies if it was not clear) was whether (and, if so, how) it would be possible to present the sort of data I was referring to to the R function 'coxph' or 'clogit'; the documentation seems to assume data involving a time component in a survival context, and I find I am confused about how to escape from that context into the more general regression (logistic linear model) context, when using these functions in R. Specifically, suppose I have data (say in the form of vectors) A = Level of categorical factor A X = Value of quantitative covariate X Cases = Number of Cases, r_i, out of n_i Unaffected = Number of Unaffected, (n_i - r_i), out of n_i (no "time" involved here) and I want to fit, by conditional logistic regression, a model such as Cases ~ A + X How, then, may such data be presented to say 'coxph'? Might the trick simply be to give every row an extra quasi-start-time equal to 0, and a quasi-end-time equal to 1? With thanks, Ted. On 10-Dec-02 Ted Harding 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? > > 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? > > With thanks, > Ted. > > > -------------------------------------------------------------------- > E-Mail: (Ted Harding) <Ted.Harding at nessie.mcc.ac.uk> > Fax-to-email: +44 (0)870 167 1972 > Date: 10-Dec-02 Time: 11:35:16 > ------------------------------ XFMail ------------------------------ > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > http://www.stat.math.ethz.ch/mailman/listinfo/r-help-------------------------------------------------------------------- E-Mail: (Ted Harding) <Ted.Harding at nessie.mcc.ac.uk> Fax-to-email: +44 (0)870 167 1972 Date: 10-Dec-02 Time: 16:06:15 ------------------------------ XFMail ------------------------------