Two Ways to Factor the Same Joint Likelihood
A logistic regression model specifies the probability of an outcome given covariates. In a population sample, the likelihood can therefore be organized around the covariates first and the outcomes second. In a case-control sample, it is natural to organize the same joint distribution around the outcome groups instead. These are distinct factorizations of a joint law, not automatically distinct population models.
Let \(Y\in\{0,1\}\) be a binary outcome and let \(X\) denote a covariate vector. Suppose the source-population outcome model is
Write \(f_X(x)\) for the density or mass function of \(X\), with respect to an appropriate common measure, and let \(\pi=P(Y=1)\). Assume \(0<\pi<1\), and that the logistic model and \(f_X\) define a joint distribution for which the probabilities and densities below exist. The prevalence is determined by both the regression model and the covariate distribution:
For discrete \(X\), the integral means a sum. The outcome-specific covariate distributions are denoted \(f_1(x)=f(x\mid Y=1)\) and \(f_0(x)=f(x\mid Y=0)\), wherever the corresponding outcome has positive probability.
Population Likelihoods
For \(n\) independent observations \((y_i,x_i)\) from the source population, the prospective likelihood is obtained by multiplying the joint densities. Define \(\eta_i=\alpha+\beta^{\mathsf T}x_i\). The Bernoulli probability can be written \(p(x_i)^{y_i}\{1-p(x_i)\}^{1-y_i}\), giving
This factorization displays the covariate-distribution contribution and the logistic outcome contribution. If inference conditions on the observed covariates in an ordinary prospective design, the factors \(f_X(x_i)\) are not part of that conditional likelihood for \((\alpha,\beta)\). If instead the joint distribution of outcomes and covariates is being modeled, the covariate distribution remains part of the joint likelihood.
The retrospective factorization follows from the product rule for joint probabilities and densities:
In the logistic model, Bayes’ rule gives the outcome-specific covariate distributions
Consequently, the retrospective likelihood for the same population observations is
This expression equals the prospective likelihood exactly: for each observation, the factor \(\pi\) or \(1-\pi\) cancels the corresponding denominator in \(f(x_i\mid y_i)\). The equality is an algebraic identity, not an approximation. Importantly, \(\pi\) is not generally an unrelated free quantity in this model: it is the integral of \(p(x)f_X(x)\).
Worked Example: Expanding a Prospective Likelihood
Suppose two observations have covariates \(x_1,x_2\) and outcomes \(y_1=1,y_2=0\). Let \(p_i=p(x_i)\). Their prospective likelihood is
In retrospective form, the same likelihood is
Multiplying the factors cancels \(\pi(1-\pi)\) against the two denominators, leaving \(f_X(x_1)f_X(x_2)p_1(1-p_2)\), precisely the prospective expression. The outcome-specific covariate densities in the retrospective expression still depend on the logistic probabilities \(p_1,p_2\).
What Outcome-Dependent Sampling Changes
In case-control sampling, inclusion depends on the outcome. A useful basic design selects a person with probability \(s_1\) if \(Y=1\) and \(s_0\) if \(Y=0\), where \(s_0,s_1>0\), with selection independent of \(X\) conditional on \(Y\). Let \(S=1\) indicate selection. The probability of selection in the source population is
The joint density among selected people is therefore \(f(y,x\mid S=1)=s_y f(y,x)/C\). Define the selected-sample case fraction \(q=P(Y=1\mid S=1)=s_1\pi/C\). Conditioning the selected joint density on \(Y=y\) cancels the selection probability \(s_y\), so \(f(x\mid Y=y,S=1)=f(x\mid Y=y)\). Thus the selected-sample density has the retrospective factorization
This identity explains why the sampling design matters when writing a likelihood. If the study fixes the numbers of cases and controls, the outcome labels and their counts are fixed by design. Conditional on those labels, the likelihood for the observed covariates is
There is no likelihood contribution for the case fraction \(q\) in this conditional likelihood: the numbers of cases and controls were set rather than generated as random outcomes. If instead selected outcomes are treated as random, the selected joint likelihood also has the factor \(q^{n_1}(1-q)^{n_0}\), where \(n_1=\sum_i y_i\) and \(n_0=n-n_1\).
Proof. For \(y\in\{0,1\}\), selection depends only on \(Y\), so
The denominator is positive because \(s_y>0\). With fixed outcome labels, the sampled covariates are modeled by their conditional densities within the respective outcome groups; independence of sampled individuals gives their product. \(\square\)
Substituting the logistic model into this fixed-design likelihood makes its parameter dependence visible:
For fixed \(f_X\), the factors \(p(x_i)\), \(1-p(x_i)\), and generally \(\pi=\int p(x)f_X(x)\,dx\) involve \(\alpha\) and \(\beta\). The factors \(f_X(x_i)\) involve the covariate distribution. If that distribution is unknown, those terms cannot simply be discarded from a joint likelihood without specifying how the nuisance distribution is handled. The retrospective likelihood is not, in general, just the usual prospective Bernoulli likelihood with a different count of cases.
Worked Example: Calculating Outcome-Specific Covariate Distributions
Let \(X\) be binary with \(P(X=1)=0.30\). Suppose a logistic model gives \(P(Y=1\mid X=1)=0.3775\) and \(P(Y=1\mid X=0)=0.1192142857\). The population prevalence is
For cases, Bayes’ rule gives
For controls, \(P(Y=0)=1-0.1967=0.8033\), so
The two sampled groups therefore have different covariate distributions. The case-control likelihood uses the case-group probability for each case and the control-group probability for each control; those probabilities are formed from the logistic outcome probabilities and the source prevalence.
Worked Example: Random Versus Fixed Case Counts
Suppose outcome-only selection has \(s_1=0.8\), \(s_0=0.2\), and source prevalence \(\pi=0.10\). The overall selection probability and selected case fraction are
If 100 selected outcomes are treated as random and 30 are cases, their outcome-count likelihood contribution is \(q^{30}(1-q)^{70}\). If the design instead stipulated exactly 30 cases and 70 controls, those counts are fixed and this factor is absent from the likelihood conditional on the design. In both cases, conditional on each outcome label, the covariate distribution is the source \(f(x\mid Y=y)\), under the stated outcome-only selection assumption.
A Factorization Result and a Common Pitfall
The distinction between a joint likelihood and a likelihood conditional on design can be summarized precisely. Suppose observations are independent from a joint density \(f(y,x)\), and \(P(Y=y)>0\) for each outcome group represented. Then the joint likelihood factors into the outcome-count part and the covariate-within-outcome part:
Derivation. Apply \(f(y_i,x_i)=P(Y=y_i)f(x_i\mid Y=y_i)\) separately to every observation. There are \(n_1\) factors \(\pi f_1(x_i)\) and \(n_0\) factors \((1-\pi)f_0(x_i)\). Collecting the outcome-probability factors gives \(\pi^{n_1}(1-\pi)^{n_0}\), leaving the two products of conditional covariate densities. Under fixed case-control counts, conditioning on the labels removes this first factor. \(\square\)
A frequent mistake is to argue: “The study deliberately chose the number of cases, so the likelihood contains no logistic-regression parameters.” The first clause correctly says that the case-count factor is absent from the likelihood conditional on the labels. It does not imply that the covariate distributions within the case and control groups are parameter-free. In the logistic formulation, those distributions contain \(p(x)\) and the source prevalence \(\pi\); both can depend on the regression coefficients.
Another mistake is to treat \(\pi\) as the observed case fraction in a fixed case-control sample. The observed fraction is set by the sampling design and generally differs from source prevalence. The likelihood factorization keeps these quantities conceptually distinct: source prevalence appears in the population conditional densities, while the sample case fraction is a design feature when counts are fixed.
Check Your Understanding
Use the factorizations above to answer the following questions.
- Write the prospective likelihood for three observations with outcomes \(1,0,1\) and covariates \(x_1,x_2,x_3\).
- Why does \(f(x\mid Y=y,S=1)=f(x\mid Y=y)\) hold when selection depends only on outcome?
- In a fixed case-control design, which likelihood factor associated with outcome counts is omitted when conditioning on the observed labels?
- Explain why the retrospective covariate likelihood can still depend on \(\alpha\) and \(\beta\), even though the case count was fixed.
- Distinguish the source prevalence \(\pi\) from the selected-sample case fraction \(q\).