Announcement

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

  • LRTEST error

    Hi, trying to run an LR test but getting an error. Any way to run this with the type of models I'm using? Or is there a different method to compare models like these?

    Code:
    . glm cv dep if include==1, fam(poisson) link(log) nolog vce(robust) eform
    
    Generalized linear models                         No. of obs      =      1,246
    Optimization     : ML                             Residual df     =      1,244
                                                      Scale parameter =          1
    Deviance         =  711.1348832                   (1/df) Deviance =   .5716518
    Pearson          =  969.8694409                   (1/df) Pearson  =   .7796378
    
    Variance function: V(u) = u                       [Poisson]
    Link function    : g(u) = ln(u)                   [Log]
    
                                                      AIC             =   .9543619
    Log pseudolikelihood = -592.5674416               BIC             =  -8155.716
    
    ------------------------------------------------------------------------------
                 |               Robust
              cv |        IRR   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
          dep    |   1.326143   .0272457    13.74   0.000     1.273803    1.380633
           _cons |   .1137594   .0091845   -26.92   0.000       .09711    .1332632
    ------------------------------------------------------------------------------
    Note: _cons estimates baseline incidence rate.
    
    . estimates store m1
    
    . glm cv i.binary dep if include==1, fam(poisson) link(log) nolog vce(robust) eform
    
    Generalized linear models                         No. of obs      =      1,246
    Optimization     : ML                             Residual df     =      1,243
                                                      Scale parameter =          1
    Deviance         =  707.9852305                   (1/df) Deviance =   .5695778
    Pearson          =   969.663448                   (1/df) Pearson  =   .7800993
    
    Variance function: V(u) = u                       [Poisson]
    Link function    : g(u) = ln(u)                   [Log]
    
                                                      AIC             =   .9534392
    Log pseudolikelihood = -590.9926153               BIC             =  -8151.738
    
    -----------------------------------------------------------------------------------
                      |               Robust
                   cv |        IRR   Std. Err.      z    P>|z|     [95% Conf. Interval]
    ------------------+----------------------------------------------------------------
    1.binary          |   1.369277   .2226052     1.93   0.053      .995658    1.883095
               dep    |   1.320781   .0273566    13.43   0.000     1.268237    1.375502
                _cons |   .0884578   .0140422   -15.28   0.000     .0648056    .1207424
    -----------------------------------------------------------------------------------
    Note: _cons estimates baseline incidence rate.
    
    . estimates store m2
    
    . lrtest m1 m2
    LR test likely invalid for models with robust vce
    r(498);
    

  • #2
    Yes, please try without robust SEs.
    Best regards,

    Marcos

    Comment


    • #3
      Also, you can rely on AIC or BIC.
      Best regards,

      Marcos

      Comment


      • #4
        Thanks for your help. I get different model results if I remove the robust SE

        Comment


        • #5
          Just use the z statistic on i.binary. And I’d drop eform. You’re simply testing for a zero effect of i.binary, right?

          Comment


          • #6
            I’m sorry I don’t understand. Use the z statistic instead of the lr test?

            Comment


            • #7
              Yes. There’s no robust version of the LR test. It doesn’t exist. So use the Wald test. With one parameter to test, this is just the asymptotic t test.

              Comment

              Working...
              X