Skip to content

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

Open

Description

@josef-pkt

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

Activity

  1. added this to the 0.15 milestone on Nov 9, 2022
  2. josef-pkt commented on Nov 9, 2022

    @josef-pkt
    MemberAuthor

    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

  3. josef-pkt commented on May 22, 2023

    @josef-pkt
    MemberAuthor

    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.

  4. added
    topic-post_estim
    on Jun 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    comp-genmodtopic-post_estimtopic-predicttype-bugtype-enh

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions