Announcement

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

  • Likelihood ratio test with ppmlhdfe

    Dear community,

    I estimated a gravity model with ppmlhdfe. Now, I would like to test whether a saturated model (augmented with several interaction terms) provides a better fit compared to the reduced model without the interaction terms. Unfortunately, Stata seems to not support lrtest after ppmlhdfe. Does someone have an idea what I could do instead?

    Best
    Noemi

  • #2
    ppmlhdfe is from SSC, as you are asked to explain (FAQ Advice #12). The reason why you don't get a result from running lrtest after ppmlhdfe is that this command only allows robust standard errors.


    SE/Robust
    vce(vcetype) vcetype may be robust (default) or cluster fvvarlist (allowing two- and multi-way clustering)
    Likelihood based tests are invalid for models with robust VCE (see https://www.stata.com/support/faqs/s...od-ratio-test/). Just use a Wald test to test the joint significance of the added variables in place of the likelihood-ratio test.

    Code:
    webuse ships, clear
    ppmlhdfe accident op_75_79, absorb(ship)
    ppmlhdfe accident op_75_79 co_65_69 co_70_74 co_75_79, absorb(ship)
    test co_65_69 co_70_74 co_75_79
    Res.:

    Code:
    . ppmlhdfe accident op_75_79, absorb(ship)
    Iteration 1:   deviance = 1.8491e+02  eps = .         iters = 1    tol = 1.0e-04  min(eta) =  -1.77  P  
    Iteration 2:   deviance = 1.6817e+02  eps = 9.95e-02  iters = 1    tol = 1.0e-04  min(eta) =  -2.19      
    Iteration 3:   deviance = 1.6781e+02  eps = 2.18e-03  iters = 1    tol = 1.0e-04  min(eta) =  -2.32      
    Iteration 4:   deviance = 1.6780e+02  eps = 5.99e-06  iters = 1    tol = 1.0e-04  min(eta) =  -2.33      
    Iteration 5:   deviance = 1.6780e+02  eps = 1.06e-10  iters = 1    tol = 1.0e-05  min(eta) =  -2.33   S O
    ------------------------------------------------------------------------------------------------------------
    (legend: p: exact partial-out   s: exact solver   h: step-halving   o: epsilon below tolerance)
    Converged in 5 iterations and 5 HDFE sub-iterations (tol = 1.0e-08)
    
    HDFE PPML regression                              No. of obs      =         34
    Absorbing 1 HDFE group                            Residual df     =         28
                                                      Wald chi2(1)    =       0.38
    Deviance             =  167.8046509               Prob > chi2     =     0.5391
    Log pseudolikelihood = -132.8355711               Pseudo R2       =     0.6271
    ------------------------------------------------------------------------------
                 |               Robust
        accident | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
    -------------+----------------------------------------------------------------
        op_75_79 |   .1842227   .2999313     0.61   0.539    -.4036319    .7720772
           _cons |    2.86371   .2555388    11.21   0.000     2.362863    3.364557
    ------------------------------------------------------------------------------
    
    Absorbed degrees of freedom:
    -----------------------------------------------------+
     Absorbed FE | Categories  - Redundant  = Num. Coefs |
    -------------+---------------------------------------|
            ship |         5           0           5     |
    -----------------------------------------------------+
    
    .
    . ppmlhdfe accident op_75_79 co_65_69 co_70_74 co_75_79, absorb(ship)
    Iteration 1:   deviance = 1.6167e+02  eps = .         iters = 1    tol = 1.0e-04  min(eta) =  -2.14  P  
    Iteration 2:   deviance = 1.3971e+02  eps = 1.57e-01  iters = 1    tol = 1.0e-04  min(eta) =  -2.56      
    Iteration 3:   deviance = 1.3909e+02  eps = 4.46e-03  iters = 1    tol = 1.0e-04  min(eta) =  -2.69      
    Iteration 4:   deviance = 1.3909e+02  eps = 1.15e-05  iters = 1    tol = 1.0e-04  min(eta) =  -2.70      
    Iteration 5:   deviance = 1.3909e+02  eps = 2.66e-10  iters = 1    tol = 1.0e-05  min(eta) =  -2.70   S O
    ------------------------------------------------------------------------------------------------------------
    (legend: p: exact partial-out   s: exact solver   h: step-halving   o: epsilon below tolerance)
    Converged in 5 iterations and 5 HDFE sub-iterations (tol = 1.0e-08)
    
    HDFE PPML regression                              No. of obs      =         34
    Absorbing 1 HDFE group                            Residual df     =         25
                                                      Wald chi2(4)    =       8.14
    Deviance             =  139.0852637               Prob > chi2     =     0.0866
    Log pseudolikelihood = -118.4758775               Pseudo R2       =     0.6674
    ------------------------------------------------------------------------------
                 |               Robust
        accident | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
    -------------+----------------------------------------------------------------
        op_75_79 |   .2928003   .2736869     1.07   0.285    -.2436162    .8292168
        co_65_69 |   .5824489   .3063304     1.90   0.057    -.0179477    1.182846
        co_70_74 |   .4627844   .3591039     1.29   0.197    -.2410462    1.166615
        co_75_79 |  -.1951267   .3849763    -0.51   0.612    -.9496664     .559413
           _cons |    2.48605   .3500144     7.10   0.000     1.800034    3.172066
    ------------------------------------------------------------------------------
    
    Absorbed degrees of freedom:
    -----------------------------------------------------+
     Absorbed FE | Categories  - Redundant  = Num. Coefs |
    -------------+---------------------------------------|
            ship |         5           0           5     |
    -----------------------------------------------------+
    
    .
    . test co_65_69 co_70_74 co_75_79
    
     ( 1)  co_65_69 = 0
     ( 2)  co_70_74 = 0
     ( 3)  co_75_79 = 0
    
               chi2(  3) =    7.65
             Prob > chi2 =    0.0537
    
    .

    Comment

    Working...
    X