Hello,

My date variable (moyr) could not be used when I declared my dataset to be monthly panel data. As seen below, moyr is a string variable that is composed of YYYY-MM.

. list moyr in 1/5
+---------+
| moyr |
|---------|
1. | 2017-01 |
2. | 2017-02 |
3. | 2017-03 |
4. | 2017-04 |
5. | 2017-05 |
+---------+

Thus, I generate a new date variable by using the code: generate date = date(moyr,"YM"). However, values for the date variable are not readable.

. list moyr date in 1/5
+-----------------+
| moyr date |
|-----------------|
1. | 2017-01 20820 |
2. | 2017-02 20851 |
3. | 2017-03 20879 |
4. | 2017-04 20910 |
5. | 2017-05 20940 |
+-----------------+

Thus, I reformatted the date variable to be YYYY-MM using the code: format %tmCCYY-NN date.

. list moyr date in 1/5

+-------------------+
| moyr date |
|-------------------|
1. | 2017-01 3695-01 |
2. | 2017-02 3697-08 |
3. | 2017-03 3699-12 |
4. | 2017-04 3702-07 |
5. | 2017-05 3705-01 |
+-------------------+

However, values in the date variable are still not readable. Any advice would be greatly appreciated. Thank you.