Firth logistic regression
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
- You need a risk ratio rather than an odds ratio. Choose a model for that measure. Read: Absolute and relative effects
- Outcomes are repeated within people or sites. Use a model that accounts for that dependence. Read: Mixed-effects models
Before you start
What you need
- A binary outcome at a defined timeoutcomeTypeSpecify which outcome counts as an event.
- Candidate parameters and sparse patternsCount categories and nonlinear terms, then check cross-tabulations and separation.
- 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.
- 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.
- The model matrix has full rank.How to check: Remove redundant coding; Firth correction cannot identify duplicated parameters.
- 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.
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.
Worked example
A worked example
- 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
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.
analysis.firth_logistic_regression, the id a plan cue records.Related Learn pages
Related designs and methods
Evidence
Sources & further reading
- A solution to the problem of separation in logistic regression (opens in a new tab) · Stat Med · doi 10.1002/sim.1047
- 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
- 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
- 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