Announcement

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

  • FIRTHLOGIT -- Penalized maximum likelihood logistic regression

    Dear all,
    We have a rare binary outcome variable (0/1) with 85 observations are 1's (14%) and n=600. Different procedures of estimation are used (firthlogit, penlogit, relogit, exactlogit). How to deal with an explanatory variable, let's say x1, binary, which is also scant?
    x1 may present potentially problematic statistical issues that must we address because we have only 3% of x1 are one's (20 observations). The tetrachoric correlation between y and x1 gives (rho = 0.4 ; p-value = 0.006).

    PHP Code:
                                               Number of obs     =        605
                                                    Wald chi2
    (1)      =       9.22
    Penalized log likelihood 
    = -235.42229           Prob chi2       =     0.0024

    ------------------------------------------------------------------------------
             
    y   |      Coef.   StdErr.      z    P>|z|     [95ConfInterval]
    -------------+----------------------------------------------------------------
              
    x1 |   1.472613   .4850946     3.04   0.002     .5218447    2.423381
            cons 
    |  -1.900057   .1225844   -15.50   0.000    -2.140318   -1.659796
    ------------------------------------------------------------------------------ 
    Thanks

  • #2
    Use - exlogistic-. That's it.

    Comment


    • #3
      Thank you so much Tiago!!

      Comment


      • #4
        Hello,

        I use stata14.1. I wanted to use the logit model, however, the size of my sample and the lopsided problem for my dependent variables didnt let me do it. That is why I want to run exlogistic (using Penalized Maximum Likelihood instead of ML). By running exlogistic, I always face an error "exceeded memory limit of 10.0M bytes; use the memory() option to increase the memory limit".
        When I set the memory, I have another error" set memory ignored. Memory no longer needs to be set in modern States; memory adjustments are performed on the fly automatically.``This cycle is repeated and I don't know how I can solve it.
        I would appreciate it if someone could help me in this regard.
        Thanks

        Comment


        • #5
          Originally posted by Mona Aghabeygi View Post
          . . . I want to run exlogistic . . . I always face an error "exceeded memory limit of 10.0M bytes; use the memory() option." When I set the memory, I have another error "set memory ignored."
          Just follow the instruction of exlogiistic's error message: use the memory() option of the exlogistic command.

          It's not asking you to set memory from the command line.

          That is, do this
          Code:
          exlogistic …, memory(…)
          and not this
          Code:
          set memory …

          Comment


          • #6
            Hello,

            Thank you so much, Joseph.
            I run the model and it worked very well. However, I have one more question. How could I have the marginal effect?

            I know for the logit model, I can use the commands below:

            quietly logit y x1 x2 x3 x4
            margins, dydx(*) atmeans post


            But what about exlogistic command?

            Comment


            • #7
              the following is a quote from the manual entry for -margins-: "margins cannot be used after estimation commands that do not produce full variance matrices,
              such as exlogistic and expoisson (see [R] exlogistic and [R] expoisson)."

              forgot to say - but you can get predicted values and work with those yourself; see
              Code:
              help exlogistic postestimation##estatpred

              Comment


              • #8
                Thanks, Rich. I got the point.
                But for predicted values:
                In my case, I have four dependent dummy variables. If I want to see the predicted values for each status, I should write the command like "estat predict, at(x1=1 x2=1 x3=1 x4=1 )" status per status. However, I am looking for the command to have all the predicted values for all possible statuses by using one line command.
                Is there any solution?
                Does anyone have a suggestion?

                Comment

                Working...
                X