I have variables for the year, the quarter (taking values from 1 to 4), and the week (taking values from 1 to 12 within the quarter).
I want to create a date variable with the format yearquarterweek (e.g., 2012q1w1) noting that q will be from 1 to 4 and w will be from 1 to 12 within the quarter.
I also have a date variable daymonthyear (e.g., 12nov2015). I tried
Code:
gen weekly_date = wofd(date) format weekly_date %tw
I look forward to getting some help
Thanks
0 Response to Constructing weekly date when the weeks are determined
Post a Comment