Announcement

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

  • separate regression of different groups in the panel data

    Hi everyone!
    I seem to stuck in the problem of doing regression of different groups within the panel data.

    Im having the i.Period of each year from 1970 to 2015, my aim is to find the coefficient of i.Period in the regression and find its relations with hours worked by the coefficient (positive or negative)
    and i have the total hours worked(L) of different countries from 1970 to 2015 as well. each country was aligned with a number (Country=1,2......), the separate regression should be done for each country

    i.Period is actually generated from the previous xtreg regression and it's the time dummies.

    what code should i use?

    Really appreciate the help!! Thanks!!

  • #2
    Jinghui:
    unfortunately, this is not the most fruitful way to post on this forum.
    What about your regressand and other predictors?
    Do you plan to interact pane -timevar- with hours worked or else?
    Please, read the FAQ and act on them. Thanks.
    Kind regards,
    Carlo
    (StataNow 18.5)

    Comment


    • #3
      Thanks Carlo! Here are my code and data.

      Here is my objective for this regression within the panel.
      Click image for larger version

Name:	2022-01-05 21.40.15.png
Views:	1
Size:	107.3 KB
ID:	1643785

      and now i've made the previous estimation and now i've had the panel of Z_t from 1971 to 2015.

      my previous trial was that i pick up the L_it (hat) of each country from 1971 to 2015 and regress them with the Z_t but it turns out a list of coefficients for each and every year for country 1.
      Here is the code i tried:

      regress g_hours i.Period if Country==1

      But the right result should be the only specific one coefficient for the country. like what's presented in the equation, it should be only for country i and since there're 21 countries so the final results of coefficients should be a table with 21 coefficients.
      the data for country 1 are here in this screenshot
      Click image for larger version

Name:	2022-01-06 00.20.57.png
Views:	1
Size:	211.3 KB
ID:	1643786
      where the i.Period is the Z_t (hat) and my major confusion is how to figure out the beta_i with the panel data like this?

      Really appreciate your reminder! it's a bit of urgent and i only have this step to go. totally got stuck at this step. Would really appreciate for your help!! Thanks a lot!!

      Comment


      • #4
        Sorry, there's a missing value of i.Period==2015. I forgot to add it in.

        Comment


        • #5
          Jinghui:
          maybe:
          Code:
          bysort country: <yourregressioncode>
          Kind regards,
          Carlo
          (StataNow 18.5)

          Comment


          • #6
            Thanks Carlo!! It worked!!

            Thanks a lot for your help.

            Comment

            Working...
            X