Skip to content

OrderedModel: get marginal effects #7831

Open

Description

@lventosa

I'm working on building a logistic regression model for an ordinal dependent variable and I'm using the OrderedModel from statsmodels.miscmodels.ordinal_model.

Maybe I'm just not seeing it right now, but with this model, marginal effects are not computed, only the regression coefficients. Nonetheless, marginal effects are computed for the regular logistic regression model (not ordered) that can be fit with statsmodels.

Is there a way I can build an ordinal logistic regression model and obtain its marginal effects with statsmodels? If not, this issue is indeed a feature request.

Thanks!

Activity

  1. added this to the 0.14 milestone on Oct 29, 2021
  2. josef-pkt commented on Oct 29, 2021

    @josef-pkt
    Member

    It's a feature request.

    I have not looked at marginal effects for ordinal models at all.
    Currently, OrderedModel does not have the necessary derivatives.
    I guess, after adding the required derivatives, it should work generically as in other basic discrete models
    (A possible difficulty is that we don't have analytical derivatives w.r.t the transformed threshold. Maybe we don't need those for margins.)

    I had forgotten about margins in my list of post-estimation results #1353

  3. josef-pkt commented on Oct 29, 2021

    @josef-pkt
    Member

    Maybe not so easy.

    Marginal effect on latent variable is one dimensional. But prediction is a multinomial/ordinal distribution.
    If margin is defined as change in probability for category j, then we would have multivariate margin for all categories j.
    It looks like MNLogit has multivariate margins (derivatives are in MultinomialModel)

    Similar to residual and fitted values. Support for multivariate predictions is still limited also in OrderedModel.
    I had worked on some diagnotics for those.

  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-discreteprio-elevtopic-post_estimtype-enh

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions