Hi,
I am attempting to create dummy variables for each day of the week. I am using the following code:
gen day = 1 if (dow(A) == 1)
replace day = 2 if (dow(A) ==2)
replace day = 3 if (dow(A) ==3)
replace day = 4 if (dow(A) ==4)
replace day = 5 if (dow(A) ==5)
replace day = 6 if (dow(A) ==6)
replace day = 7 if (dow(A) ==7)
label define day 1 “Monday” 2 “Tuesday” 3 “Wednesday” 4 “Thursday” 5 “Friday” 6 “Saturday” 7 “Sunday”
label value day day
I am using this as my time series data gives numerical dates e.g. 1/01/2004 instead of the day and month written out. I want to account for the seasonality of my data but when I use this code it gives me missing values (a dash) for all days that are sunday. Is there something wrong with the code?
I am attempting to create dummy variables for each day of the week. I am using the following code:
gen day = 1 if (dow(A) == 1)
replace day = 2 if (dow(A) ==2)
replace day = 3 if (dow(A) ==3)
replace day = 4 if (dow(A) ==4)
replace day = 5 if (dow(A) ==5)
replace day = 6 if (dow(A) ==6)
replace day = 7 if (dow(A) ==7)
label define day 1 “Monday” 2 “Tuesday” 3 “Wednesday” 4 “Thursday” 5 “Friday” 6 “Saturday” 7 “Sunday”
label value day day
I am using this as my time series data gives numerical dates e.g. 1/01/2004 instead of the day and month written out. I want to account for the seasonality of my data but when I use this code it gives me missing values (a dash) for all days that are sunday. Is there something wrong with the code?
Comment