Announcement

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

  • Problem with converting a cross-sectional dataset into panel

    Good afternoon,

    Attached is an extract of my dataset. I have cross-sectional data with two variables (GRSSWK1 and GRSSWK5, measuring the gross weekly wage in quarter 1 and quarter 5, respectively), capturing two different periods for observations 2956, 2597 and 2958.

    I need to be able to transform this into panel data to assess a time-trend interaction, for example creating 't=1, 2' and a gross weekly wage variable for the same observation.

    I'm aware one possibly way may be to duplicate and then match, however my econometrics and Stata knowledge aren't great, nor am I certain that I would be able to do this for 5000 observations (my full dataset) and other variables.

    Any help would be greatly appreciated.
    Click image for larger version

Name:	Screenshot 2020-02-06 at 13.31.57.png
Views:	1
Size:	130.2 KB
ID:	1535319
    .

  • #2
    Code:
    gen id = _n
    reshape long GRSSWK, i(id) j(week)
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment


    • #3
      Originally posted by Maarten Buis View Post
      Code:
      gen id = _n
      reshape long GRSSWK, i(id) j(week)
      Thank you very much.

      Comment

      Working...
      X