Hi, i have a panel data with 3 years.
When I collapse the data by school districts:
it ignores the year variable and makes it a one-year data. Is there anyone I can keep the year variable so that I can still have a 3-year panel data?
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str27 revenue str44 schooldistrict long year "100" "school101" 2009 "200" "school101" 2010 "150" "school101" 2011 "110" "school102" 2009 "120" "school102" 2010 "250" "school102" 2011 end
Code:
collapse(sum) Revenue, by(SchoolDistrict)
Comment