Announcement

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

  • #16
    Nitin:
    exactly.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #17
      Originally posted by Carlo Lazzaro View Post
      Nitin:
      exactly.
      Thank you, Carlo.

      Comment


      • #18
        Originally posted by Carlo Lazzaro View Post
        Nitin:
        exactly.
        Dear Carlo: For a count model like negative binomial, can we use the same procedure as suggested by Prof. Wooldridge earlier or does STATA have an option to do a functional misspecification check for these models? Please advice. Thanks.

        Comment


        • #19
          Notin:
          you can go -linktest-:
          Code:
          . use "C:\Program Files\Stata17\ado\base\a\auto.dta"
          (1978 automobile data)
          
          . nbreg rep78 mpg
          
          Fitting Poisson model:
          
          Iteration 0:   log likelihood = -114.65178  
          Iteration 1:   log likelihood = -114.65178  
          
          Fitting constant-only model:
          
          Iteration 0:   log likelihood = -162.82048  
          Iteration 1:   log likelihood = -116.17777  
          Iteration 2:   log likelihood = -116.17777  
          
          Fitting full model:
          
          Iteration 0:   log likelihood = -114.65639  
          Iteration 1:   log likelihood = -114.65178  
          Iteration 2:   log likelihood = -114.65178  
          
          Negative binomial regression                            Number of obs =     69
                                                                  LR chi2(1)    =   3.05
          Dispersion: mean                                        Prob > chi2   = 0.0806
          Log likelihood = -114.65178                             Pseudo R2     = 0.0131
          
          ------------------------------------------------------------------------------
                 rep78 | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
          -------------+----------------------------------------------------------------
                   mpg |   .0188662   .0106071     1.78   0.075    -.0019234    .0396558
                 _cons |   .8175587   .2419551     3.38   0.001     .3433354    1.291782
          -------------+----------------------------------------------------------------
              /lnalpha |  -41.45834          .                             .           .
          -------------+----------------------------------------------------------------
                 alpha |   9.88e-19          .                             .           .
          ------------------------------------------------------------------------------
          LR test of alpha=0: chibar2(01) = 0.00                 Prob >= chibar2 = 1.000
          
          . linktest
          
          Fitting Poisson model:
          
          Iteration 0:   log likelihood = -114.36006  
          Iteration 1:   log likelihood = -114.35988  
          Iteration 2:   log likelihood = -114.35988  
          
          Fitting constant-only model:
          
          Iteration 0:   log likelihood = -162.82048  
          Iteration 1:   log likelihood = -116.17777  
          Iteration 2:   log likelihood = -116.17777  
          
          Fitting full model:
          
          Iteration 0:   log likelihood = -114.36554  
          Iteration 1:   log likelihood = -114.35988  
          Iteration 2:   log likelihood = -114.35988  
          
          Negative binomial regression                            Number of obs =     69
                                                                  LR chi2(2)    =   3.64
          Dispersion: mean                                        Prob > chi2   = 0.1624
          Log likelihood = -114.35988                             Pseudo R2     = 0.0156
          
          ------------------------------------------------------------------------------
                 rep78 | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
          -------------+----------------------------------------------------------------
                  _hat |  -5.868779   8.883808    -0.66   0.509    -23.28072    11.54316
                _hatsq |   2.666774   3.437846     0.78   0.438     -4.07128    9.404827
                 _cons |    4.37753   5.696759     0.77   0.442    -6.787911    15.54297
          -------------+----------------------------------------------------------------
              /lnalpha |  -41.45834          .                             .           .
          -------------+----------------------------------------------------------------
                 alpha |   9.88e-19          .                             .           .
          ------------------------------------------------------------------------------
          LR test of alpha=0: chibar2(01) = 0.00                 Prob >= chibar2 = 1.000
          
          .
          Kind regards,
          Carlo
          (Stata 19.0)

          Comment


          • #20
            Originally posted by Carlo Lazzaro View Post
            Notin:
            you can go -linktest-:
            Code:
            . use "C:\Program Files\Stata17\ado\base\a\auto.dta"
            (1978 automobile data)
            
            . nbreg rep78 mpg
            
            Fitting Poisson model:
            
            Iteration 0: log likelihood = -114.65178
            Iteration 1: log likelihood = -114.65178
            
            Fitting constant-only model:
            
            Iteration 0: log likelihood = -162.82048
            Iteration 1: log likelihood = -116.17777
            Iteration 2: log likelihood = -116.17777
            
            Fitting full model:
            
            Iteration 0: log likelihood = -114.65639
            Iteration 1: log likelihood = -114.65178
            Iteration 2: log likelihood = -114.65178
            
            Negative binomial regression Number of obs = 69
            LR chi2(1) = 3.05
            Dispersion: mean Prob > chi2 = 0.0806
            Log likelihood = -114.65178 Pseudo R2 = 0.0131
            
            ------------------------------------------------------------------------------
            rep78 | Coefficient Std. err. z P>|z| [95% conf. interval]
            -------------+----------------------------------------------------------------
            mpg | .0188662 .0106071 1.78 0.075 -.0019234 .0396558
            _cons | .8175587 .2419551 3.38 0.001 .3433354 1.291782
            -------------+----------------------------------------------------------------
            /lnalpha | -41.45834 . . .
            -------------+----------------------------------------------------------------
            alpha | 9.88e-19 . . .
            ------------------------------------------------------------------------------
            LR test of alpha=0: chibar2(01) = 0.00 Prob >= chibar2 = 1.000
            
            . linktest
            
            Fitting Poisson model:
            
            Iteration 0: log likelihood = -114.36006
            Iteration 1: log likelihood = -114.35988
            Iteration 2: log likelihood = -114.35988
            
            Fitting constant-only model:
            
            Iteration 0: log likelihood = -162.82048
            Iteration 1: log likelihood = -116.17777
            Iteration 2: log likelihood = -116.17777
            
            Fitting full model:
            
            Iteration 0: log likelihood = -114.36554
            Iteration 1: log likelihood = -114.35988
            Iteration 2: log likelihood = -114.35988
            
            Negative binomial regression Number of obs = 69
            LR chi2(2) = 3.64
            Dispersion: mean Prob > chi2 = 0.1624
            Log likelihood = -114.35988 Pseudo R2 = 0.0156
            
            ------------------------------------------------------------------------------
            rep78 | Coefficient Std. err. z P>|z| [95% conf. interval]
            -------------+----------------------------------------------------------------
            _hat | -5.868779 8.883808 -0.66 0.509 -23.28072 11.54316
            _hatsq | 2.666774 3.437846 0.78 0.438 -4.07128 9.404827
            _cons | 4.37753 5.696759 0.77 0.442 -6.787911 15.54297
            -------------+----------------------------------------------------------------
            /lnalpha | -41.45834 . . .
            -------------+----------------------------------------------------------------
            alpha | 9.88e-19 . . .
            ------------------------------------------------------------------------------
            LR test of alpha=0: chibar2(01) = 0.00 Prob >= chibar2 = 1.000
            
            .
            Thank you, Carlo. Will try this.

            Comment


            • #21
              Originally posted by Carlo Lazzaro View Post
              Notin:
              you can go -linktest-:
              Code:
              . use "C:\Program Files\Stata17\ado\base\a\auto.dta"
              (1978 automobile data)
              
              . nbreg rep78 mpg
              
              Fitting Poisson model:
              
              Iteration 0: log likelihood = -114.65178
              Iteration 1: log likelihood = -114.65178
              
              Fitting constant-only model:
              
              Iteration 0: log likelihood = -162.82048
              Iteration 1: log likelihood = -116.17777
              Iteration 2: log likelihood = -116.17777
              
              Fitting full model:
              
              Iteration 0: log likelihood = -114.65639
              Iteration 1: log likelihood = -114.65178
              Iteration 2: log likelihood = -114.65178
              
              Negative binomial regression Number of obs = 69
              LR chi2(1) = 3.05
              Dispersion: mean Prob > chi2 = 0.0806
              Log likelihood = -114.65178 Pseudo R2 = 0.0131
              
              ------------------------------------------------------------------------------
              rep78 | Coefficient Std. err. z P>|z| [95% conf. interval]
              -------------+----------------------------------------------------------------
              mpg | .0188662 .0106071 1.78 0.075 -.0019234 .0396558
              _cons | .8175587 .2419551 3.38 0.001 .3433354 1.291782
              -------------+----------------------------------------------------------------
              /lnalpha | -41.45834 . . .
              -------------+----------------------------------------------------------------
              alpha | 9.88e-19 . . .
              ------------------------------------------------------------------------------
              LR test of alpha=0: chibar2(01) = 0.00 Prob >= chibar2 = 1.000
              
              . linktest
              
              Fitting Poisson model:
              
              Iteration 0: log likelihood = -114.36006
              Iteration 1: log likelihood = -114.35988
              Iteration 2: log likelihood = -114.35988
              
              Fitting constant-only model:
              
              Iteration 0: log likelihood = -162.82048
              Iteration 1: log likelihood = -116.17777
              Iteration 2: log likelihood = -116.17777
              
              Fitting full model:
              
              Iteration 0: log likelihood = -114.36554
              Iteration 1: log likelihood = -114.35988
              Iteration 2: log likelihood = -114.35988
              
              Negative binomial regression Number of obs = 69
              LR chi2(2) = 3.64
              Dispersion: mean Prob > chi2 = 0.1624
              Log likelihood = -114.35988 Pseudo R2 = 0.0156
              
              ------------------------------------------------------------------------------
              rep78 | Coefficient Std. err. z P>|z| [95% conf. interval]
              -------------+----------------------------------------------------------------
              _hat | -5.868779 8.883808 -0.66 0.509 -23.28072 11.54316
              _hatsq | 2.666774 3.437846 0.78 0.438 -4.07128 9.404827
              _cons | 4.37753 5.696759 0.77 0.442 -6.787911 15.54297
              -------------+----------------------------------------------------------------
              /lnalpha | -41.45834 . . .
              -------------+----------------------------------------------------------------
              alpha | 9.88e-19 . . .
              ------------------------------------------------------------------------------
              LR test of alpha=0: chibar2(01) = 0.00 Prob >= chibar2 = 1.000
              
              .
              Hi, Carlo, Is the link test applicable for a panel data? I am using a negative binomial model on a count panel data. The link test doesn't work if I use xtnbreg. It works only on nbreg. Please advice. Thanks,

              Comment


              • #22
                Nitin:
                you should go manually, as -linktest- never works after -xt- commands.
                You should calculate:
                Code:
                predict fitted, xb
                and its squared term:
                Code:
                gen sq_fitted=fitted^2
                and then do the ancillary regression as in -linktest-.
                Kind regards,
                Carlo
                (Stata 19.0)

                Comment


                • #23
                  Originally posted by Carlo Lazzaro View Post
                  Nitin:
                  you should go manually, as -linktest- never works after -xt- commands.
                  You should calculate:
                  Code:
                  predict fitted, xb
                  and its squared term:
                  Code:
                  gen sq_fitted=fitted^2
                  and then do the ancillary regression as in -linktest-.
                  Thank you, Carlo.

                  Comment

                  Working...
                  X