Announcement

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

  • New on SSC: -aextlogit- Average elasticities for fixed effects logit

    With the usual thanks to Kit Baum, aextlogit is now available on SSC.

    aextlogit is a wrapper for xtlogit which estimates the fixed effects logit and reports estimates of the average (semi-) elasticities of Pr(y=1|x,u) with respect to the regressors, and the corresponding standard errors and t-statistics. The method used to compute the (semi-) elasticities was first described by Kitazawa (2012); see Kemp and Santos Silva (2016) for further details.

    Please do let me know if you have problems with the files.

    Best wishes,

    Joao

  • #2
    hello Mr. Silva, i'm new to stata and i'm trying to run an mlogit model on a dataset. i also need to save a do file. please can you help me out. thanks

    Comment


    • #3
      Joao Santos Silva: Hi Joao,

      Following the sample in -help aextlogit-, I have the following results:
      Code:
      . webuse union, clear
      (NLS Women 14-24 in 1968)
      
      . aextlogit union age grade i.not_smsa south##c.year
      note: multiple positive outcomes within groups encountered.
      note: 2,744 groups (14,165 obs) dropped because of all positive or
            all negative outcomes.
      
      Iteration 0:   log likelihood = -4516.5881  
      Iteration 1:   log likelihood = -4510.8906  
      Iteration 2:   log likelihood =  -4510.888  
      Iteration 3:   log likelihood =  -4510.888  
      
      Conditional fixed-effects logistic regression   Number of obs      =     12035
      Group variable: idcode                          Number of groups   =      1690
                                                      Obs per group: min =         2
                                                                     avg = 7.1213018
      Log likelihood  = -4510.888                                    max =        12
      
                         Average (semi) elasticities of Pr(y=1|x,u)
      ------------------------------------------------------------------------------
             union |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
      -------------+----------------------------------------------------------------
               age |   .0553283   .0747497     0.74   0.459    -.0911784    .2018351
             grade |   .0635102   .0326132     1.95   0.051    -.0004106     .127431
        1.not_smsa |   .0174948   .0880763     0.20   0.843    -.1551315    .1901211
           1.south |  -2.222936   .5265615    -4.22   0.000    -3.254978   -1.190895
              year |  -.0495603   .0753108    -0.66   0.510    -.1971668    .0980462
                   |
      south#c.year |
                1  |   .0205552   .0064763     3.17   0.002      .007862    .0332484
      ------------------------------------------------------------------------------
      Average of union = .22179389 (Number of obs = 26200)

      My explanation about average (semi) elasticities:
      When age increases 1%, the probability of participating in union creases 5.5%
      Do I explain average (semi) elasticities correctly?

      I would really appreciate all the help I can get.

      Best regards

      --------------------
      (Stata 15.1 MP)

      Comment


      • #4
        I am afraid that is not the interpretation of a semi-elasticity. The right interpretation is that when age increases one year, on average the probability of being unionised goes up by 5.5%.

        Best wishes,

        Joao

        Comment


        • #5
          Hello Joao - is there a package equivalent to aextlogit for xtpoisson?

          Comment


          • #6
            Dear Yotam Shmargad

            For xtpoisson that in not really needed because the coefficients have a natural interpretation as (semi-) elasticities.

            Best wishes,

            Joao

            Comment


            • #7
              That's helpful, really appreciate your reply Joao.

              Comment


              • #8
                Dear Joao,

                I am trying to use the recommended command by you - aextlogit - as a replacement to the fixed effect login model to interpret the coefficients somehow.

                Before I had the coding like:
                Code:
                xtset V2
                xtlogit charity_participation i.generation sex i.income_class i.educ_level happiness char_conf marital_status i.religion, fe
                where V2 is country

                If I want to use aextlogit how should my command to run the fixed effect logit model look like:

                Code:
                xtset V2
                xtlogit charity_participation i.generation sex i.income_class i.educ_level happiness char_conf marital_status i.religion, nolog

                I run it and received the results but not sure that I have done it correctly as this command is absolutely new for me:

                Click image for larger version

Name:	экрана 2019-01-30 в 18.32.29.png
Views:	1
Size:	92.3 KB
ID:	1481232

                Click image for larger version

Name:	экрана 2019-01-30 в 18.32.36.png
Views:	1
Size:	39.3 KB
ID:	1481233


                Thanks,
                Anna

                Comment


                • #9
                  Dear Anna,

                  What you are doing looks OK to me.

                  Best wishes,

                  Joao

                  Comment


                  • #10
                    Dear Joao,

                    Thanks!

                    Comment


                    • #11
                      Dear Joao,

                      I have a question for you regarding the usage of command margins in order to see modeled adjusted rates of categorical variable. On the photo above you can see my model. And I want to use
                      Code:
                      margins generation
                      Do you know if it is allowed to use this command with aextlogit model and if yes does it have the same interpretation when I use it in ismple logit model with FE?

                      Comment


                      • #12
                        Dear Anna Petrova

                        I am afraid you cannot use the margins command after estimating the fixed effects logit; that is the point of having the aextlogit command; you also cannot use margins after this command.

                        Best wishes,

                        Comment


                        • #13
                          Joao Santos Silva

                          Thank your for your answers. The problem that I have received some input by running margins command after aextlogit model. So I was a bit confused.

                          Comment


                          • #14
                            Dear Anna Petrova,

                            You are right, Stata should not allow that; the results you get are rubbish!

                            Best wishes,

                            Joao

                            Comment


                            • #15
                              Dear @Joao Santos Silva

                              I used the command aextlogit and I get coefficients higher than 1 in absolute terms, how should I interpret this in case of a categorical variable (10 categories)?, here is what I did:



                              . aextlogit runhappy i.hours_work rdegree rfemale rblack rnotmar i.age_work i.slfrep_health i.tot_income i.t
                              note: multiple positive outcomes within groups encountered.
                              note: 10450 groups (26788 obs) dropped because of all positive or
                              all negative outcomes.
                              note: rdegree omitted because of no within-group variance.
                              note: rfemale omitted because of no within-group variance.
                              note: rblack omitted because of no within-group variance.

                              Iteration 0: log likelihood = -3038.884
                              Iteration 1: log likelihood = -3021.2335
                              Iteration 2: log likelihood = -3021.206
                              Iteration 3: log likelihood = -3021.206

                              Conditional fixed-effects logistic regression Number of obs = 8603
                              Group variable: id Number of groups = 2206
                              Obs per group: min = 2
                              avg = 3.8998187
                              Log likelihood = -3021.206 max = 11

                              Average (semi) elasticities of Pr(y=1|x,u)
                              -------------------------------------------------------------------------------
                              runhappy | Coef. Std. Err. z P>|z| [95% Conf. Interval]
                              --------------+----------------------------------------------------------------
                              hours_work |
                              2 | .1056477 .1419757 0.74 0.457 -.1726196 .3839151
                              3 | .1321843 .1620739 0.82 0.415 -.1854747 .4498434
                              4 | .1560204 .1613092 0.97 0.333 -.1601398 .4721805
                              5 | .3338053 .1941698 1.72 0.086 -.0467605 .7143711
                              6 | .0978994 .1836477 0.53 0.594 -.2620434 .4578422
                              7 | .3805554 .2975376 1.28 0.201 -.2026075 .9637184
                              8 | .2739321 .2790611 0.98 0.326 -.2730176 .8208818
                              9 | .9144745 .3207676 2.85 0.004 .2857816 1.543167
                              10 | -1.047197 .5083983 -2.06 0.039 -2.043639 -.0507548


                              Many thanks in advance

                              Comment

                              Working...
                              X