Module Reference

Models for Panel Data

PanelOLS(dependent, exog, *[, weights, ...])

One- and two-way fixed effects estimator for panel data.

RandomEffects(dependent, exog, *[, weights, ...])

One-way Random Effects model for panel data.

BetweenOLS(dependent, exog, *[, weights, ...])

Between estimator for panel data.

FirstDifferenceOLS(dependent, exog, *[, ...])

First difference model for panel data.

PooledOLS(dependent, exog, *[, weights, ...])

Pooled coefficient estimator for panel data.

FamaMacBeth(dependent, exog, *[, weights, ...])

Fama-MacBeth estimator for panel data.

Estimation Results

FamaMacBethResults(res)

Results container for Fama MacBeth panel data models.

PanelResults(res)

Results container for panel data models that do not include effects.

PanelEffectsResults(res)

Results container for panel data models that include effects.

RandomEffectsResults(res)

Results container for random effect panel data models.

HausmanTestResults(statistic, estimates)

Results of a Hausman specification test.

PanelModelComparison(results, *[, ...])

Comparison of multiple models.

compare(results, *[, precision, stars])

Compare the results of multiple models.

Panel Model Covariance Estimators

HomoskedasticCovariance(y, x, params, ...[, ...])

Homoskedastic covariance estimation.

HeteroskedasticCovariance(y, x, params, ...)

Covariance estimation using White estimator.

ClusteredCovariance(y, x, params, ...[, ...])

One-way (Rogers) or two-way clustered covariance estimation.

DriscollKraay(y, x, params, entity_ids, ...)

Driscoll-Kraay heteroskedasticity-autocorrelation robust covariance estimation.

ACCovariance(y, x, params, entity_ids, ...)

Autocorrelation robust covariance estimation.

FamaMacBethCovariance(y, x, params, ...[, ...])

HAC estimator for Fama-MacBeth estimator.

Panel Data Structures

PanelData(x[, var_name, convert_dummies, ...])

Abstraction to handle alternative formats for panel data.

_Panel(df)

Convert a MI DataFrame to a 3-d structure where columns are items.

Test Data Generation

generate_panel_data([nentity, ntime, nexog, ...])

Simulate panel data for testing.

PanelModelData(data, weights, other_effects, ...)

Typed namedtuple to hold simulated panel data.

Errors

class linearmodels.panel.model.AmbiguityError[source]

Bases: Exception

Error raised when the shape of the weights could mean different things.

It is raised when the numbers of time periods and of entities are equal and 1-d weights have that many values, so that the weights could have a value for each time period or for each entity.

class linearmodels.panel.utility.AbsorbingEffectError[source]

Bases: Exception

Error raised when the effects absorb one or more of the variables.