Tutorials › Econometrics (Graduate) › Debiased Logistic Regression with Many Covariates

High-Dimensional Econometrics · Tutorial 930 of 952

Debiased Logistic Regression with Many Covariates

See how a score-based correction reduces lasso shrinkage in logistic regression and supports uncertainty estimates for a selected coefficient.

Advanced 10 min read

What You'll Learn

  • Write the logistic likelihood and l1-penalized objective when the number of covariates is large.
  • Identify the Fisher information matrix and the score used in a debiasing correction.
  • Explain how an approximate inverse information matrix reduces first-order shrinkage bias.
  • State key assumptions and sparsity conditions for asymptotic coefficient inference.
  • Calculate a corrected coefficient, its standard error, and a confidence interval.
  • Distinguish valid coefficient-level inference from unsupported claims about causality or model selection.

Why Logistic Regression Needs a Debiasing Step

In binary-outcome applications, logistic regression models the probability of an event using a linear predictor on the log-odds scale. When the number of covariates is large relative to the sample size, an l1 penalty can make estimation feasible and encourage a sparse fit. But the penalty also shrinks estimated coefficients toward zero. The resulting coefficient estimates are useful for fitting and prediction, yet ordinary standard errors calculated as if the selected model had been specified in advance do not generally account for this shrinkage and selection.

Debiased logistic regression targets a different goal: inference for a specified coefficient in a high-dimensional model. It starts with a penalized estimate, then adds a correction based on the logistic score and an approximate inverse of the information matrix. Under suitable assumptions, the correction removes the leading shrinkage error, leaving an estimator that is approximately normal. This is not a guarantee for every coefficient or data set; the assumptions and quality of the approximate inverse matter.

Model, Penalized Estimate, and Score

For independent observations \(i=1,\ldots,n\), let \(Y_i\) be a binary outcome and let \(Z_i=(1,X_{i1},\ldots,X_{ip})^\top\) contain an intercept and \(p\) covariates. The logistic model specifies \(P(Y_i=1\mid Z_i)=\mu_i(\beta_0)=\{1+\exp(-Z_i^\top\beta_0)\}^{-1}\). Here \(\beta_0\) is the population coefficient vector; it is not the intercept alone. The intercept is typically left unpenalized.

Definition: The logistic negative log-likelihood per observation is $$ L_n(\beta)=\frac{1}{n}\sum_{i=1}^n\left[\log\{1+\exp(Z_i^\top\beta)\}-Y_i Z_i^\top\beta\right]. $$ An l1-penalized estimate minimizes $$ \hat{\beta}\in\arg\min_{\beta}\left\{L_n(\beta)+\lambda\sum_{k=1}^{p}|\beta_k|\right\}, $$ where \(\lambda>0\) controls shrinkage and the sum excludes the intercept. Write \(\hat{\mu}_i=\{1+\exp(-Z_i^\top\hat{\beta})\}^{-1}\).

The score of the unpenalized log-likelihood, divided by \(n\), is \(n^{-1}\sum_i Z_i(Y_i-\mu_i)\). The gradient of the negative log-likelihood has the opposite sign. The observed Hessian of \(L_n\), evaluated at a coefficient vector \(\beta\), is

$$ \hat{J}(\beta)=\frac{1}{n}\sum_{i=1}^n \mu_i(\beta)\{1-\mu_i(\beta)\}Z_iZ_i^\top. $$

This is the empirical Fisher information for the logistic model. Its population counterpart at the true parameter is \(J=E[\mu_i(\beta_0)\{1-\mu_i(\beta_0)\}Z_iZ_i^\top]\). In a high-dimensional problem, \(J\) need not be directly invertible or estimable by an unrestricted matrix inverse.

Worked Example: Evaluating a Penalized Logistic Objective

Consider six hypothetical observations with one covariate \(x\), an intercept, and binary outcomes. Suppose a candidate coefficient vector is \(\beta=( -0.4,\,0.8)^\top\), and the penalty is \(\lambda=0.2\). The covariate values are \(0,0,1,1,2,2\), with outcomes \(0,1,1,0,1,1\), respectively. Evaluate the penalized objective at this candidate; this calculation evaluates the objective but does not claim that the candidate is its minimizer.

For \(x=0\), the linear predictor is \(-0.4\). The negative log-likelihood contribution is \(\log(1+\exp(-0.4))=0.5130\) when \(Y=0\), and \(\log(1+\exp(0.4))=0.9130\) when \(Y=1\). For \(x=1\), the predictor is \(0.4\), giving contributions \(0.5130\) for \(Y=1\) and \(0.9130\) for \(Y=0\). For each \(x=2,Y=1\) observation, the predictor is \(1.2\), and the contribution is \(\log(1+\exp(-1.2))=0.2633\).

