Announcement

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

  • #16
    Thanks Carlo,

    I understand from your answer that I should not use Hausman test, but I don't understand why and at the same time how should I use xtoverid?

    Comment


    • #17
      Mustapha:
      because, if you decide to go -robust- or clustered standard errors, -hausman- does not support them.
      Coversely, if you use default standard errors, -hausman- works fine.
      Kind regards,
      Carlo
      (Stata 19.0)

      Comment


      • #18
        Thanks Carlo,

        Then should I go

        Code:
         xtreg GDPgrowthannual Manufacturingvalueaddedannua Foreigndirectinvestmentneti GrosssavingscurrentUS InflationGDPdeflatorannual Hightechnologyexportsofma Populationgrowthannual Schoolenrollmentsecondary OilExporting c.Manufacturingvalueaddedannua#OilExporting, re  
        
        estimates store random  
        
        xtreg GDPgrowthannual Manufacturingvalueaddedannua Foreigndirectinvestmentneti GrosssavingscurrentUS InflationGDPdeflatorannual Hightechnologyexportsofma Populationgrowthannual Schoolenrollmentsecondary OilExporting c.Manufacturingvalueaddedannua# OilExporting, fe  
        
        estimates store fixed  
        
        Xtoverid
        Are these steps right?
        Last edited by Mustapha Younis; 14 May 2020, 16:23.

        Comment


        • #19
          Dear Carlo,

          Xtoverid is not working with me. I got an error message r(198).

          Code:
          error . . . . . . . . . . . . . . . . . . . . . . . .  Return code 198
                  invalid syntax;
                  option __________ incorrectly specified;
                  option __________ not allowed;
                  __________ invalid;
                  range invalid;
                  __________ invalid obs no;
                  invalid filename;
                  __________ invalid varname;
                  __________ invalid name;
                  multiple by's not allowed;
                  __________ found where number expected;
                  on or off required;
                  All items in this list indicate invalid syntax.  These errors
                  are often, but not always, due to typographical errors.  Stata
                  attempts to provide you with as much information as it can.
                  Review the syntax diagram for the designated command.
                  In giving the message "invalid syntax", Stata is not helpful.
                  Errors in specifying expressions often result in this message.
          Click image for larger version

Name:	Capture5.JPG
Views:	1
Size:	14.9 KB
ID:	1553247
          Last edited by Mustapha Younis; 14 May 2020, 16:57.

          Comment


          • #20
            Mustapha:
            what if you type:
            Code:
            xi: xtreg GDPgrowthannual Manufacturingvalueaddedannua Foreigndirectinvestmentneti GrosssavingscurrentUS InflationGDPdeflatorannual Hightechnologyexportsofma Populationgrowthannual Schoolenrollmentsecondary OilExporting c.Manufacturingvalueaddedannua#OilExporting, re vce(cluster panelid)
            xtoverid
            Kind regards,
            Carlo
            (Stata 19.0)

            Comment


            • #21
              Dear Carlo,

              I got the same error message.

              I have another question, Is this interaction term right?
              Code:
                
               c.Manufacturingvalueaddedannua#OilExporting
              It is an interaction between an independent variable and a dummy variable. I just want to make sure that the command is right.

              Comment


              • #22
                Mustapha:
                1) just to get a clearer insight in what you're doing: you started with a clustered standard errors (SEs), then in your last examples you seemingly switched to default SES. Please clarify.
                That said:
                a) if you go default: go -hausman-;
                b) if you go clustered, go -xtoverid-: the error you experienced is probably due to an omitted variable, that yiou should omit manually (see https://www.stata.com/statalist/arch.../msg00885.html).
                2) you interaction code should be:
                Code:
                c.Manufacturingvalueaddedannua##i.OilExporting
                Last edited by Carlo Lazzaro; 15 May 2020, 10:51.
                Kind regards,
                Carlo
                (Stata 19.0)

                Comment


                • #23
                  Dear Carlo,

                  I don't know what's the meaning of going default or going clustered. But generally I want to go default to use the hausman test.

                  Comment


                  • #24
                    Mustapha:
                    - default standard errors=the standar errors that -xtreg-provides when you do not specify any -vce()-options;
                    - clustered standard errors=-vce(cluster panelid)-.
                    Kind regards,
                    Carlo
                    (Stata 19.0)

                    Comment


                    • #25
                      Dear Carlo,

                      I think I didn't specify vce, if I am not wrong, but I want to go with Hausman test.
                      Do you have any comment on the econometric model?

                      Comment


                      • #26
                        Mustapha:
                        the advice about -cluster()- concerned the apparent heteroskedasticity in the epsilon residual distribution in the graph you originally posted.
                        If you've changed your model specification and fixed heteroskedasticity, obviously default standard errors are enough and -hausman- is the way to go.
                        Your econometric model is as good as it gives a fair and true view of the data generating process.
                        Kind regards,
                        Carlo
                        (Stata 19.0)

                        Comment


                        • #27
                          Thank you Carlo.

                          Yes, I want to specify it without cluster and I want to use the hausman.
                          I just used the epsilon residual distribution in the graph because the hettest wasn't working with xtreg and I didn't know how to see for heteroskedasticity. If there's another way to see heteroskedasticity visually without going cluster I will be grateful if you guided me in that.

                          Regards.

                          Comment


                          • #28
                            Mustapha:
                            there's no need to go -cluster()- to visually inspect epsilon distribution for potential heteroskedasticity:

                            Code:
                             use "https://www.stata-press.com/data/r16/nlswork.dta"
                            . xtreg ln_wage age, re
                            
                            Random-effects GLS regression                   Number of obs     =     28,510
                            Group variable: idcode                          Number of groups  =      4,710
                            
                            R-sq:                                           Obs per group:
                                 within  = 0.1026                                         min =          1
                                 between = 0.0877                                         avg =        6.1
                                 overall = 0.0774                                         max =         15
                            
                                                                            Wald chi2(1)      =    3140.35
                            corr(u_i, X)   = 0 (assumed)                    Prob > chi2       =     0.0000
                            
                            ------------------------------------------------------------------------------
                                 ln_wage |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
                            -------------+----------------------------------------------------------------
                                     age |   .0185667   .0003313    56.04   0.000     .0179174    .0192161
                                   _cons |   1.120439   .0112038   100.01   0.000      1.09848    1.142398
                            -------------+----------------------------------------------------------------
                                 sigma_u |  .36972456
                                 sigma_e |  .30349389
                                     rho |  .59743613   (fraction of variance due to u_i)
                            ------------------------------------------------------------------------------
                            
                            . predict fitted, xb
                            (24 missing values generated)
                            
                            . predict residual, e
                            (24 missing values generated)
                            
                            . scatter residual fitted
                            .
                            Kind regards,
                            Carlo
                            (Stata 19.0)

                            Comment


                            • #29
                              Thanks a lot Carlo.

                              I learned from you a lot.

                              Best Regards.

                              Comment

                              Working...
                              X