Python Forum

Full Version: help seeking for prediction of fixed effect model
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
now i get a formula by FE MODEL, but i wanna use it to predict the upper and lower bound of 'Y'
however, it seems that the i could not predict if based on the orginial data by commands like 'get_prediction'
because this command is for OLS, not for the panel data or panel model
if i solve it by Stata, i just need to use "predict" and it will ouput the prediction directly
so are there any other commands for my demand QAQ Heart !!!

This is my code:

filtered_df['Y_winsorized'] = winsorize(filtered_df['Y'], limits=[0.2, 0.2])

filtered_df = filtered_df.set_index(["material","date"])
exog = sm.add_constant(filtered_df[['X1','X2']])
result = PanelOLS(filtered_df['Y_winsorized'], exog, entity_effects=True, time_effects=True)
result = result.fit()
print(result)

pred = result.get_prediction(exog)
conf_int = pred.conf_int()  
pred_int = pred.conf_int(observed=True)  
this is the warning and error:
Error:
AttributeError: 'PanelEffectsResults' object has no attribute 'get_prediction'