Ask Mallard
Analysis method

Firth logistic regression

4 min read

Firth logistic regression reduces first-order coefficient bias and can give finite odds ratios when ordinary logistic regression separates.

Fit

When to use it, and when not to

Use it when

  • A binary-outcome model has separation or strong small-sample bias concerns.
  • You need odds ratios from a prespecified logistic model, with suitable uncertainty intervals.

Not when

Before you start

What you need

Decide these first
  1. A binary outcome at a defined timeoutcomeTypeSpecify which outcome counts as an event.
  2. Candidate parameters and sparse patternsCount categories and nonlinear terms, then check cross-tabulations and separation.
  3. Purpose-specific sample-size assessmentEvents per variable (EPV) is a minimum floor, not a method. For binary prediction development, use Riley 2019 and van Smeden; size effects for power or precision.
It rests on these
  1. The logistic mean model and adjustment set still need justification.How to check: Bias reduction does not remove confounding or correct a wrong functional form.
  2. The model matrix has full rank.How to check: Remove redundant coding; Firth correction cannot identify duplicated parameters.
  3. Missing-data and dependence assumptions remain explicit.How to check: State MAR or another justified missingness assumption, assess departures, and account for clustering where needed.

Plain language

How it works

Separation occurs when a predictor or a combination of predictors sorts outcomes so well that an ordinary logistic slope diverges. Firth fitting adds half the log determinant of the information matrix to the log likelihood. This reduces first-order coefficient bias. With a full-rank logistic design, it gives finite estimates under separation.

What the fit means

Heinze and Schemper study this solution; Heinze evaluates sparse-data inference. Profile penalized-likelihood intervals follow the penalized fit and are often preferable to Wald intervals here. The half-count result in the example is a special identity, not the procedure for general adjusted models.

The method as a flow
A single-method workflow. Binary outcomes and full-rank predictors. Fit the Firth likelihood penalty. Report odds ratios with penalized profile intervals. The diagram describes the analysis steps, not results from any study.Firth logistic regressionBinary outcomes and full-rank predictorsFit the Firth likelihood penaltyReport odds ratios with penalized profile intervalsModel assumptions and the study design still determine what the estimate can support.
Conceptual diagram. It shows the structure of the idea, not data from any study.

Worked example

A worked example

Invented for illustration
Setting
Two independent groups each contain 10 people. The exposed group has 4 events and 6 non-events; the comparison has 0 and 10.
Question
Can the group odds ratio be estimated despite separation?
Approach
Fit only an intercept and group indicator with the Firth likelihood penalty. This saturated two-group case has a half-count identity.
Result
The Firth odds ratio is 14.54: (4.5 divided by 6.5) divided by (0.5 divided by 10.5).
What it means
It is finite, while the ordinary maximum-likelihood odds ratio diverges. Use a profile penalized-likelihood confidence interval; a finite estimate can still be very uncertain.

In practice

Recent studies PubMed search · not vetted

Searching PubMed…

Watch out

Common mistakes

The one to remember

Finite coefficients after Firth correction do not create information or establish causality. Use profile penalized-likelihood intervals, especially with separation. Events per variable is a floor, not a sample-size method or a guarantee of adequate data.

  • Adding half a count as a general Firth algorithm.Instead: The half-count identity holds for this saturated two-group model. General covariate models require the penalized fit.
  • Using Wilson intervals for the adjusted odds ratio.Instead: Use profile penalized-likelihood intervals. Wald intervals are available, but can be unreliable with sparse or separated data.
  • Calling a finite estimate proof that the sample is adequate.Instead: Report information limits. Firth correction addresses bias and separation, not the study design or a lack of events.

Inside Mallard

How Mallard uses this

Plans do not link to this method yet. No method or sizing entry is mapped to this new article.

No Mallard code example points to this page.
Atlas node analysis.firth_logistic_regression, the id a plan cue records.

Related Learn pages

Related designs and methods

Evidence

Sources & further reading

  1. A solution to the problem of separation in logistic regression (opens in a new tab) · Stat Med · doi 10.1002/sim.1047
  2. A comparative investigation of methods for logistic regression with separated or nearly separated data (opens in a new tab) · Stat Med · doi 10.1002/sim.2687
  3. Minimum sample size for developing a multivariable prediction model: PART II - binary and time-to-event outcomes (opens in a new tab) · Stat Med · doi 10.1002/sim.7992
  4. Sample size for binary logistic prediction models: Beyond events per variable criteria (opens in a new tab) · Stat Methods Med Res · doi 10.1177/0962280218784726
Prepared with AI assistance. Source titles, authors, years and available DOIs were checked against PubMed on 2026-11-06. No independent professional approval is claimed. Heinze and Schemper support bias reduction and separation; Heinze supports profile penalized-likelihood inference. Riley and van Smeden concern binary prediction development, not power for a causal effect.
Last source review: 2026-11-06
AI-generated educational content
Mallard uses reputable methodological and reporting sources, but this material may contain errors or omit important context. Verify important methodological decisions with the cited sources and, when appropriate, a qualified research methodologist or statistician.