Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG/Design GLM predict, get_prediction does not include weights #8517

Open
josef-pkt opened this issue Nov 9, 2022 · 2 comments
Open

BUG/Design GLM predict, get_prediction does not include weights #8517

josef-pkt opened this issue Nov 9, 2022 · 2 comments
Labels
comp-genmod topic-post_estim post-estimation results, margins, prediction, inference, diagnostic topic-predict type-bug type-enh
Milestone

Comments

@josef-pkt
Copy link
Member

GLM predict only uses the linpred

  • we don't have freq_weights in predict
  • I guess var_weights will only affect inference for predict
  • binomial count, predict is for 1 trial (i.e. prob), no option for n_trials, i.e. predicting counts. resid_xxx include n_trials separately

It looks like current behavior is by design, but we might want to have more options.

just an observation while reading the code for #8505 and thinking about which other "which" options to add
e.g. currently my which="var" returns only the family var function without extras (no var_weights, no n_trials

@josef-pkt
Copy link
Member Author

adding additional keywords like xxx_weights or n_trials is for future, 0.15.
It will take some time to design and check this.

Also, it's not clear to me yet how to handle family specific which.
eg. probs as in discrete count models.
"mean_count" for binomial with n_trials ?

To not tie our hands:
I use now which="var_unscaled" for plain family varfunc

@josef-pkt
Copy link
Member Author

similar issue, get_margeff does not support (freq) weights #8889

GLM predict, get_prediction might need a warning if freq_weights have been used in the model.
get_prediction has agg_weights so user can specify freq_weights as agg_weights for average effect.

maybe:
including freq_weights is important only in average effect, "overall" in margeff, i.e. similar to agg_weights.
For individual prediction assuming freq_weights = 1. will be more useful than using sampling freq_weight.

@josef-pkt josef-pkt added the topic-post_estim post-estimation results, margins, prediction, inference, diagnostic label Jun 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp-genmod topic-post_estim post-estimation results, margins, prediction, inference, diagnostic topic-predict type-bug type-enh
Projects
None yet
Development

No branches or pull requests

1 participant