Announcement

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

  • Help needed with GLS panel regression

    I am doing a panel regression (GLS RE) for 5 countries over 26 years each.: My variables include GDP (dep) and a range of independent variables: FDI, Openness etc
    I have done the complete panel regression for the overall 5 countries, but would also like to do each individual country.

    is there any way i can do this with a RE model, whilst in the same stata file, without having to edit data etc?

    many thanks

  • #2
    I dont think you are doing GLS RE, I think you are doing -xtgls- which is a totally different thing.

    In any case, put some sample of your data with -dataex- so that we can toy around with it, and be more specific regarding what you want.

    I guess what you mean is simply

    Code:
    sort country
    by country: reg y x

    Comment


    • #3
      Hi Joro here is my output.


      as you can see there is 5 groups, I want to know how to do an individual regression on each country (group) over the time period, if possible, without having to put the data in individually- and maybe still with the random effects?

      Comment


      • #4
        You cannot estimate a panel model on a time-series or a cross-section. You need panel data (at least 2 countries and at least 2 years).

        Comment


        • #5
          Daniel:
          I think you're on the wrong track: sigma_u=0 (ie, absence of evidence of panel-wise effect) expresses numerically what Andrew Musau has told you in #4.
          You have cross-sectional data (probably multiple observation concerning 5 different countries on the same time period).
          Hence, you have to switch to -regress- (probably Clustering your standard errors on -country-).
          Kind regards,
          Carlo
          (Stata 19.0)

          Comment


          • #6
            Thank you for the help.

            I have 5 countries each with 26 years of observations, with 8 variables.
            Is the panel method not the right one for this data then? as i want to get a complete panel regression across the countries, then do a breakdown for each individual country - which i will regress each individual country at a time.

            Comment


            • #7
              Daniel:
              if you have a T>N panel dataset, you should consider -xtgls- or -xtregar- instead of -xtreg-.
              As far as running separate regressions for each country, you do not have panel data anymore, because you have only 1 -id- (ie, each nation) with observations belonging to different years: this framework is similar to a time-serie.
              Kind regards,
              Carlo
              (Stata 19.0)

              Comment


              • #8
                Great, thank you Carlo, I was just confused about that bit!

                Comment

                Working...
                X