linearmodels/effects-outside-panel-ols
| Rule | effects-outside-panel-ols |
|---|---|
| Pack | linearmodels |
| Severity | error |
| Fix | none, edit by hand |
| Library versions | every version |
Only PanelOLS reads effect terms in a formula, and the other panel models drop them without an error. Use PanelOLS when you want fixed effects.
model = RandomEffects.from_formula("lwage ~ 1 + hours + EntityEffects", data)model = PanelOLS.from_formula("lwage ~ 1 + hours + EntityEffects", data)What the rule reports
Section titled “What the rule reports”The rule reports EntityEffects, FixedEffects or TimeEffects in a formula given to
PooledOLS, RandomEffects, BetweenOLS, FirstDifferenceOLS or FamaMacBeth. Every panel
model takes the three terms out of the formula, and only PanelOLS then uses them.
How to fix it
Section titled “How to fix it”xpd has no automatic fix, so make the change by hand.
On 7.1 and 7.0, each of the five classes returned the same coefficients for "lwage ~ 1 + hours" with and without each of the three terms, and raised no error and no warning. The reader of the formula sees fixed effects that the model does not have.
Message
Section titled “Message”xpd prints this message with the issue. A name that starts with $ stands for code from your file.
Only PanelOLS reads EntityEffects, FixedEffects and TimeEffects in a formula, and this model drops the term in $F without an error. On the wage panel PooledOLS, RandomEffects, BetweenOLS, FamaMacBeth and FirstDifferenceOLS each returned the same coefficients with the term as without it. Use PanelOLS.from_formula for the effects, or take the term out.Browse the other rules of the linearmodels pack.