Announcement

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

  • Non-Linear Margins Plot After xtPoisson

    Dear all,

    I am running currently running a poisson regression on my panel data using -xtpoisson- and I am having a problem with creating a margins-plot after my estimation.

    I am using Stata 15.1 for Windows.

    My data set comprises of 60 countries for the years 2009-2016 and includes variables on economic conditions of the country as well as data on IMF loans such as the number of conditons (my dependent variable). My main independent variable of interest is USFDI.

    As the number of conditions on loans is a count variable, I ran -xtpoisson- such as:
    Code:
    xtpoisson NumberofConditions USFDI ControlVariables i.Year, fe vce(robust)
    and then I used:
    Code:
    margins, at (USFDI =(0 1 2 3 4 5 6 7 8 9 10 )) predict(nu0)
    marginsplot, recast(line) recastci(rarea)
    to get my margins plot of USFDI to make interpretation of the results easier as looking only at the regression coefficients is not straight forward for -xtpoisson-.

    However, the output I am getting looks like this:


    which looks like a linear prediction and the convidence intervals look akward to me as well. I am not sure what exactly might be wrong with it.

    Ideally, I want to have a margins plot accounting for potential non-linearity of the regression as well as indicating the effect of the explanatory variables as predicted probability as a percentage change. However, I am not sure how to achieve this and could not find an answer anywhere else in this forum yet.

    Any help would be greatly appreciated.

    Thank you in advance.

    Kira
    Attached Files

  • #2
    The expected number of conditions is extremely small. Does your data contain a large number of countries with 0 conditions (e.g. because they had no loan)?

    Your statement that looking at the regression coefficients is not straightforward is wrong. It is easy if you include the irr option. Here is an example with poisson, but the exact same logic applies to xtpoisson.

    Code:
    . webuse fish, clear
    (Fictional fishing data)
    
    . gen persons_c = persons - 1
    
    . poisson count i.livebait persons_c, irr
    
    Iteration 0:   log likelihood =   -1313.05  
    Iteration 1:   log likelihood = -1312.1785  
    Iteration 2:   log likelihood = -1312.1779  
    Iteration 3:   log likelihood = -1312.1779  
    
    Poisson regression                              Number of obs     =        250
                                                    LR chi2(2)        =     671.08
                                                    Prob > chi2       =     0.0000
    Log likelihood = -1312.1779                     Pseudo R2         =     0.2036
    
    ------------------------------------------------------------------------------
           count |        IRR   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
      1.livebait |   6.648018   1.543132     8.16   0.000     4.218053    10.47785
       persons_c |   2.265183    .090412    20.49   0.000     2.094733    2.449503
           _cons |   .1098618   .0272082    -8.92   0.000     .0676145    .1785063
    ------------------------------------------------------------------------------
    Note: _cons estimates baseline incidence rate.
    The constant is the expected number of fish caught when the explanatory variables are all 0, in this case when there is one person in the team and (s)he does not use livebait. Then we expect a person to catch 0.1 fish. If you add a person to the team, the number of fish caught increases by a factor 2.3, i.e. 230%. Using livebait means that the number of fish caught is 6.65 times the number of fish caught when not using livebait, i.e. that the number of fish caught increases by 648%.
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment


    • #3
      Dear Maarten,

      Thank you for your prompt reply.

      I only have 12 zero-conditions in total in my sample and this is why I found the results particularly puzzeling as the mean of attached conditions is around 5.

      Thank you for also mentioning the irr option! This is very helpful. I got the following output:
      Code:
      (Std. Err. adjusted for clustering on CountryID)
      -------------------------------------------------------------------------------------------
                                |               Robust
      NumberofBindingConditions |        IRR   Std. Err.      z    P>|z|     [95% Conf. Interval]
      --------------------------+----------------------------------------------------------------
                          USFDI |   .8033548   .0569073    -3.09   0.002     .6992151    .9230049
             YearsSincePastLoan |   1.306943     .14576     2.40   0.016     1.050327    1.626256
                 pApprovalLoan2 |   .4241266   .2390879    -1.52   0.128      .140494    1.280363
                        Lag1_E1 |   .9824781   .0137938    -1.26   0.208     .9558114    1.009889
                     Lag1logGDP |   .2560981   .2747274    -1.27   0.204     .0312814    2.096653
                        Lag1_E3 |   .9932022   .0134327    -0.50   0.614     .9672205    1.019882
                        Lag1_E4 |   .9803917   .0115238    -1.68   0.092     .9580636     1.00324
                       Lag1_E10 |   1.012149   .0033368     3.66   0.000      1.00563     1.01871
                       Lag1_E11 |   .9946137   .0118333    -0.45   0.650     .9716892    1.018079
                       Lag1_E12 |   .9975613   .0146892    -0.17   0.868     .9691826    1.026771
                       Lag1_E14 |   .9988965   .0411783    -0.03   0.979      .921363    1.082955
                                |
                           Year |
                          2011  |   .8262034   .0904289    -1.74   0.081     .6666871    1.023887
                          2012  |   .8926539   .1909242    -0.53   0.595     .5869821    1.357505
                          2013  |   .7855676   .1203402    -1.58   0.115     .5818204    1.060665
                          2014  |   .7135982   .1030588    -2.34   0.019     .5376778    .9470774
                          2015  |   .7393711   .1682186    -1.33   0.184       .47337    1.154846
                          2016  |   .8165602   .1352597    -1.22   0.221     .5901879     1.12976
      -------------------------------------------------------------------------------------------
      Is there any way to also represent the IRR in a graphical fashion that you are aware of similar to the -marginsplot- command?

      Thank you again!

      Best wishes,

      Kira

      Comment


      • #4
        Dear Kira Zerwer.

        Just to add to Maarten Buis's excellent advice, notice that even without the irr option, the coefficients can easily be interpreted because they are (semi-) elasticities. Also, note that as explained here, it is not meaningful to compute marginal effects in the FE Poisson regression.

        Best wishes,

        Joao

        Comment

        Working...
        X