Skip to content

Prediction confidence intervals GLM and discrete #2015

Closed

Description

@josef-pkt

confidence intervals for the mean (expected value) of non-linear, single-index models

ci can be obtained by applying the inverse link function to the linear prediction ci.
They don't need the delta method, and Stata uses a mix of delta method and transformation of bounds.

maybe that's what this is about http://stackoverflow.com/questions/26053810/python-statsmodels-adding-confidence-intervalls-to-binary-logistic-regression

I thought I opened an issue for Poisson prediction but cannot find it

see also #1349 for linear models
and #1449 for general non-linear transformation


about Stata:

UCLA stats has an example
http://www.ats.ucla.edu/stat/stata/faq/adjustpr.htm
which uses adjust, which I never heard about.
I can match those numbers with just the model.cdf of the confidence intervals for the linear prediction.

adjust was removed and replaced by margins in Stata 11, which only uses delta method but not endpoint-transformation confidence intervals.
http://statalist.1588530.n2.nabble.com/adjust-vs-margins-revisited-td5355569.html

However, I read somewhere (???) in the Stata manual about endpoint transformation confidence intervals for predefined transformation, exp for odds ratio and similar in Poisson or other exponential/log-linear models.

Activity

  1. added this to the 0.7 milestone on Sep 26, 2014
  2. modified the milestones: 0.7, 0.10, 0.11 on Feb 17, 2019
  3. josef-pkt commented on Feb 17, 2019

    @josef-pkt
    MemberAuthor

    check this, what's left to do?
    get_prediction has been added for mean prediction

    see
    #4745 for prediction intervals of a new obs with parameter uncertainty
    #3415 predict_prob and other predicted statistics

  4. modified the milestones: 0.11, josef on Oct 5, 2019
  5. josef-pkt commented on Oct 15, 2020

    @josef-pkt
    MemberAuthor

    reference and stata functions for verification

    confidence interval for predict for discrete models

    endpoint transformation works only in simple cases
    They have delta method for ologit, mnlogit, but not for ZI count models.

    Xu, Jun, and J. Scott Long. 2005. “Confidence Intervals for Predicted Outcomes in Regression Models for Categorical Outcomes:” The Stata Journal, December. https://doi.org/10.1177/1536867X0500500405.

    formulas/math: https://jslsoc.sitehost.iu.edu/stata/ci_computations/spost_deltaci.pdf

    working paper of related interest "Group comparisons in logit and probit using predicted probabilities"
    https://jslsoc.sitehost.iu.edu/files_research/groupdif/groupwithprobabilities/groups-with-prob-2009-06-25.pdf
    (I didn't read it)

  6. josef-pkt commented on Dec 11, 2020

    @josef-pkt
    MemberAuthor

    interesting R package ciTools, based on skimming the glm vignette

    https://cran.r-project.org/web/packages/ciTools/vignettes/ciTools-glm-vignette.html

    They get prediction interval for nongaussian GLM like Poisson through simulation using sampling distribution of params with cov_params.

    get_prediction needs more systematic unit tests.

    Based on a google search, R base packages still don't have confidence interval for predicted mean, there are many blogs using endpoint transformation with inverse link.

    There are several other R packages with ci (and pi?) for glm predict, but without informative docstrings
    e.g. https://rdrr.io/cran/HH/man/interval.html

    update
    ciTools add_ci has the same confint as get_prediction in Poisson example
    but I think the append to dataframe interface is annoying and not computationally efficient, it might require copying the original data if the appended arrays needs contiguous memory.
    I don't see a way to get results in a new dataframe.
    (I guess they added it because of the pipes as in the example)

  7. josef-pkt commented on Dec 11, 2020

    @josef-pkt
    MemberAuthor

    see also #6979

    I don't know what tolerance intervals are.
    Mostly they sound like scipy distributions interval
    It's not clear to me whether they take parameter estimation and uncertainty into account

  8. josef-pkt commented on Nov 16, 2024

    @josef-pkt
    MemberAuthor

    closing as outdated
    most parts have been added with get_prediction methods.

    Adding reference label so we know which closed issues have literature references or links to other packages

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions