Dear all,
I have a panel dataset where I have weekly data for several European countries. My date variable is "Weeknumber" and portrays week 11 of 2020 as: 2020, 11
My country variable is named Country and is a string variable portraying the countries name.
Example of my dataset:
How I declared my dataset to be panel data in my do-file:
// set time
gen sweek = weekly(Weeknumber, "YW")
format sweek %tw
encode Country, gen(scountry)
xtset scountry sweek
What is unfortunate, is that my time-range contains a Week 53. Stata doesn't recognise this week and leaves it blank.
I have looked up a million ways to solve this problem, however I have not managed to do it myself.
Any help is appreciated!
I have a panel dataset where I have weekly data for several European countries. My date variable is "Weeknumber" and portrays week 11 of 2020 as: 2020, 11
My country variable is named Country and is a string variable portraying the countries name.
Example of my dataset:
Country | Weeknumber | Variable X | Variable Z |
Netherlands | 2020, 11 | (value) | (value) |
Netherlands | 2020, 12 | (value) | (value) |
etc. | etc. | etc. | etc. |
// set time
gen sweek = weekly(Weeknumber, "YW")
format sweek %tw
encode Country, gen(scountry)
xtset scountry sweek
What is unfortunate, is that my time-range contains a Week 53. Stata doesn't recognise this week and leaves it blank.
I have looked up a million ways to solve this problem, however I have not managed to do it myself.
Any help is appreciated!
Comment