I have daily measurements which I wanted to collapse by two variables (area and group) by date. As I am not versed in programming skills, I used awkward code of keeping each category of intended variables and then merged the aggregated data as shown below.
My question is how can I collapse this data for each area and group with a short step? I have shared sample data which could be accessed from this link: https://drive.google.com/file/d/0B_S...it?usp=sharing
Thanks
keep if group==1 & area== "urban"
collapse (sum) urban_a_group1 = a urban_b_group1 = b urban_c_group1 = c urban_d_group1 = d, by(date)
My question is how can I collapse this data for each area and group with a short step? I have shared sample data which could be accessed from this link: https://drive.google.com/file/d/0B_S...it?usp=sharing
Thanks
keep if group==1 & area== "urban"
collapse (sum) urban_a_group1 = a urban_b_group1 = b urban_c_group1 = c urban_d_group1 = d, by(date)
Comment