import expdpy as ex
res = ex.learn_nickell_bias()
res.figlearn_nickell_bias
learn_nickell_bias(n_units=200, rho=0.6, periods=(3, 4, 6, 10, 20, 40), seed=0)Show the Nickell bias in dynamic-panel fixed-effects estimates.
The within estimate of a lagged dependent variable is biased downward in short panels and the bias shrinks as the panel lengthens. Simulates a dynamic panel y_it = rho*y_{i,t-1} + alpha_i + e and estimates rho by within (fixed-effects) regression at several panel lengths T: for small T the estimate sits well below the truth; as T grows it converges up to rho.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| n_units | int | Number of units (kept large so the bias is the dominant signal). | 200 |
| rho | float | True autoregressive parameter. | 0.6 |
| periods | Sequence[int] | The panel lengths T to estimate at. |
(3, 4, 6, 10, 20, 40) |
| seed | int | Random seed. | 0 |
Returns
| Name | Type | Description |
|---|---|---|
| SandboxResult | df (periods_T, fe_rho, bias), fig, summary and topic. |
Examples
This sandbox simulates its own dynamic panels, so the call needs no DataFrame: