Announcement

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

  • How to get the regression results as per country or region by using xtreg with re ?

    I am using the below-mentioned command to get the results country wise, but I am not getting any results. Kindly help me with what I can do to get the regression results per country or region?


    "by Crossid: xtreg GFSI lnOA lnFI gdp lnEmi ENG FERT lnERF lnANW Con GPCPI, re "

  • #2
    If you data is at the country level, you cannot do panel regression for each country. But you may for regions, provided that each region has more than one country. Here is an example using the Grunfeld dataset:

    Code:
    webuse grunfeld, clear
    gen top5= company<=5
    bys top5: xtreg invest mvalue kstock
    Res.:

    Code:
    . bys top5: xtreg invest mvalue kstock
    
    ---------------------------------------------------------------------------------------------------------------------------------------
    -> top5 = 0
    
    Random-effects GLS regression                   Number of obs     =        100
    Group variable: company                         Number of groups  =          5
    
    R-sq:                                           Obs per group:
         within  = 0.7874                                         min =         20
         between = 0.6835                                         avg =       20.0
         overall = 0.7213                                         max =         20
    
                                                    Wald chi2(2)      =     352.97
    corr(u_i, X)   = 0 (assumed)                    Prob > chi2       =     0.0000
    
    ------------------------------------------------------------------------------
          invest |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
          mvalue |   .0815434   .0075629    10.78   0.000     .0667203    .0963665
          kstock |   .1147979   .0133422     8.60   0.000     .0886477    .1409481
           _cons |  -7.223386   7.490499    -0.96   0.335    -21.90449    7.457722
    -------------+----------------------------------------------------------------
         sigma_u |   15.81089
         sigma_e |  9.6545682
             rho |  .72840308   (fraction of variance due to u_i)
    ------------------------------------------------------------------------------
    
    ---------------------------------------------------------------------------------------------------------------------------------------
    -> top5 = 1
    
    Random-effects GLS regression                   Number of obs     =        100
    Group variable: company                         Number of groups  =          5
    
    R-sq:                                           Obs per group:
         within  = 0.7817                                         min =         20
         between = 0.7466                                         avg =       20.0
         overall = 0.7567                                         max =         20
    
                                                    Wald chi2(2)      =     345.53
    corr(u_i, X)   = 0 (assumed)                    Prob > chi2       =     0.0000
    
    ------------------------------------------------------------------------------
          invest |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
          mvalue |   .1148413   .0158498     7.25   0.000     .0837763    .1459062
          kstock |   .3203831   .0239996    13.35   0.000     .2733447    .3674215
           _cons |  -81.95815   73.45286    -1.12   0.265    -225.9231    62.00682
    -------------+----------------------------------------------------------------
         sigma_u |  152.89289
         sigma_e |  71.914089
             rho |  .81884338   (fraction of variance due to u_i)
    ------------------------------------------------------------------------------
    
    .

    Comment


    • #3
      thank you so much Andrew Musau. I got it

      Comment

      Working...
      X