Hello,
I have a date variable in the "YYYY.MM" format (e.g., "1990.01" for January 1990). Is there a function that can create a Stata variable in the "%tm" format for me? I've attempted to use the "date()" function, but it doesn't seem to meet my requirements. Thank you!
Here's what I've tried:
```stata
gen ym_date = date(Data, "Y.M")
```
However, it's not producing the desired result.
```
Data
1990.01
1990.02
1990.03
1990.04
1990.05
1990.06
1990.07
1990.08
1990.09
1990.10
1990.11
1990.12
1991.01
1991.02
1991.03
1991.04
1991.05
I have a date variable in the "YYYY.MM" format (e.g., "1990.01" for January 1990). Is there a function that can create a Stata variable in the "%tm" format for me? I've attempted to use the "date()" function, but it doesn't seem to meet my requirements. Thank you!
Here's what I've tried:
```stata
gen ym_date = date(Data, "Y.M")
```
However, it's not producing the desired result.
```
Data
1990.01
1990.02
1990.03
1990.04
1990.05
1990.06
1990.07
1990.08
1990.09
1990.10
1990.11
1990.12
1991.01
1991.02
1991.03
1991.04
1991.05
Comment