Announcement

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

  • Help with Likelihood Ratio Test

    I keep encountering an error, due to the number of observations differing. I have ran the two regressions on the restricted and unrestricted model. My Professor in his words has said, "Change the sample so that you are running them on the same sample. If you test the restriction on the estimate from the unrestricted sample, it will do it automatically." My issue is, how do I do this? I have seen tutorials online and other examples, they follow the method I have been doing. So where am I going wrong?

    I have uploaded my question sheet also, with the two different models.

    Please any help is deeply appreciated. Coursework for Econometrics.pdf

  • #2
    Hello Shakib. I have not looked at your PDF, but perhaps the following example will help. It sounds like you are having the same problem that arises for the second version of my reduced model.

    Code:
    clear
    webuse lbw
    tab smoke
    
    * Generate some missing data for variable smoke so that the full
    * model does not use all cases in the file.
    
    replace smoke = . if inlist(_n,25,50,75,100,125,150,175)
    tab smoke
    
    logit low age lwt i.race smoke ptl ht ui // The full model
    generate byte fullsample = e(sample) // Flag cases used for full model
    estimates store full
    
    logit low age lwt i.race if fullsample // Reduced model using full model sample
    estimates store reduced1
    
    logit low age lwt i.race // Reduced model using all available cases
    estimates store reduced2
    
    lrtest full reduced1, stats
    lrtest full reduced2, stats
    Here is the output from the two lrtest commands:
    Code:
    . lrtest full reduced1, stats
    
    Likelihood-ratio test                                 LR chi2(4)  =     21.79
    (Assumption: reduced1 nested in full)                 Prob > chi2 =    0.0002
    
    Akaike's information criterion and Bayesian information criterion
    
    -----------------------------------------------------------------------------
           Model |        Obs  ll(null)  ll(model)      df         AIC        BIC
    -------------+---------------------------------------------------------------
        reduced1 |        182 -113.1361  -107.3981       5    224.7962   240.8162
            full |        182 -113.1361  -96.50243       9    211.0049   239.8409
    -----------------------------------------------------------------------------
                   Note: N=Obs used in calculating BIC; see [R] BIC note.
    
    . lrtest full reduced2, stats
    observations differ: 182 vs. 189
    r(498);
    --
    Bruce Weaver
    Email: [email protected]
    Version: Stata/MP 18.5 (Windows)

    Comment


    • #3
      Thanks for the reply Bruce, I will try something similar to this and see my results.

      I have a question however. My models include 1 period lags and differences, could this be the reason?

      Comment


      • #4
        Now I am getting the following:

        logit rl lr1 drl r lr0 dr0

        outcome does not vary; remember:
        0 = negative outcome,
        all other nonmissing values = positive outcome
        r(2000);

        end of do-file

        r(2000);

        Comment


        • #5
          Shakib:
          if you do not have any variation in your dependent variable, -logit- gasps.
          ​​​​
          Kind regards,
          Carlo
          (Stata 19.0)

          Comment

          Working...
          X