Skip to contents

Model fitting

The main estimator for panel GLMs (pooled, within, between and random effects) and the two models built on it for costs and structural zeros.

panglm()
Fit a generalized linear model for panel data
twopart()
Two-part model for panel cost data
panhurdle()
Fixed-effects hurdle model for panel count data
panglm-package
panglm: Generalized Linear Models for Panel Data

Outcome families

Family objects for the family argument of panglm().

Policy evaluation

Difference-in-differences, event studies and staggered-adoption estimators.

did()
Two-way fixed-effects difference-in-differences
eventstudy()
Event-study regression with a pre-trend test
attgt()
Group-time average treatment effects for staggered adoption
etwfe()
Extended two-way fixed-effects difference-in-differences
trendplot()
Plot raw outcome trends of a difference-in-differences design
treatmentplot()
Plot the treatment timing of a staggered design
panelplot()
Plot a panel as a unit by period heat map
eventplot()
Compare event studies on one plot

Endogeneity

Instrumental variables, Hausman-Taylor, dynamic panels by GMM and sample selection.

paniv()
Instrumental-variable estimators for linear panel models
pangmm()
Difference and system GMM for dynamic linear panel models
panselect()
Sample-selection correction for linear panel models

Heterogeneity

Quantile regression and latent classes. Random slopes are fitted by panglm() with model = "random" and its random argument.

panqr()
Quantile regression for panel data with individual effects
panfmm()
Latent class (finite mixture) models for panel data
panfmmselect()
Compare latent class panel models with different numbers of classes

Tests

Specification and hypothesis tests on fitted models.

panhausman()
Hausman specification test (fixed vs. random effects)
pandispersiontest()
Pearson chi-squared/df overdispersion test
jointtest()
Joint Wald test of coefficients
lineartest()
Test whether the effect of a regressor is linear

Post-estimation methods

Methods for panglm() fits, then for the other model classes.

panglm fits

summary(<panglm>)
Summarize a panglm fit
vcov(<panglm>)
Recompute the coefficient covariance matrix for a panglm fit
confint(<panglm>)
Confidence intervals for panglm coefficients
predict(<panglm>)
Predict from a fitted panglm model
predict(<panordered>)
Predict from an ordered panel model
fitted(<panglm>)
Extract fitted values from a panglm model
logLik(<panglm>)
Extract the model log-likelihood
model.matrix(<panglm>)
Design matrix of a panglm fit
residuals(<panglm>)
Extract residuals from a panglm model
fixef() ranef()
Individual effects of a panel model
plot(<panglm>)
Plot a fitted panglm model
coefplot()
Compare coefficient estimates of several fitted models
partialeffects()
Average partial effects
plot(<panglm_ape>)
Plot average partial effects
effectcurve()
Estimated effect curve of a regressor
plot(<panglm_effectcurve>)
Plot an effect curve

Other model classes

predict(<twopart>)
Predict from a two-part model
confint(<twopart>)
Confidence intervals for a two-part model
plot(<twopart>)
Plot a two-part model
coef(<panglm_hurdle>) vcov(<panglm_hurdle>) nobs(<panglm_hurdle>) confint(<panglm_hurdle>) summary(<panglm_hurdle>) print(<summary.panglm_hurdle>)
Coefficient methods for the hurdle model
plot(<panglm_hurdle>)
Plot a fitted panglm hurdle model
vcov(<panglm_eventstudy>) nobs(<panglm_eventstudy>) confint(<panglm_eventstudy>) summary(<panglm_eventstudy>) print(<summary.panglm_eventstudy>) logLik(<panglm_eventstudy>)
Methods for event-study fits
plot(<panglm_eventstudy>)
Plot event-study coefficients
summary(<panglm_attgt>)
Aggregate group-time average treatment effects
plot(<panglm_attgt>) plot(<summary.panglm_attgt>)
Plot an event study from group-time effects
summary(<panglm_etwfe>)
Average treatment effects on the treated from an ETWFE fit
plot(<panglm_etwfe>) plot(<summary.panglm_etwfe>)
Plot ETWFE treatment effects
summary(<paniv>)
Summarize a paniv fit
vcov(<paniv>)
Covariance of a paniv fit
predict(<paniv>)
Predictions from a panel instrumental-variables fit
summary(<pangmm>)
Summarize a pangmm fit
vcov(<pangmm>)
Covariance of a pangmm fit
predict(<pangmm>)
Predictions from a dynamic panel GMM fit
plot(<pangmm>) plot(<paniv>) plot(<panselect>)
Plot the coefficients of a GMM, IV or selection model
summary(<panselect>)
Summarize a panselect fit
vcov(<panselect>)
Covariance of a panselect fit
predict(<panselect>)
Predictions from a panel sample-selection fit
summary(<panqr>)
Summarize a panqr fit
vcov(<panqr>)
Covariance of a panqr fit
plot(<panqr>)
Plot a panel quantile regression fit
summary(<panfmm>)
Summarize a panfmm fit
vcov(<panfmm>)
Covariance of a panfmm fit
predict(<panfmm>)
Predictions from a latent class panel model
plot(<panfmm>)
Plot a latent class (finite mixture) model

Tidiers

Data

Health economics panels for teaching: one simulated panel with known truth and five real public panels.

copd
Synthetic COPD follow-up panel with costs and a staggered programme
docvisits
German health-care demand panel (doctor and hospital visits, GSOEP)
meps
Health care expenditure and use of US adults, MEPS panel 23 (2018-2019)
medicaid
Health insurance coverage and the ACA Medicaid expansion, US states 2009-2019
healthspend
Health expenditure, income and population health: a country-year panel
cigar
Cigarette demand in US states, 1963-1992 (Baltagi and Levin)

Deprecated

Former names, kept as wrappers that warn and call the new function.