Dear all. I am trying to create two date variable whose day and month components will be constant, and the year will be different for each observation depending on the year listed in another 2 variables called start_year and end_year . Specifically, I want to create two variables fix_dec which should be of the format 31dec (start_year) and fix_jan will be of the format 01jan(end_year). I tried working with the code below, but I am not getting any results. Thanks again!
. gen fix_dec = mdy(31, 12, start_year, "MDY") invalid syntax r(198); . dataex start_year end_year ----------------------- copy starting from the next line -----------------------
. gen fix_dec = mdy(31, 12, start_year, "MDY") invalid syntax r(198); . dataex start_year end_year ----------------------- copy starting from the next line -----------------------
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float(start_year end_year) 1972 1990 1975 1987 1975 1976 1975 1983 1977 1999 end
Comment