I obtain the following strange results using the date function -monthly-:
Code:
. list, sep(0)
+----------+
| Tempob~e |
|----------|
1. | 1947-01 |
2. | 1947-04 |
3. | 1947-07 |
4. | 1947-10 |
5. | 1948-01 |
6. | 1948-04 |
7. | 1948-07 |
+----------+
. gen monthlydate = monthly( Tempobservation_date, "YM")
. format monthlydate %tm
. gen Tempobservation_date2 = subinstr( Tempobservation_date, "-","",_N)
. gen monthlydate2 = monthly( Tempobservation_date2, "YM")
(7 missing values generated)
. list, sep(0)
+-------------------------------------------+
| Tempob~e monthl~e Tempob~2 monthl~2 |
|-------------------------------------------|
1. | 1947-01 1947m1 194701 . |
2. | 1947-04 1947m4 194704 . |
3. | 1947-07 1947m7 194707 . |
4. | 1947-10 1947m10 194710 . |
5. | 1948-01 1948m1 194801 . |
6. | 1948-04 1948m4 194804 . |
7. | 1948-07 1948m7 194807 . |
+-------------------------------------------+
monthly(s1,s2[,Y])
Description: the e_m monthly date (months since 1960m1) corresponding to s1 based on s2 and Y; Y specifies topyear; see date()
Domain s1: strings
Domain s2: strings "MY" and "YM"; Y may be prefixed with ##
Domain Y: integers 1000 to 9998 (but probably 2001 to 2099)
Range: %tm dates 0100m1 to 9999m12 (integers -22,320 to 96,479) or missing
Description: the e_m monthly date (months since 1960m1) corresponding to s1 based on s2 and Y; Y specifies topyear; see date()
Domain s1: strings
Domain s2: strings "MY" and "YM"; Y may be prefixed with ##
Domain Y: integers 1000 to 9998 (but probably 2001 to 2099)
Range: %tm dates 0100m1 to 9999m12 (integers -22,320 to 96,479) or missing
0 Response to A buggy explanation in the help for -monthly-. -monthly- fails where according to help is supposed to work,
Post a Comment