You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am doing some research on Mixed effects models and using Stats Mixedlm for same. I have Units to be predicted from Price and size at different UPC levels.
I am getting moderate avp fit on predicted values however I have below needs -
I want to predict Units using both fixed and random effects as in below case -
so I want to predict units at size 20 and Price 11.1. I know for predicting these values both fixed effects and random effects would be used, however I am not able to use predict function as I couldnt get clear example/idea for this.
I have used below code for prediction but its showing multiple arguments error -
Can you please help me in this single case prediction using Mixedlm?
Thanks a lot in advance.
The text was updated successfully, but these errors were encountered:
There is no convenience method for this. You would need to take the BLUPs (from the random_effects attribute as above) and add them to the fitted values from the fixed effects (which is what you get from 'predict'). For example, for all observations in group 7023001154 you would take the fixed effects prediction and add to it -327.6 + 66*Avg_Units_Price - 72*C_CUSTOM_BASE_SIZE.
Hi,
I am doing some research on Mixed effects models and using Stats Mixedlm for same. I have Units to be predicted from Price and size at different UPC levels.
So below is the code I used -
md = smf.mixedlm("Units ~ Avg_Units_Price + C_CUSTOM_BASE_SIZE", file3, groups=file3["UPC_10_digi"], re_formula="~Avg_Units_Price + C_CUSTOM_BASE_SIZE")
mdf = md.fit()
print(mdf.summary())
Output
mdf.random_effects
I am getting moderate avp fit on predicted values however I have below needs -
I have used below code for prediction but its showing multiple arguments error -
Can you please help me in this single case prediction using Mixedlm?
Thanks a lot in advance.
The text was updated successfully, but these errors were encountered: