Conditional logistic regression: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 2:
 
==Motivation==
Observational studies use [[stratification (clinical trials)|stratification]] or [[matching]] as a way to control for bias[[confounding]]. Several tests existed before conditional logistic regression for matched data as shown in the related[[Conditional logistic regression#Related tests|related sectiontests]]. However, they did not allow for the analysis of continuous predictors with arbitrary strata size. All of those procedures also lack the flexibility of conditional logistic regression and in particular the possibility to control for covariates.
 
 
Logistic regression can take into account stratification by having a different constant term for each strata.
Logistic regression can take into account stratification by having a different constant term for each strata. Let us denote <math>Y_{i\ell}\in\{0,1\}</math> the label (e.g. case status) of the <math>\ell</math>th observation of the <math>i</math>th strata and <math>X_{i\ell}\in\mathbb{R}^p</math> the values of the corresponding predictors. Then, the likelihood of one observation is
 
:<math> \mathbb{P}(Y_{i\ell}=1|X_{i\ell})=\frac{\exp(\alpha_i +\boldsymbol\beta^\top X_{i\ell})}{1+\exp(\alpha_i +\beta^\top X_{i\ell})}</math>
 
where <math>\alpha_i</math> is the constant term for the <math>i</math>th strata. While this works satisfactorily for a limited number of strata, pathological behavior occurs when the strata are small. When the strata are pairs, the number of variables grows with the number of observations <math>N</math> (it equals <math>\frac{N}{2}+p</math>). The asymptotic results on which [[maximum likelihood estimation]] is based on are therefore not valid and the estimation is biased. In fact, it can be shown that the unconditional analysis of matched pair data results in an estimate of the odds ratio which is the square of the correct, conditional one.<ref>{{cite book |last1=Breslow |first1=N.E. |last2=Day|first2=N.E.|date=1980 |title=Statistical Methods in Cancer Research. Volume 1-The Analysis of Case-Control Studies |url=http://www.iarc.fr/en/publications/pdfs-online/stat/sp32/ |___location=Lyon, France |publisher= IARC |pages=249-251 }}</ref>
 
==Conditional likelihood==
The conditional likelihood approach deals with the above pathological behavior by conditioning on the number of cases in each strata and therefore eliminating the need to estimate the strata parameters. In the case where the strata are pairs, where the first observation is a case and the second is a control, this can be seen as follows
:<math>
\begin{align}
\mathbb{P}(Y_{i1}=1,Y_{i2}=0|X_{i1},X_{i2},Y_{i1}+Y_{i2}=1) & =\frac{\mathbb{P}(Y_{i1}=1|X_{i1}) \mathbb{P}(Y_{i2}=0|X_{i2})}{\mathbb{P}(Y_{i1}=1|X_{i1}) \mathbb{P}(Y_{i2}=0|X_{i2})+\mathbb{P}(Y_{i1}=0|X_{i1}) \mathbb{P}(Y_{i2}=1|X_{i2})}\\[6pt]
\ & =\frac{\frac{\exp(\alpha_i+\boldsymbol{\beta}^\top X_{i1})}{1+\exp(\alpha_i+\boldsymbol{\beta}^\top X_{i1})}\times\frac{1}{1+\exp(\alpha_i+\boldsymbol{\beta}^\top X_{i2})}}{\frac{\exp(\alpha_i+\boldsymbol{\beta}^\top X_{i1})}{1+\exp(\alpha_i+\boldsymbol{\beta}^\top X_{i1})}\times\frac{1}{1+\exp(\alpha_i+\boldsymbol{\beta}^\top X_{i2})}+\frac{1}{1+\exp(\alpha_i+\boldsymbol{\beta}^\top X_{i1})}\times\frac{\exp(\alpha_i+\boldsymbol{\beta}^\top X_{i2})}{1+\exp(\alpha_i+\boldsymbol{\beta}^\top X_{i2})}}\\[6pt]
\ & =\frac{\exp(\boldsymbol{\beta}^\top X_{i1})}{\exp(\boldsymbol{\beta}^\top X_{i1})+\exp(\boldsymbol{\beta}^\top X_{i2})}. \\[6pt]
\end{align}
</math>
 
With similar computations, the conditional likelihood of a strata of size <math>m</math> with the <math>k</math> first observations being the cases is
:<math>
\mathbb{P}(Y_{ij}=1\text{ for }j\leq k,Y_{ij}=0\text{ for } k<j\leq m|X_{i1},...,X_{im},\sum_{j=1}^m Y_{ij}=k)=\frac{\exp(\sum_{j=1}^k \boldsymbol{\beta}^\top X_{ij})}{\sum_{J\in \mathcal{C} _{k}^{m}} \sum_{j\in J} \exp(\boldsymbol{\beta}^\top X_{ij})},
</math>
where <math>\mathcal{C} _{k}^{m}</math> is the set of all subsets of size <math>k</math> of the set <math>\{1,...,m\}<math>.
 
The full conditional log likelihood is then simply the sum of the log likelihoods for each strata. The estimator is then defined as the <math>\beta</math> that maximizes the conditional log likelihood.
 
==Implementation==
Line 12 ⟶ 33:
 
==Related tests==
* [[Paired difference test]] allows to test the association between a binary outcome and a continuous predictor while taking into account pairing.
* [[Paired difference test]]
 
* [[Cochran-Mantel-Haenszel test]] allows to test the association between a binary outcome and a binary predictor while taking into account stratification with arbitrary strata size. When its conditions of application are verified, it is identical to the conditional logistic regression [[score test]]. <ref>{{cite journal | author = Day, N. E., Byar, D. P.| title = Testing hypotheses in case-control studies-equivalence of Mantel-Haenszel statistics and logit score tests. | journal = Biometrics | date = 1979 | volume = 35 | issue = 3 | pages = 623-630 }}</ref>
* [[Cochran-Mantel-Haenszel test]]
 
* [[McNemar test]]
 
==Notes==