Concept Architecture
Fixed Effects in Panel Data Analysis
Fixed effects estimation analyses longitudinal data by comparing each patient, hospital or area only with itself at other times. Anything about that unit which does not change over the study period, recorded or not, then drops out of the estimate. Health economists use it to estimate how events and policies change costs and quality of life when exposure is not randomised and the units exposed differ in ways the data do not capture. Meta-analysis uses the same words for a different idea, the fixed-effect model that assumes every study estimates one common effect, which is not the subject here.
Stable unobserved differences as a source of bias
Units that experience an exposure are rarely comparable with those that do not. Patients who have a complication may have been frailer beforehand, and hospitals with longer stays may differ in quality of care. Such traits cause confounding, and adding measured covariates removes only the measured part.
Jones, reviewing panel data methods in applied health economics, notes that correlation between unobservable individual effects and the regressors leads to omitted variable bias and inconsistent estimates. In one hospital panel he describes, the hospital effect captures factors such as quality of care that are likely to be correlated with both costs and length of stay. NICE Decision Support Unit Technical Support Document 17 (TSD 17) describes panel data as offering the advantage of using the individual as their own control.
The model and the within transformation
The basic linear model treats each unit's stable traits as its own intercept. For a panel of units observed over several periods it is written as follows.
where is the outcome for unit in period , such as an EQ-5D utility or an annual cost, is the unit's fixed effect, is a vector of time-varying explanatory variables including the exposure, is the vector of coefficients and is the error term. Nothing is assumed about how relates to .
Subtracting each unit's own mean from every variable removes , which Jones calls the within-groups estimator.
where , and are unit 's means over its periods. For one explanatory variable, least squares on the demeaned data gives the estimator below.
where is the fixed effects estimate and the sums run over all units and periods. Jones adds that first differences also remove the unit effects and that identification needs sufficient variation over time. A unit whose exposure never changes contributes nothing to the slope, and a variable constant within every unit, such as sex, cannot be estimated.
Period effects and the link to difference-in-differences
Outcomes and costs often drift for everyone through ageing or price changes, and a model with unit effects alone would credit that drift to any exposure changing at the same time. Adding a fixed effect for each period gives the two-way model.
where is the effect of period shared by all units, equals 1 when unit is exposed in period and 0 otherwise, and is the exposure effect. TSD 17 notes that with longitudinal data the difference-in-differences estimator is the first difference estimator used to obtain consistent estimates in the presence of fixed effects. That page covers staggered adoption, where one two-way coefficient can mislead. Jones describes a two-way fixed effects study of Taiwan's July 1998 global budget for outpatient dental care that used up to 48 monthly claims observations per dentist, each dentist acting as their own control.
Assumptions behind a causal reading
Other biases remain. Gunasekara and colleagues state that neither fixed effects nor mixed models control for unmeasured time-varying confounding or reverse causation. The NICE real-world evidence framework (ECD9) makes a similar point about self-controlled designs, which share the within-person logic and still need adjustment for covariates that change over time, such as disease severity.
Imai and Kim identify two further assumptions that applied researchers often overlook. Past treatments must not directly influence the current outcome, and past outcomes must not affect current treatment. The second fails whenever a poor result prompts a change in care, as when an emergency admission leads to a new prescription. Jones notes that the within-groups estimator breaks down when the lagged outcome is a regressor, and Arellano and Bond's estimators are used instead.
Cameron and Miller explain that unit fixed effects remove only part of the within-unit correlation of errors, so standard errors should still be clustered on the unit. Identification also limits what a decision model can borrow, since an event's estimated effect on cost comes only from units that had the event during follow-up.
Choosing between fixed and random effects
The usual alternative treats unit effects as random draws uncorrelated with the regressors, as in a mixed effects model with a random intercept. Dieleman and Templin, writing for observational health studies, explain that random effects estimation uses within- and between-group variation and is efficient when that independence holds but biased when it fails, while fixed effects estimation stays unbiased at the cost of precision and of estimates for group-level variables.
The Hausman test compares the two sets of estimates. TSD 17 notes that software reports it routinely and that rejection may reflect misspecification. Cameron and Miller warn that its standard form assumes random effects is fully efficient, which needs errors free of heteroskedasticity and within-cluster correlation, and describe a cluster-robust version. A within-between specification, following Mundlak, adds each unit's mean of the regressors to a random effects model. Dieleman and Templin's 2016 correction reports its within effects as identical to fixed effects estimates in finite samples, and as a random effects model it can still include variables constant within units.
Binary and categorical outcomes
Many outcomes, such as self-assessed health or a hospital admission, are binary or ordered. Jones explains that the incidental parameter problem makes fixed effects hard to apply in such nonlinear models, and that for binary data the conditional fixed effects logit of Chamberlain removes the individual effect and gives consistent estimates. Only people whose outcome and regressors vary are used, which often cuts the sample substantially, and partial effects are hard to calculate. A pooled logistic regression keeps the original confounding.
Fixed effects in economic evaluation and HTA
Fixed effects estimates mostly enter economic evaluation as model inputs from longitudinal cohorts and claims data. TSD 17 lists panel data models among the options when selection on observables is untenable and longitudinal individual patient data exist, alongside instrumental variable analysis. The estimates can then feed a Markov model in a cost-utility analysis.
Alva and colleagues estimated the effect of six diabetes-related complications on quality of life from seven rounds of EQ-5D questionnaires collected between 1997 and 2007 in the UK Prospective Diabetes Study. Their conference report, on 3,380 patients, found variation in utility between patients more than twice that within a patient over time, often correlated with the likelihood of complications, and cross-sectional analysis overestimated the effects of complications on utility. In a second stage they regressed the estimated fixed effects on time-invariant patient characteristics. For a model applying a disutility to each complication, the estimator chosen changes the QALYs gained by preventing it.
Worked example with a stroke utility decrement
All numbers in this example are illustrative. Four patients complete an EQ-5D questionnaire in two annual waves, and patients C and D have a stroke between the waves. They were already in poorer health at wave 1, a stable difference the data do not record.
| Patient | Stroke between waves | Utility at wave 1 | Utility at wave 2 | Change |
|---|---|---|---|---|
| A | No | 0.85 | 0.84 | minus 0.01 |
| B | No | 0.81 | 0.80 | minus 0.01 |
| C | Yes | 0.72 | 0.62 | minus 0.10 |
| D | Yes | 0.68 | 0.56 | minus 0.12 |
1. Cross-sectional comparison. At wave 2 mean utility is (0.62 + 0.56) / 2 = 0.59 with stroke and (0.84 + 0.80) / 2 = 0.82 without, a difference of −0.23. At wave 1, before any stroke, the same groups average 0.70 and 0.83, a stable gap of −0.13.
2. One-way fixed effects. Patient C's mean is 0.67, giving demeaned utilities of 0.05 and −0.05. Patient D's mean is 0.62, giving 0.06 and −0.06. The demeaned stroke indicator is −0.5 then 0.5 for C and D, and 0 for A and B.
where the numerator sums the products of demeaned stroke and demeaned utility and the denominator sums the four squared demeaned stroke values. This equals the mean change for C and D.
3. Two-way fixed effects. A and B decline by 0.01, so with a period effect the estimate is −0.11 − (−0.01) = −0.10. The cross-sectional figure splits into this effect and the stable gap, since −0.10 + (−0.13) = −0.23.
4. Cost-effectiveness. A new drug avoids 0.02 strokes per patient at an incremental cost of GBP 300, and the decrement lasts 5 years, with no discounting, deaths or stroke costs.
where is the incremental cost per patient in GBP, the strokes avoided per patient, the annual utility decrement and its duration in years.
| Estimate | Decrement | QALYs gained per patient | ICER (GBP per QALY) |
|---|---|---|---|
| Cross-sectional | 0.23 | 0.023 | 13,043 |
| One-way fixed effects | 0.11 | 0.011 | 27,273 |
| Two-way fixed effects | 0.10 | 0.010 | 30,000 |
5. Interpretation. The cross-sectional decrement more than doubles the QALY gain by crediting the stroke with poorer health these patients already had. Under the NICE manual (PMG36), a most plausible ICER below GBP 25,000 per QALY gained is normally judged on the cost-effectiveness estimate (section 6.3.4), while within the GBP 25,000 to GBP 35,000 range the committee refers explicitly to further factors (section 6.3.7). The two-way estimate places the drug in that range, still assuming no missing time-varying cause of both stroke and utility.
Other meanings of fixed effect
In mixed models, fixed effects are the population-level coefficients, not unit intercepts. Jones also describes within-sibling and within-twin designs that apply the same logic to shared family background.
Limitations and common misreadings
Most errors come from treating fixed effects as a general remedy for confounding, when it removes only the stable part. The others come from overlooking which units and which variation identify the estimate.
- Treating it as full control for confounding. Confounders that change over time remain.
- Ignoring feedback. When outcomes shape later treatment, an identifying assumption fails.
- Expecting estimates for stable characteristics. These are absorbed, though a second-stage regression can describe them.
- Overlooking who identifies the estimate. Only units whose exposure changes identify the effect, while unexposed units inform only the period effects.
- Reading the Hausman test as decisive. Rejection can reflect misspecification.
- Using default standard errors. Errors stay correlated within units.
Sources
- Alva M, Gray A, Mihaylova B, Clarke P. The effect of diabetes complications on health-related quality of life: the importance of longitudinal data to address patient heterogeneity. Health Economics. 2014;23(4):487-500. https://doi.org/10.1002/hec.2930
- Alva M, Gray A, Mihaylova B, Clarke P. The effect of diabetes complications on health-related quality of life: estimating the bias due to unobserved heterogeneity using the UKPDS. Trials. 2011;12(Suppl 1):A64. https://doi.org/10.1186/1745-6215-12-S1-A64
- Cameron AC, Miller DL. A practitioner's guide to cluster-robust inference. Journal of Human Resources. 2015;50(2):317-372. https://doi.org/10.3368/jhr.50.2.317
- Dieleman JL, Templin T. Random-effects, fixed-effects and the within-between specification for clustered data in observational health studies: a simulation study. PLoS ONE. 2014;9(10):e110257. Correction in PLoS ONE. 2016;11(5):e0156508. https://doi.org/10.1371/journal.pone.0110257
- Faria R, Hernández Alava M, Manca A, Wailoo AJ. NICE DSU Technical Support Document 17: The use of observational data to inform estimates of treatment effectiveness in technology appraisal: methods for comparative individual patient data. Decision Support Unit; May 2015. https://doi.org/10.15131/shef.data.33847855.v1
- Gunasekara FI, Richardson K, Carter K, Blakely T. Fixed effects analysis of repeated measures data. International Journal of Epidemiology. 2014;43(1):264-269. https://doi.org/10.1093/ije/dyt221
- Imai K, Kim IS. When should we use unit fixed effects regression models for causal inference with longitudinal data? American Journal of Political Science. 2019;63(2):467-490. https://doi.org/10.1111/ajps.12417
- Jones AM. Panel data methods and applications to health economics. HEDG Working Paper 07/18. University of York; 2007. https://www.york.ac.uk/media/economics/documents/herc/wp/07_18.pdf
- National Institute for Health and Care Excellence. NICE real-world evidence framework (ECD9). Published 23 June 2022. https://www.nice.org.uk/corporate/ecd9/chapter/methods-for-real-world-studies-of-comparative-effects
- National Institute for Health and Care Excellence. NICE technology appraisal and highly specialised technologies guidance: the manual (PMG36). Published 31 January 2022, last updated 13 October 2026. Sections 6.3.4 and 6.3.7. https://www.nice.org.uk/process/pmg36/chapter/committee-recommendations-2
Related Concepts (3)
Library
Publications
1
Statistical Analysis of Cost-Effectiveness Data — Willan & Briggs, 1st Edition ed., 2006 (John Wiley & Sons)
A synthesis of statistical methods for analysing cost-effectiveness data, including net-benefit regression, confidence intervals for the ICER, cost-effectiveness acceptability curves, and covariate adjustment. Part of the Wiley Statistics in Practice series.
BookView source →
Frequently Asked Questions (6)
What is a fixed effects model?
Fixed effects are unit-specific terms in panel data regression that remove bias from stable unmeasured traits of patients, hospitals or areas.
Source: Jones 2007
How does a fixed effects model control for stable individual differences?
Repeated observations on the same patient, hospital or area let each unit act as its own control. NICE Decision Support Unit Technical Support Document 17 describes this as the advantage that panel data offer. In a fixed effects model every unit receives its own intercept, which absorbs any trait that stays constant over the study period, whether or not the data record it. Frailty that predates a complication therefore drops out of the comparison instead of being credited to the complication. The effect of an exposure is then estimated only from changes within units over time, so stable differences between units cannot bias it.
Source: Faria et al. 2015
How does a fixed effects model work?
The linear fixed effects model writes the outcome for each unit and period as a unit-specific intercept plus the effects of time-varying explanatory variables plus an error term. Jones calls the usual estimator the within-groups estimator, because subtracting each unit's own mean from every variable removes the intercept, after which least squares is applied to the deviations. Taking first differences between periods removes the unit effects in the same way. Identification needs sufficient variation over time, so a unit whose exposure never changes adds nothing to the slope. Adding a fixed effect for each period gives the two-way model, which stops drift shared by all units being credited to the exposure.
Source: Jones 2007
What does a fixed effects model control for?
Every stable characteristic of a patient, hospital or area is held constant, measured or not, because each unit's own intercept absorbs it. Gunasekara and colleagues state that neither fixed effects nor mixed models control for unmeasured time-varying confounding or reverse causation. A change in disease severity that coincides with a new treatment can therefore still bias the estimate unless severity is measured and included as a covariate. Reverse causation arises when a poor outcome prompts the change in exposure, as when an emergency admission leads to a new prescription. Period effects can be added to absorb trends that affect all units equally.
Source: Gunasekara et al. 2014
What are the limitations of a fixed effects model?
Variables that never change within a unit, such as sex, cannot be estimated by fixed effects, because the unit intercepts absorb them. Jones notes that identification rests on sufficient variation over time, so only units whose exposure changes identify the effect and an event's estimated effect comes only from units that had the event during follow-up. The within-groups estimator breaks down when a lagged outcome is a regressor, and Arellano and Bond's estimators are used instead. For binary outcomes the incidental parameter problem leads to the conditional fixed effects logit, which keeps only people whose outcome and regressors vary, often cuts the sample substantially and makes partial effects hard to calculate.
Source: Jones 2007
How does a fixed effects model differ from a random effects model?
A random effects model treats the unit effects as random draws uncorrelated with the regressors, whereas a fixed effects model assumes nothing about how they relate. Dieleman and Templin explain that random effects estimation uses both within-group and between-group variation and is efficient when that independence holds, but biased when it fails. Fixed effects estimation stays unbiased in that case, at the cost of precision and of any estimate for group-level variables. A within-between specification, following Mundlak, adds each unit's mean of the regressors to a random effects model. According to the authors' 2016 correction, its within effects equal the fixed effects estimates, while variables constant within units can still be included.
Source: Dieleman & Templin 2014
Trust Record
Verified by Dr Darrin Baines
British health economist
Professional identity: darrinbaines.org
Verification date: 26 Oct 2026
Content version: 1.0.1
Canonical Identity
- Persistent URI
- https://healtheconomics.wiki/concept/fixed-effects
- Term code
- HE-ES-SA-067
Stable URI · Machine-readable · Resolvable · CC BY 4.0
