Announcement

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

  • Does STATA REG provide test statistic for Fitness of model and/or homogeneity of residuals and or misspecification?

    Hello everyone,

    Does STATA REG provide test statistic for Fitness of model and/or homogeneity of residuals and or misspecification?

    For example, if I ran simple regression like :

    reg DV IV1 IV2,

    the results only show R square, is there any code that shows the Fitness or Homogeneity, or misspecification?

    Thanks in adavance.

  • #2
    I found that
    estat imtest Can be used as to test the Homogeneity of residuals. Still have trouble to find the Fitness of Model and Misspecification.

    Comment


    • #3
      And

      estat ovtest

      can be used to test misspecification.

      Comment


      • #4
        in general, you should take a look at :
        Code:
        help regress postestimation
        help regress postestimation plots

        Comment


        • #5
          Lucas:
          see al also -linktest- for testing the possible misspecification of the functional form of the regressand.
          Kind regards,
          Carlo
          (Stata 19.0)

          Comment


          • #6
            I try to use estat gof, however it won't show any results.

            Anyway I can get the goodness of fit test results?

            Comment


            • #7
              please read the FAQ and show exactly what you entered and exactly what Stata replied - I don't see "estat gof" in either of the help files I sent you to so where did you find it?

              Comment


              • #8
                Originally posted by Rich Goldstein View Post
                please read the FAQ and show exactly what you entered and exactly what Stata replied - I don't see "estat gof" in either of the help files I sent you to so where did you find it?
                https://www.stata.com/manuals13/restatgof.pdf

                Comment


                • #9
                  Lucas:
                  the first part of Rich's wise recommendation is probably the most relevant one: how could interested listers reply positively without any clues of what have you typed and what Stata returned (use CODE delimiters, please)? Thanks.
                  Kind regards,
                  Carlo
                  (Stata 19.0)

                  Comment


                  • #10
                    Originally posted by Carlo Lazzaro View Post
                    Lucas:
                    the first part of Rich's wise recommendation is probably the most relevant one: how could interested listers reply positively without any clues of what have you typed and what Stata returned (use CODE delimiters, please)? Thanks.
                    Hi Carlo,

                    Thanks for your reply,
                    I enter :

                    PHP Code:
                    reg dependentvariable independentvariable

                    estat gof 
                    Stata replied:

                    estat gof not valid
                    r(321);
                    It looks like that estat gof can only input after the
                    logit
                    function.

                    Thus if I run:

                    logit dependentvariable independentvariable

                    estat gof
                    It showes the Chi-square.

                    Is there any way that I can get the Chi-square by using the regular regression?

                    Thanks


                    Comment


                    • #11
                      Lucas:
                      thanks for providing furthe details.
                      As you surmised, -esta gof- is not a post estimation commands that you can use after -regress-.
                      That said, if you want to check your OLS, you can use -estat hettest- (to test for heteroskedastcity) and -linktest- or -estat imtest- (to test for model misspecification).
                      Eventually, OLS gives back R-sq and Adj R_sq (no chi_sq).
                      Kind regards,
                      Carlo
                      (Stata 19.0)

                      Comment


                      • #12
                        Originally posted by Carlo Lazzaro View Post
                        Lucas:
                        thanks for providing furthe details.
                        As you surmised, -esta gof- is not a post estimation commands that you can use after -regress-.
                        That said, if you want to check your OLS, you can use -estat hettest- (to test for heteroskedastcity) and -linktest- or -estat imtest- (to test for model misspecification).
                        Eventually, OLS gives back R-sq and Adj R_sq (no chi_sq).
                        Thank you so very much, Carlo,

                        One of my paper reviewers insist I put the Chi-square for model fitness, that's why I am trying to ask.

                        Thanks again,

                        Comment


                        • #13
                          ask the reviewer for a citation which you can then share with us; as Carlo Lazzaro says, this command cannot be used after -regress- (and I recommend against it anyway as it is heavily affected by the number of "groups" used; I repeat that you should see the help files I noted in #2 above (as well as
                          Code:
                          help linktest
                          as noted by Carlo

                          it may also help if you can provide the context the reviewer is responding to

                          Comment


                          • #14
                            Lucas:

                            If you actually performed an OLS and you have provided the list with all the relevant details concerning the matters, it sounds really strange that a decent reviewer asks for something that does not make sense.
                            If that were the case, as an aside to @Rich Goldstein 's helpful advice, you can rebut the reviewer in a gentle way that, while, OLS resturns R-sq, some post estimation tests to be conducted after OLS actually return a chi2 statistic, as you can see from the following toy example:
                            Code:
                            . sysuse auto.dta
                            (1978 Automobile Data)
                            
                            . regress price i.foreign
                            
                                  Source |       SS           df       MS      Number of obs   =        74
                            -------------+----------------------------------   F(1, 72)        =      0.17
                                   Model |  1507382.66         1  1507382.66   Prob > F        =    0.6802
                                Residual |   633558013        72  8799416.85   R-squared       =    0.0024
                            -------------+----------------------------------   Adj R-squared   =   -0.0115
                                   Total |   635065396        73  8699525.97   Root MSE        =    2966.4
                            
                            ------------------------------------------------------------------------------
                                   price |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
                            -------------+----------------------------------------------------------------
                                 foreign |
                                Foreign  |   312.2587   754.4488     0.41   0.680    -1191.708    1816.225
                                   _cons |   6072.423    411.363    14.76   0.000     5252.386     6892.46
                            ------------------------------------------------------------------------------
                            
                            . estat hettest
                            
                            Breusch-Pagan / Cook-Weisberg test for heteroskedasticity
                                     Ho: Constant variance
                                     Variables: fitted values of price
                            
                                     chi2(1)      =     0.85
                                     Prob > chi2  =   0.3554
                            
                            . estat imtest
                            
                            Cameron & Trivedi's decomposition of IM-test
                            
                            ---------------------------------------------------
                                          Source |       chi2     df      p
                            ---------------------+-----------------------------
                              Heteroskedasticity |       0.43      1    0.5103
                                        Skewness |      13.02      1    0.0003
                                        Kurtosis |       4.20      1    0.0404
                            ---------------------+-----------------------------
                                           Total |      17.66      3    0.0005
                            ---------------------------------------------------
                            
                            .
                            See also https://stats.stackexchange.com/ques...and-chi-square
                            Kind regards,
                            Carlo
                            (Stata 19.0)

                            Comment


                            • #15
                              Originally posted by Carlo Lazzaro View Post
                              Lucas:

                              If you actually performed an OLS and you have provided the list with all the relevant details concerning the matters, it sounds really strange that a decent reviewer asks for something that does not make sense.
                              If that were the case, as an aside to @Rich Goldstein 's helpful advice, you can rebut the reviewer in a gentle way that, while, OLS resturns R-sq, some post estimation tests to be conducted after OLS actually return a chi2 statistic, as you can see from the following toy example:
                              Code:
                              . sysuse auto.dta
                              (1978 Automobile Data)
                              
                              . regress price i.foreign
                              
                              Source | SS df MS Number of obs = 74
                              -------------+---------------------------------- F(1, 72) = 0.17
                              Model | 1507382.66 1 1507382.66 Prob > F = 0.6802
                              Residual | 633558013 72 8799416.85 R-squared = 0.0024
                              -------------+---------------------------------- Adj R-squared = -0.0115
                              Total | 635065396 73 8699525.97 Root MSE = 2966.4
                              
                              ------------------------------------------------------------------------------
                              price | Coef. Std. Err. t P>|t| [95% Conf. Interval]
                              -------------+----------------------------------------------------------------
                              foreign |
                              Foreign | 312.2587 754.4488 0.41 0.680 -1191.708 1816.225
                              _cons | 6072.423 411.363 14.76 0.000 5252.386 6892.46
                              ------------------------------------------------------------------------------
                              
                              . estat hettest
                              
                              Breusch-Pagan / Cook-Weisberg test for heteroskedasticity
                              Ho: Constant variance
                              Variables: fitted values of price
                              
                              chi2(1) = 0.85
                              Prob > chi2 = 0.3554
                              
                              . estat imtest
                              
                              Cameron & Trivedi's decomposition of IM-test
                              
                              ---------------------------------------------------
                              Source | chi2 df p
                              ---------------------+-----------------------------
                              Heteroskedasticity | 0.43 1 0.5103
                              Skewness | 13.02 1 0.0003
                              Kurtosis | 4.20 1 0.0404
                              ---------------------+-----------------------------
                              Total | 17.66 3 0.0005
                              ---------------------------------------------------
                              
                              .
                              See also https://stats.stackexchange.com/ques...and-chi-square
                              This is great and is exactly what I was looking for!

                              Thank you so very much Carlo!

                              Comment

                              Working...
                              X