Announcement

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

  • firthlogit command for panel data

    Hi there

    Is it possible to use the firthlogit command for panel data?And if yes, how? I understand that I can use the xtlogit for panel data, however my dataset is rather small and thus I'd prefer the penalized logistic regression. Or is there any other way instead of the firthlogit command to handle penalized logistic regressions of panel data?
    Any help is very much appreciated!!

  • #2
    The method as implemented in the user-written firthlogit is not intended for panel data.

    As for alternatives, you might look into some kind of data-augmentation approach, perhaps something like that advocated by Sander Greenland and his colleagues.* (Apparently there will soon be a new user-written Stata command from him and his colleagues that will render firthlogit redundant or obsolete or both, but I'm not sure that it will handle panel data, either.)

    If it were me, I would probably look into the official Stata command bayesmh with considered prior distributions.

    *Try here for a preprint, if that link doesn't allow you to at least scroll through the paper.

    Comment


    • #3
      This is a bit speculative, but you could try using so-called robust Poisson regressions for binary outcomes as here:

      http://aje.oxfordjournals.org/content/159/7/702.full
      http://www.biomedcentral.com/1471-2288/14/82/abstract​

      and then implement using either -xtgee- family(poisson) vce(robust) or -xtpoisson- vce(robust).

      In both cases you could still have convergence issues, so you might need to play with the maximizer settings, as well as consider which model makes the most sense for your data.

      Code:
      webuse union //, clear
      
      * Random-effects logit model
      xtlogit union age grade i.not_smsa south##c.year, or
      
      * Population-averaged logit model with robust variance
      xtlogit union age grade i.not_smsa south##c.year, pa vce(robust) or
      
      * Speculative 'robust Poisson' models for panel data
      
      xtpoisson union age grade i.not_smsa south##c.year, vce(robust) eform
      
      xtgee union age grade i.not_smsa south##c.year, family(poisson) vce(robust) eform
      Also, important to note that these will give you risk ratios and not odds ratios or incidence rate ratios.
      __________________________________________________ __
      Assistant Professor, Department of Biostatistics and Epidemiology
      School of Public Health and Health Sciences
      University of Massachusetts- Amherst

      Comment


      • #4
        If your initial problems are caused by quasi-separation from a small dataset, then the above is likely quite dubious

        example from here: http://www.ats.ucla.edu/stat/mult_pk...git_models.htm

        Code:
        input y x1 x2
        
        0 1  3
        0 2  0
        0 3 -1
        0 3  4
        1 3  1
        1 4  0 
        1 5  2
        1 6  7
        1 10 3
        1 11 4 
        
        end
        
        logistic y x1 x2
        
        firthlogit y x1 x2
        
        firthlogit, or
        
        exlogistic y x1 x2
        
        poisson y x1 x2, vce(robust) irr
        but for rare events with large data it could be OK, but this is untested.

        Some info here:
        http://statisticalhorizons.com/logis...or-rare-events
        __________________________________________________ __
        Assistant Professor, Department of Biostatistics and Epidemiology
        School of Public Health and Health Sciences
        University of Massachusetts- Amherst

        Comment


        • #5
          Hi
          I have a panel data set of around 3000 observations where the dependent variable Choice is categorical (either active=1 or inactive=0) and I have 6 independent variables called Degree2, Degree3, Degree4, Core, treatA, treatB, riskyinvestment & period which are all dummy variables except period and riskyinvestment which are continuous. I also have interaction terms between the independent variables.

          One of the interaction variables predicts success perfectly, Degree3=1 & treatB=1 & Core=1 then the interaction variable d3t2C=1, In my data when d3t2C=1 there a no observations where Choice=0.

          Thus when I run my xtlogit command

          Code:
           xtlogit choice period Degree2 Degree3 Degree4 treatA treatB d2t1 d2t2 d3t1 d3t2 d4t1 d4t2 d2C d3C d2t1C d2t2C d3t1C d3t2C t1p t2p d2p d3p d4p d2t1p d2t2p d3t1p d3t2p d4t1p d4t2p d2Cp d3Cp d2t1pC d2t2pC d3t1pC d3t2pC riskyinvestment if treatA==1 | treatB==1 | treatC==1
          Stata drops the variable d3t2C and the 21 observations and d3t2pC due to collinearity

          As far as can tell my problem is separation, where a variable predicts the outcome variable and firthlogit is a command which can be used to counter this problem but as Joseph Coveney has posted above not for panel data.

          My questions are; 1. Have I identified the correct issue with my data?
          2. Why can I not use firthlogit with panel data?
          3. Is there a command that allows me to overcome my problem?

          Comment


          • #6
            sir guide me how we solve panel rare event dummy or quasi-separation issue?? i used but varrible missed or omitted .xtlogit command not workand firthlogit,penlogit,exlogistic alsonot work?so plz guide me how i solve this issue??
            xtpoisson
            xtgee

            Comment


            • #7
              xtpoisson and xtgee also give problem of varrible omitted and can not handel panel rare event or quasi separtion problem in dummy .plz guide me

              Comment


              • #8
                Andrew Lover -- Do you happen to know a solution for Ashley Perry comment in post #5 above? I have the exact same problem with my panel data interactions. Is firthlogit a plausible solution? Maybe another approach? Thanks!

                Comment


                • #9
                  Originally posted by Roger Clements View Post
                  Andrew Lover -- Do you happen to know a solution for Ashley Perry comment in post #5 above? I have the exact same problem with my panel data interactions. Is firthlogit a plausible solution?
                  No.

                  Maybe another approach?
                  Yes.
                  Code:
                  help bayesian_estimation

                  Comment

                  Working...
                  X