I have two time series datasets; one weekly and one daily. I want to collapse the daily one to weekly and create means on the variable values. The issue I am struggling with is that I want to collapse the daily series from Monday to Sunday (to match the variable in the weekly series which is measured on a Monday). Stata's weekly variable starts on a Sunday so I can't use that (as far as I can see) to collapse on. I've been trying to create a 7 day subgroup variable (with the aim that I would collapse on that) using generate and _n, but I can't get the coding for that right (it's probably blindingly obvious sorry). Thanks for any help.
-
Login or Register
- Log in with
Comment