get_prediction, predictive margins and aggregation weights

19 views
Skip to first unread message

josef...@gmail.com

unread,
Nov 24, 2021, 5:07:55 PM11/24/21
to pystatsmodels
I have been working on generic get_prediction for some time.
The last (for now) PR will be merged soon.

extra feature compared to predict:
average=True, agg_weights=aw

We can predict a population/sample average and get standard errors and confidence interval based on delta method.
Aggregation weights agg_weight allow a weighted average if the sample distribution does not coincide with the population distribution. For example if gender or race distribution in the sample differs from the target population.

This does not include code to construct the `exog` for prediction, in contrast to options in get_margeff. Providing the exog is up to the user as in the standard predict method.

GLM doesn't have the new get_prediction yet because I have not decided yet how to handle backwards compatibility constraints.
Currently it's available for discrete models and for GenericLikelihoodModels like Beta regression.

Josef

Reply all
Reply to author
Forward
0 new messages