Announcement

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

  • bootstrap likelihood ratio OR Lo-Mendell-Rubin adjusted likelihood ratio test

    Dear Statalisters,

    Please I am looking for your help to obtain the syntax in order to calculate bootstrap likelihood ratio test (BLRT) and Lo-Mendell-Rubin adjusted likelihood ratio tests for the number of classes in latent class models .

    Thanks
    Last edited by Radhouene DOGGUI; 28 Sep 2020, 06:20.

  • #2
    Radhouenne:
    as far as your first question is concerned (I'm not familiar with Lo-Mendell-Rubin adjusted likelihood ratio test), the following toy-example may be helpful:
    Code:
    . use "C:\Program Files\Stata16\ado\base\a\auto.dta"
    
    . logit foreign mpg
    
    Iteration 0:   log likelihood =  -45.03321  
    Iteration 1:   log likelihood = -39.380959  
    Iteration 2:   log likelihood = -39.288802  
    Iteration 3:   log likelihood =  -39.28864  
    Iteration 4:   log likelihood =  -39.28864  
    
    Logistic regression                             Number of obs     =         74
                                                    LR chi2(1)        =      11.49
                                                    Prob > chi2       =     0.0007
    Log likelihood =  -39.28864                     Pseudo R2         =     0.1276
    
    ------------------------------------------------------------------------------
         foreign |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
             mpg |   .1597621   .0525876     3.04   0.002     .0566922     .262832
           _cons |  -4.378866   1.211295    -3.62   0.000    -6.752961   -2.004771
    ------------------------------------------------------------------------------
    
    . bootstrap (e(ll)), reps(200) : logit foreign mpg
    (running logit on estimation sample)
    
    Bootstrap replications (200)
    ----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 
    ..................................................    50
    ..................................................   100
    ..................................................   150
    ..................................................   200
    
    Logistic regression                             Number of obs     =         74
                                                    Replications      =        200
    
          command:  logit foreign mpg
            _bs_1:  e(ll)
    
    ------------------------------------------------------------------------------
                 |   Observed   Bootstrap                         Normal-based
                 |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
           _bs_1 |  -39.28864   4.084001    -9.62   0.000    -47.29314   -31.28414
    ------------------------------------------------------------------------------
    
    . estat bootstrap, all
    
    Logistic regression                             Number of obs     =         74
                                                    Replications      =        200
    
          command:  logit foreign mpg
            _bs_1:  e(ll)
    
    ------------------------------------------------------------------------------
                 |    Observed               Bootstrap
                 |       Coef.       Bias    Std. Err.  [95% Conf. Interval]
    -------------+----------------------------------------------------------------
           _bs_1 |   -39.28864   .9831143   4.0840012   -47.29314  -31.28414   (N)
                 |                                      -45.72757  -29.04522   (P)
                 |                                      -46.91825  -31.80264  (BC)
    ------------------------------------------------------------------------------
    (N)    normal confidence interval
    (P)    percentile confidence interval
    (BC)   bias-corrected confidence interval
    
    .
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Originally posted by Carlo Lazzaro View Post
      Radhouenne:
      as far as your first question is concerned (I'm not familiar with Lo-Mendell-Rubin adjusted likelihood ratio test), the following toy-example may be helpful:
      Code:
      . use "C:\Program Files\Stata16\ado\base\a\auto.dta"
      
      . logit foreign mpg
      
      Iteration 0: log likelihood = -45.03321
      Iteration 1: log likelihood = -39.380959
      Iteration 2: log likelihood = -39.288802
      Iteration 3: log likelihood = -39.28864
      Iteration 4: log likelihood = -39.28864
      
      Logistic regression Number of obs = 74
      LR chi2(1) = 11.49
      Prob > chi2 = 0.0007
      Log likelihood = -39.28864 Pseudo R2 = 0.1276
      
      ------------------------------------------------------------------------------
      foreign | Coef. Std. Err. z P>|z| [95% Conf. Interval]
      -------------+----------------------------------------------------------------
      mpg | .1597621 .0525876 3.04 0.002 .0566922 .262832
      _cons | -4.378866 1.211295 -3.62 0.000 -6.752961 -2.004771
      ------------------------------------------------------------------------------
      
      . bootstrap (e(ll)), reps(200) : logit foreign mpg
      (running logit on estimation sample)
      
      Bootstrap replications (200)
      ----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5
      .................................................. 50
      .................................................. 100
      .................................................. 150
      .................................................. 200
      
      Logistic regression Number of obs = 74
      Replications = 200
      
      command: logit foreign mpg
      _bs_1: e(ll)
      
      ------------------------------------------------------------------------------
      | Observed Bootstrap Normal-based
      | Coef. Std. Err. z P>|z| [95% Conf. Interval]
      -------------+----------------------------------------------------------------
      _bs_1 | -39.28864 4.084001 -9.62 0.000 -47.29314 -31.28414
      ------------------------------------------------------------------------------
      
      . estat bootstrap, all
      
      Logistic regression Number of obs = 74
      Replications = 200
      
      command: logit foreign mpg
      _bs_1: e(ll)
      
      ------------------------------------------------------------------------------
      | Observed Bootstrap
      | Coef. Bias Std. Err. [95% Conf. Interval]
      -------------+----------------------------------------------------------------
      _bs_1 | -39.28864 .9831143 4.0840012 -47.29314 -31.28414 (N)
      | -45.72757 -29.04522 (P)
      | -46.91825 -31.80264 (BC)
      ------------------------------------------------------------------------------
      (N) normal confidence interval
      (P) percentile confidence interval
      (BC) bias-corrected confidence interval
      
      .
      Thank you so much Carlo.

      I used the syntax that you provided.

      bootstrap (e(ll)), reps(200) : traj if gender==1, var(bmi*) indep(age*) model(beta) order(2 2 2 )
      bootstrap (e(ll)), reps(200) : traj if gender==1, var(bmi*) indep(age*) model(beta) order(2 2 )

      However, because I am dealing with latent variables class analysis , specifically the group based trajectory modeling. I don't know how to interpret that, specifically how to compare what model is better with 3 or 2 latent variables. There is no P value to compare the both models.


      Do you have any feedback about that.

      Regards.

      Comment


      • #4
        No, I do not.
        Sorry for that.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment

        Working...
        X