Announcement

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

  • Difficulty in reshaping wide to long data

    Hello Dear all,

    I am converting the following college-level data to the state-level. These data, downloaded from the US Integrated Postsecondary Education Data System (IPEDS), represent the federal government’s appropriations to the colleges from fiscal year 2004 to 2021.
    Yearly appropriations are represented by fapnpt0304, fapnpt0405, fapnpt0506, fapnpt0607, ….. fapnpt1920, fapnpt2021.
    The variable ‘inst_cont’ represents the control of a college:

    1 = public,
    2 = private not-for-profit,
    3 = private for-profit).

    The variable ‘inst_sect’ represents the sector of a college:

    0 = Administrative Unit,
    1 = Public 4-year or above,
    2 = Private not-for-profit 4-year or above,
    3 = Private for-profit 4-year or above,
    4 = Public 2-year,
    5 =Private not-for-profit 2-year,
    6 = Private for-profit 2-year,
    7 =Public less-than-2-year,
    8 =Private not-for-profit less than 2-year,
    9 = Private for-profit less than-2-year

    I first collapsed the data to the state level and got the wide data: ‘approp_fednpt_wide’ (attached here) using the following command:

    collapse (sum) fapnpt2021 fapnpt1920 fapnpt1819 fapnpt1718 fapnpt1617 fapnpt1516 fapnpt1415 fapnpt1314 fapnpt1213 fapnpt1112 fapnpt1011 fapnpt0910 fapnpt0809 fapnpt0708 fapnpt0607 fapnpt0506 fapnpt0405 fapnpt0304, by(st_abr inst_sect inst_cont)

    Then, I reshaped the wide data to a long using the following command:

    reshape long fapnpt, i(state_code inst_sect inst_cont) j(year)

    But instead of getting one variable for all years, I found long data for a few years (2011 to 2021) and wide data for some (2004 to 2010). Data from the years 2004 to 2010 are not included in the long data. Please see the attached dataset (‘approp_fednpt_long_wide’). I have two challenges now.

    1. Why data from the years 2004 to 2010 is not included in the long data?

    2. How can I expand the collapse and reshape commands to include additional data (e.g., the yearly appropriations given by the state governments to the colleges)?

    I will appreciate any advice you can provide.

    Best regards,

    Ijaz
    Attached Files

  • #2
    This issue is resolved.

    Comment

    Working...
    X