linearmodels.panel.utility.generate_panel_data

generate_panel_data(nentity=971, ntime=7, nexog=5, const=False, missing=0, other_effects=2, ncats=4, rng=None)[source]
Parameters:
nentityint

The number of entities in the panel.

ntimeint

The number of time periods in the panel.

nexogint

The number of explanatory variables in the dataset.

constbool

Flag indicating that the model should include a constant.

missingfloat

The percentage of values that are missing. Should be between 0 and 100.

other_effectsint

The number of other effects generated.

ncatsUnion[int, Sequence[int]]

The number of categories to use in other_effects and variance clusters. If list-like, then it must have as many elements as other_effects.

rngRandomState

A NumPy RandomState instance. If not provided, one is initialized using a fixed seed.

Returns:
PanelModelData

A namedtuple derived class containing 4 DataFrames:

  • data - A simulated data with variables y and x# for # in 0,…,4. If const is True, then also contains a column named const.

  • weights - Simulated non-negative weights.

  • other_effects - Simulated effects.

  • clusters - Simulated data to use in clustered covariance estimation.