Announcement

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

  • Panel data transformation

    Data:
    input long EIN str100 npo_name float time int(cases_wave1 death_wave1) long(cases_wave2 death_wave2 cases_wave3 death_wave3)
    10559171 "Community Partners " 1 28 0 . . . .
    10569681 "Brethren Heritage Center" 1 2180 56 . . . .
    10575698 "Free Clinic" 1 12892 187 . . . .
    10575698 "Free Clinic" 3 . . . . 16896030 196553
    10575698 " Free Clinic" 2 . . 1059487 38030 . .
    10590897 " FAMILY CAREER AND COMMUNITY LEADERS OF AMERICA ENDOWMENT" 1 12892 187 . . . .
    10603034 "Rural Health Collaborative of Southern" 2 . . 2650 124 . .
    10603034 "Rural Health Collaborative of Southern " 1 30 0 . . . .

    I am hoping to generate new variables like "case" and "death" for each EIN (its unique identifier), stack the cases and death per time rather than different variables. For example - **EIN ** 10575698 **npo_name** "Free Clinic" I develop cases and death of each time variable like panel data. So cases_wave2 will be under same variable case in time 2. Same for time 3, cases_wave3 for EIN that are participating in more than 1 time.

  • #2
    perhaps,
    Code:
    rename *_wave# *#
    reshape long cases death, i(EIN npo_name time) j(wave)

    Comment


    • #3
      Abhishek:
      see -reshape-.
      In addition, for future researches please consider that most of the Stata commands work at their best when data are in -long- format.
      Kind regards,
      Carlo
      (Stata 19.0)

      Comment

      Working...
      X