<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.agency/index.php?action=history&amp;feed=atom&amp;title=Conditional_logistic_regression</id>
		<title>Conditional logistic regression - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.agency/index.php?action=history&amp;feed=atom&amp;title=Conditional_logistic_regression"/>
		<link rel="alternate" type="text/html" href="https://wiki.agency/index.php?title=Conditional_logistic_regression&amp;action=history"/>
		<updated>2026-04-22T10:46:34Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.30.1</generator>

	<entry>
		<id>https://wiki.agency/index.php?title=Conditional_logistic_regression&amp;diff=4554&amp;oldid=prev</id>
		<title>Admin: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://wiki.agency/index.php?title=Conditional_logistic_regression&amp;diff=4554&amp;oldid=prev"/>
				<updated>2018-11-02T21:27:02Z</updated>
		
		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 21:27, 2 November 2018&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>https://wiki.agency/index.php?title=Conditional_logistic_regression&amp;diff=4553&amp;oldid=prev</id>
		<title>Felixbalazard: corrected the likelihood</title>
		<link rel="alternate" type="text/html" href="https://wiki.agency/index.php?title=Conditional_logistic_regression&amp;diff=4553&amp;oldid=prev"/>
				<updated>2018-10-01T12:21:45Z</updated>
		
		<summary type="html">&lt;p&gt;corrected the likelihood&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;Conditional logistic regression&amp;#039;&amp;#039;&amp;#039; is an extension of [[logistic regression]] that allows one to take into account [[stratification (clinical trials)|stratification]] and [[Matching (statistics)|matching]]. Its main field of application is [[observational studies]] and in particular [[epidemiology]]. It was designed in 1978 by [[Norman Breslow]], [[Nick Day|Nicholas Day]], K. T. Halvorsen, Ross L. Prentice and C. Sabai.&amp;lt;ref name=&amp;quot;pmid727199&amp;quot;&amp;gt;{{cite journal| author=Breslow NE, Day NE, Halvorsen KT, Prentice RL, Sabai C| title=Estimation of multiple relative risk functions in matched case-control studies. | journal=Am J Epidemiol | year= 1978 | volume= 108 | issue= 4 | pages= 299–307 | pmid=727199 | doi= 10.1093/oxfordjournals.aje.a112623| pmc= | url=https://www.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&amp;amp;tool=sumsearch.org/cite&amp;amp;retmode=ref&amp;amp;cmd=prlinks&amp;amp;id=727199  }} &amp;lt;/ref&amp;gt; It is the most flexible and general procedure for matched data.&lt;br /&gt;
&lt;br /&gt;
==Motivation==&lt;br /&gt;
Observational studies use [[stratification (clinical trials)|stratification]] or [[Matching (statistics)|matching]] as a way to control for [[confounding]]. Several tests existed before conditional logistic regression for matched data as shown in  [[Conditional logistic regression#Related tests|related tests]]. 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.&lt;br /&gt;
&lt;br /&gt;
Logistic regression can take into account stratification by having a different constant term for each strata. Let us denote &amp;lt;math&amp;gt;Y_{i\ell}\in\{0,1\}&amp;lt;/math&amp;gt; the label (e.g. case status) of the &amp;lt;math&amp;gt;\ell&amp;lt;/math&amp;gt;th observation of the &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;th strata and &amp;lt;math&amp;gt;X_{i\ell}\in\mathbb{R}^p&amp;lt;/math&amp;gt; the values of the corresponding predictors. Then, the likelihood of one observation is&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \mathbb{P}(Y_{i\ell}=1|X_{i\ell})=\frac{\exp(\alpha_i + \boldsymbol\beta^\top X_{i\ell})}{1+\exp(\alpha_i + \boldsymbol\beta^\top X_{i\ell})}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;\alpha_i&amp;lt;/math&amp;gt; is the constant term for the &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;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 &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;  (it equals &amp;lt;math&amp;gt;\frac{N}{2}+p&amp;lt;/math&amp;gt;). 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.&amp;lt;ref&amp;gt;{{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 }}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conditional likelihood==&lt;br /&gt;
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&lt;br /&gt;
:&amp;lt;math&amp;gt; &lt;br /&gt;
\begin{align}&lt;br /&gt;
&amp;amp; \mathbb{P}(Y_{i1}=1,Y_{i2}=0|X_{i1},X_{i2},Y_{i1}+Y_{i2}=1) \\&lt;br /&gt;
&amp;amp; =\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]&lt;br /&gt;
\ &amp;amp; =\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]&lt;br /&gt;
\ &amp;amp; =\frac{\exp(\boldsymbol{\beta}^\top X_{i1})}{\exp(\boldsymbol{\beta}^\top X_{i1})+\exp(\boldsymbol{\beta}^\top X_{i2})}. \\[6pt]&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With similar computations, the conditional likelihood of a strata of size &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt;, with the &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; first observations being the cases, is &lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbb{P}(Y_{ij}=1\text{ for }j\leq k,Y_{ij}=0\text{ for } k&amp;lt;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}}  \exp(\sum_{j\in J}\boldsymbol{\beta}^\top X_{ij})},&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\mathcal{C} _{k}^{m}&amp;lt;/math&amp;gt; is the set of all subsets of size &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; of the set &amp;lt;math&amp;gt;\{1,...,m\}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The full conditional log likelihood is then simply the sum of the log likelihoods for each strata. The estimator is then defined as the &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt; that maximizes the conditional log likelihood.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
Conditional logistic regression is available in R as the function &amp;lt;code&amp;gt;clogit&amp;lt;/code&amp;gt; in the survival package. It is in the survival package because the log likelihood of a conditional logistic model is the same as the log likelihood of a Cox model with a particular data structure.&amp;lt;ref&amp;gt;{{cite web |url=https://stat.ethz.ch/R-manual/R-devel/library/survival/html/clogit.html |title=R documentation Conditional logistic regression |last1=Lumley |first1=Thomas |date= |website= |publisher= |access-date=November 3, 2016}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Related tests==&lt;br /&gt;
* [[Paired difference test]] allows to test the association between a binary outcome and a continuous predictor while taking into account pairing.&lt;br /&gt;
* [[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]].&amp;lt;ref&amp;gt;{{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 | doi=10.2307/2530253}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
{{reflist}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Logistic regression]]&lt;/div&gt;</summary>
		<author><name>Felixbalazard</name></author>	</entry>

	</feed>