I have quarterly longitudinal data sets (8 consecutive quarters). I want to convert this data from quarterly to weekly.
Code:
* Example generated by -dataex-. For more info, type help dataex clear input double PERSID byte(quarter WEEK Inds07m) 10493040101 3 4 -9 10493040101 4 4 -9 10493040101 5 4 -9 10493040101 6 4 -9 10493040101 7 4 -9 10694020101 4 6 -9 10694020101 5 6 -9 10694020101 6 6 -9 10694020101 7 6 -9 10694020101 8 6 -9 10694020102 4 6 -9 10694020102 5 6 -9 10694020102 6 6 -9 10694020102 7 6 -9 10694020102 8 6 -9 10792030101 2 7 -9 10792030101 3 7 -9 10792030101 4 7 -9 10792030101 5 7 -9 10792030101 6 7 -9 10793010101 3 7 15 10793010101 4 7 15 10793010101 5 7 15 10793010101 6 7 15 10793010101 7 7 15 10794010101 4 7 9 10794010101 5 7 9 10794010101 6 7 9 10794010101 7 7 9 10794010101 8 7 9 10794010102 4 7 9 10794010102 5 7 9 10794010102 6 7 9 10794010102 7 7 9 10794010102 8 7 9 10993020101 3 9 16 10993020101 4 9 16 10993020101 5 9 16 10993020101 6 9 16 10993020101 7 9 -9 10993020102 3 9 15 10993020102 4 9 15 10993020102 5 9 15 10993020102 6 9 15 10993020102 7 9 15 11091010101 1 10 16 11091010101 2 10 16 11091010101 3 10 16 11091010101 4 10 16 11091010101 5 10 16 11093030101 3 10 -9 11093030101 4 10 -9 11093030101 5 10 -9 11093030101 6 10 -9 11093030101 7 10 -9 11094010101 4 10 15 11094010101 5 10 -9 11094010101 6 10 -9 11094010101 7 10 -9 11094010101 8 10 -9 11094010102 4 10 17 11094010102 5 10 17 11094010102 6 10 17 11094010102 7 10 17 11094010102 8 10 17 11291020101 1 12 -9 11291020101 2 12 -9 11291020101 3 12 -9 11291020101 4 12 -9 11291020101 5 12 -9 11292020101 2 12 7 11292020101 3 12 7 11292020101 4 12 7 11292020101 5 12 7 11292020101 6 12 7 11294030101 4 12 15 11294030101 5 12 15 11294030101 6 12 15 11294030101 7 12 15 11294030101 8 12 15 11294030102 4 12 -9 11294030102 5 12 -9 11294030102 6 12 -9 11294030102 7 12 -9 11294030102 8 12 -9 20191020101 1 1 16 20191020101 2 1 16 20191020101 3 1 16 20191020101 4 1 16 20191020101 5 1 16 20191020102 1 1 7 20191020102 2 1 7 20191020102 3 1 7 20191020102 4 1 7 20191020102 5 1 7 20191040101 1 1 19 20191040101 2 1 19 20191040101 3 1 19 20191040101 4 1 19 20191040101 5 1 19 end label values quarter quarter label def quarter 1 "Jan-Mar 2019", modify label def quarter 2 "April-June 2019", modify label def quarter 3 "July-Sep 2019", modify label def quarter 4 "Oct-Des 2019", modify label def quarter 5 "Jan-Mar 2020", modify label def quarter 6 "April-June 2020", modify label def quarter 7 "July-Sep 2020", modify label def quarter 8 "Oct-Des 2020", modify label values WEEK WEEK label values Inds07m Inds07m5 label def Inds07m5 -9 "Does not apply", modify label def Inds07m5 7 "Wholesale And Retail Trade; Repair Of Motor Vehicles And Motorcycles", modify label def Inds07m5 9 "Accommodation And Food Service Activities", modify label def Inds07m5 15 "Public admin and defence", modify label def Inds07m5 16 "Education", modify label def Inds07m5 17 "Human Health And Social Work Activities", modify label def Inds07m5 19 "Other service activities", modify
I have the variable "WEEK" in my data. There are 13 weeks in each quarter, and this variable identifies which week in the quarter the interview took place.
I want to convert it to a weekly basis so that the variable "week" represents the week, month and year. Could we do it this way?
Note that the numbers of weeks are repetitive in all quarters.
0 Response to Converted datasets to weekly
Post a Comment