bashtage/linearmodels

Documentation clarification on predict() results

iamchrisearle opened this issue · 5 comments

full q here: https://stackoverflow.com/questions/72969440/interpreting-results-from-linearmodels-panelols-predict-method

For PanelOLS with entity_effects=True (should be equivalent to fixed effects), does predict() return a prediction of the expected y_it - yi bar, or actual predictions of yit?

The model is always Y=XB + epsilon + (eta_t ) + (nu_i ). The effects are treated as errors, and so when you predict you get new_x @ params and so the entity effects are not used.

Thanks for the quick response and clarification, @bashtage. Given that the model uses new_x @ params, would first time-demeaning new_x before passing to predict achieve a y_it - yi bar prediction? I.e. could predictions on new, time-demeaned data be interpreted as expected changes in y_it from their time-averaged y_it (yi bar). Thanks again!

Yes. If you demended using the average of the y's for the entity included in the model, and similarly for the x's included in the model, than you would get what you are after.

Thanks again, that fully clarifies my question -- I'll close this issue.

You are welcome.