Thus the total negative log-likelihood is \(0.5130+0.9130+0.5130+0.9130+2(0.2633)=3.3786\), so \(L_n(\beta)=3.3786/6=0.5631\). Only the slope is penalized, giving penalty \(0.2|0.8|=0.1600\). The penalized objective is \(0.5631+0.1600=0.7231\).

The Score-Based Debiasing Correction

For a target coordinate \(j\), let \(e_j\) denote the vector with a one in coordinate \(j\) and zeros elsewhere. The ideal correction uses the \(j\)th column of \(J^{-1}\), which we denote \(w_j=J^{-1}e_j\), when that inverse and column are well defined. In practice, an estimate \(\hat{w}_j\) is constructed to approximately invert the empirical information in the relevant direction. For example, a nodewise lasso or a related constrained optimization can estimate a sparse approximate inverse. The desired diagnostic is that \(\hat{J}(\hat{\beta})\hat{w}_j\) is close to \(e_j\), often in maximum-coordinate norm.

Definition: A score-based debiased estimate of coefficient \(j\) is $$ \tilde{\beta}_j=\hat{\beta}_j+ \hat{w}_j^\top\left\{\frac{1}{n}\sum_{i=1}^n Z_i(Y_i-\hat{\mu}_i)\right\}. $$ The added term is the estimated inverse-information direction applied to the average logistic score evaluated at the penalized estimate.

The correction addresses a specific source of error. The l1 penalty can leave the score at \(\hat{\beta}\) nonzero, and this residual score contains information about shrinkage. Multiplication by \(\hat{w}_j\) translates that score into an adjustment on the scale of coefficient \(j\). If the approximate inverse is accurate enough, the leading effect of the penalized estimation error cancels.

Worked Example: Applying the Score Correction

Suppose a hypothetical binary-outcome analysis with \(n=400\) observations estimates a target log-odds coefficient for an exposure. The penalized estimate is \(\hat{\beta}_j=0.300\). At that fitted vector, suppose the average score across three coordinates is \((0.040,-0.020,0.030)^\top\), and the estimated inverse-information direction for the target is \(\hat{w}_j=(0.50,-0.10,0.20)^\top\). Treat these as hypothetical fitted quantities from a high-dimensional analysis.

The score adjustment is \(0.50(0.040)+(-0.10)(-0.020)+0.20(0.030)=0.020+0.002+0.006=0.028\). Therefore \(\tilde{\beta}_j=0.300+0.028=0.328\). The correction moves this coefficient away from zero, but that direction is not guaranteed in every application. The approximate inverse must also be checked: a large correction or a poor inverse-information diagnostic may indicate that the coefficient estimate is not reliable for inference.

Why the Correction Can Support Inference

The core justification is a first-order expansion of the logistic score. Let \(U_n(\beta_0)=n^{-1}\sum_i Z_i\{Y_i-\mu_i(\beta_0)\}\). A Taylor expansion around \(\beta_0\) gives, schematically, \(n^{-1}\sum_i Z_i(Y_i-\hat{\mu}_i)=U_n(\beta_0)-\hat{J}(\bar{\beta})(\hat{\beta}-\beta_0)\), where \(\hat{J}(\bar{\beta})\) is the Hessian at an intermediate point and the expression is exact with that intermediate Hessian along the line between the two coefficient vectors. Substituting this expansion into the correction yields the following terms:

$$ \tilde{\beta}_j-\beta_{0j} = \hat{w}_j^\top U_n(\beta_0) +\left\{e_j^\top-\hat{w}_j^\top\hat{J}(\bar{\beta})\right\} (\hat{\beta}-\beta_0). $$

If the inverse-information direction is accurate, the bracketed term is small. If the penalized estimator is sufficiently close to \(\beta_0\) in the relevant norm and the Taylor remainder is negligible, this second term is smaller than the leading random score term. The first term is an average of independent mean-zero contributions under correct specification. A central limit argument then motivates approximate normality. This is the logistic counterpart of the score-based logic in debiased lasso inference.

1
Control estimation error.
Assume the coefficient vector is sparse or well approximated by a sparse vector, and the design satisfies suitable restricted-eigenvalue or compatibility conditions. These support a sufficiently accurate l1-penalized estimate.
2
Control inverse-information error.
Assume the target direction \(J^{-1}e_j\) is estimable with enough accuracy, for example because it is sparse or approximately sparse, and verify that the empirical information matrix times its estimate is close to \(e_j\).
3
Control the logistic approximation.
Assume independent observations, a correctly specified conditional mean, adequate covariate moments or bounded covariates, and probabilities bounded away from zero and one. These conditions help control score concentration and the Taylor remainder.
4
Check sparsity relative to sample size.
One commonly used sufficient regime, under suitable design and inverse-information conditions, requires \(s\log(p)/\sqrt{n}\to0\) and \(s_j\log(p)/\sqrt{n}\to0\), where \(s\) measures coefficient sparsity and \(s_j\) measures sparsity of the target inverse-information direction. Exact conditions depend on the estimator and design.

