Skip to content

ENH compare prediction #2291

Closed
Closed

Description

@josef-pkt

see also #2150 for SUMMary issue for prediction

mentioned by Kerby
requires joint modeling of two or more prediction

this is similar to margins for a binary exog, but more general including categorical explanatory variables that have more than two levels.
can use t_test on top of prediction results

needs predict at for average treatment effect and similar

joint versus vectorized predict (similar to t_test versus wald_test)
see
https://github.com/statsmodels/statsmodels/compare/master...josef-pkt:REF_delta_method?expand=1
will be PR when I have unit tests, currently only uncommitted example script
NonlinearDeltaCov was joint multi-equation only, now works also vectorized (based on se_vectorized)
t_test analog is for vectorized only.
wald_test uses the joint distribution, but we don't have vectorized on top (we cannot use it directly for average effect, mean over prediction)

Activity

  1. added this to the 0.8 milestone on Feb 28, 2015
  2. josef-pkt commented on Feb 28, 2015

    @josef-pkt
    MemberAuthor

    ratio of average prediction with and without constant
    this is a bit similar to relative risk or risk ratio #2215 (average treatment effect ratio)

    >>> def fun(p): params = p; return np.dot(res.model.exog, params).sum() / np.dot(res.model.exog[:, 1:], params[1:]).sum()
    ... 
    >>> nl3 = NonlinearDeltaCov(fun, res.params, res.cov_params())
    >>> print(nl3.summary())
                                 Test for Constraints                             
    ==============================================================================
                     coef    std err          z      P>|z|      [95.0% Conf. Int.]
    ------------------------------------------------------------------------------
    c0             5.7213      0.587      9.746      0.000         4.571     6.872
    ==============================================================================
    
  3. josef-pkt commented on May 5, 2023

    @josef-pkt
    MemberAuthor

    closing now as duplicate and superseded

    I had opened a new issue #8784

  4. removed this from the 0.8 milestone on May 5, 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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions