Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Question about post estimation commands in Stata after firthlogit (SSC)

    Dear All,

    I would like advice on specifying my model and commands to do post estimation in Stata with the user-written program firthlogit (available from SSC).

    I have 3850 units in my dataset and my dependent variable (party switching) is binary, but with only 72 “1”’s. It is therefore rare event and on top of that, I have a problem with (quasi-) complete separation, because I have 2 out of 22 legislatures where no switching occur, and Stata issues this error message:

    note: 1.legislature != 0 predicts failure perfectly 1.legislature dropped and 156 obs not used
    note: 14.legislature != 0 predicts failure perfectly 14.legislature dropped and 170 obs not used

    This made me discard logistic regression, and I do not think exlogistic is an opportunity either, because of the large N. Instead, I decided on firthlogit, which uses penalized likelihood.
    My problem is that according to this post http://www.statalist.org/forums/foru...406#post809406 I cannot use the margins command in Stata with firthlogit. Do you know other post estimation commands in Stata that runs with firthlogit?

    My model looks like this:
    firthlogit partyswitcing position intrapartydemocracy intrapartydemocracysquare leftright leftrightsquare cabinetparty shableyShubikindex gender age senority i.legislature

    partyswitching, gender, position and cabinetparty are dichotomies. I have put in legislatures as a categorical variable to get a fixed effect for legislature, but I do not want to use it as a predictor.

    I would like to be able to plot my main independent variables (intrapartydemocracysquare, leftrightsquare and shableyShubikindex) to ease the interpretation.


    Thanks in advance.

  • #2
    Originally posted by Marie Kaldahl View Post
    Do you know other post estimation commands in Stata that runs with firthlogit?
    The only one that I'm aware of is predict, and only for the linear prediction (xb).

    Originally posted by Marie Kaldahl View Post
    I would like to be able to plot my main independent variables . . . to ease the interpretation.
    Why not fit the model with firthlogit,* and then plot the linear predictions against each of your explanatory variables?

    *See also:
    Code:
    search penlogit

    Comment


    • #3
      Dear Joseph,

      Thank you very much. Your answer was very helpful.

      I get negative values, when I use the predict, xb but as I can see from your answer here: http://www.statalist.org/forums/foru...ter-firthlogit I can covert it using the invlogit, but I do not fully understand this operation. Why is it predict double pr, xb?

      Originally posted by Joseph Coveney View Post
      Something like this:
      Code:
      predict double pr, xb
      quietly replace pr = invlogit(pr)

      Comment


      • #4
        Originally posted by Marie Kaldahl View Post
        Why is it predict double pr, xb?
        The double type specifies that you want the predictions in double-precision. See
        Code:
        help data_types
        for more information.

        Comment


        • #5
          Thank you for your answer.

          Comment

          Working...
          X