These are conditions for an asymptotic result, not automatic consequences of fitting a penalized model. In particular, severe separation, near-zero or near-one fitted probabilities, highly ill-conditioned information, or a target direction that is too dense can undermine the approximation. The chosen penalty and nuisance estimates must also be constructed in a way compatible with the inference procedure.

Standard Errors and Confidence Intervals

Under correct logistic specification, the conditional variance of \(Y_i\) is \(\mu_i(\beta_0)\{1-\mu_i(\beta_0)\}\). Consequently, the leading score term in the expansion has asymptotic variance \(w_j^\top Jw_j/n\); for the ideal inverse direction, this equals \((J^{-1})_{jj}/n\). A practical estimate can use the empirical variance of the corrected score contributions:

$$ \widehat{V}_j= \frac{1}{n}\sum_{i=1}^n \left[\hat{w}_j^\top Z_i(Y_i-\hat{\mu}_i)\right]^2, \qquad \widehat{SE}(\tilde{\beta}_j)=\sqrt{\frac{\widehat{V}_j}{n}}. $$

A two-sided approximate \(100(1-\alpha)\%\) confidence interval is \(\tilde{\beta}_j\pm z_{1-\alpha/2}\widehat{SE}(\tilde{\beta}_j)\), where \(z_{1-\alpha/2}\) is the corresponding standard normal quantile. This is a large-sample interval for a particular coefficient, conditional on the modeling and regularity assumptions; it is not a finite-sample guarantee.

Worked Example: A Confidence Interval for an Exposure Coefficient

Continue with the hypothetical analysis above. The debiased exposure coefficient is \(0.328\). Suppose the empirical variance estimate from the corrected score contributions is \(\widehat{V}_j=0.640\), based on \(n=400\) independent observations. Find a 95% confidence interval and interpret it.

The estimated standard error is \(\sqrt{0.640/400}=\sqrt{0.0016}=0.0400\). Using \(z_{0.975}=1.96\), the margin of error is \(1.96(0.0400)=0.0784\). Thus the interval is \(0.328\pm0.0784=(0.2496,\,0.4064)\), in log-odds units per one-unit increase in exposure.

Under the stated model and regularity conditions, this procedure has approximately 95% coverage over repeated samples. The data are compatible with exposure coefficients from 0.2496 to 0.4064 log-odds units per unit increase, under the model. Exponentiating gives an odds-ratio estimate of \(\exp(0.328)=1.388\) and an interval of approximately \((\exp(0.2496),\exp(0.4064))=(1.283,1.501)\). This describes a conditional odds ratio; it does not by itself establish a causal effect.

Common Pitfalls and Scope of the Result

  • Treating the penalized estimate as an ordinary maximum-likelihood estimate. The l1 penalty changes the estimating equation and shrinks coefficients. The correction and its variance calculation are designed for this setting; plugging the penalized coefficient into an ordinary low-dimensional logistic regression standard-error formula does not generally solve the problem.
  • Assuming any inverse-information estimate will work. A correction based on an inaccurate direction may leave substantial bias. Check approximate inverse diagnostics and the assumptions supporting the direction estimator.
  • Interpreting a confidence interval as a probability statement about the fixed coefficient. A 95% procedure has approximately 95% repeated-sampling coverage under its assumptions; it does not mean there is a 95% probability that the fixed parameter lies in this realized interval.
  • Equating coefficient inference with model discovery or causality. A valid interval for one coefficient does not establish that all selected variables are relevant, nor does a conditional association become causal without an appropriate identification argument.
  • Ignoring failure of sparsity or overlap. If the coefficient vector or target inverse-information direction is too dense, or probabilities are extreme, the required rates and approximations may fail. Debiasing is not a remedy for every high-dimensional difficulty.
Key takeaway: Debiased logistic regression combines an l1-penalized fit with an inverse-information-weighted score correction. Coefficient-level confidence intervals are justified only when model, design, sparsity, and approximation conditions make the remaining bias negligible relative to the score variation.

Check Your Understanding

Answer each question using the definitions and conditions in this tutorial.

  1. Why is the intercept typically excluded from the l1 penalty in the logistic objective?
  2. What quantity is multiplied by the approximate inverse-information direction in the debiasing correction?
  3. In the expansion of the corrected estimate, what role does the condition \(\hat{J}\hat{w}_j\approx e_j\) play?
  4. If the target coefficient is \(0.20\), its estimated standard error is \(0.05\), and a 95% normal critical value is \(1.96\), calculate the confidence interval.
  5. Give two reasons why a fitted debiased logistic model might not support reliable coefficient inference.
  6. Why does a confidence interval for a logistic regression coefficient not, by itself, establish a causal effect?
Clinical Biostats