Python Forum
help seeking for prediction of fixed effect model
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
help seeking for prediction of fixed effect model
#1
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'
Larz60+ write Jun-18-2024, 08:03 AM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
I have added tags for you this time. Please use BBCode tags on future posts.
Reply


Messages In This Thread
help seeking for prediction of fixed effect model - by gotodockforevildragon - Jun-18-2024, 04:10 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
Bug Copying methods to effect the new owner instead of the old instance Daniel285 2 315 Jun-03-2024, 07:58 AM
Last Post: Gribouillis
  Win or Loss Prediction ksasi2k3 4 574 Apr-25-2024, 01:46 PM
Last Post: ksasi2k3
  Seeking advice on dask distributed sawtooth500 4 566 Apr-15-2024, 11:07 PM
Last Post: sawtooth500
  model.fit and model.predict errors hatflyer 6 1,793 Nov-10-2023, 01:39 AM
Last Post: hatflyer
  How to do "fixed size" (wrapping) math in Python? AlexanderWulf 13 2,391 Jul-19-2023, 04:13 PM
Last Post: deanhystad
  Fixed colum width for rowLabels i Matplotlib pandabay 0 533 Jun-10-2023, 03:40 PM
Last Post: pandabay
  Printing effect sizes for variables in an anova eyavuz21 2 1,131 Feb-01-2023, 02:12 PM
Last Post: eyavuz21
  Help with TypeWriter Effect in Python Rich Extra 0 1,314 May-23-2022, 09:44 PM
Last Post: Extra
  Encrypt and decrypt in python using own fixed key SriRajesh 3 5,570 Feb-20-2022, 01:18 PM
Last Post: dboxall123
  hyperparameters do not make a difference in prediction jenya56 0 1,074 Sep-15-2021, 12:53 PM
Last Post: jenya56

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020