You don't need to generate a year variable. You already have one in date3. This is evident from your own listing.
Moreover, date2 is just the day of the month 1 to 31 and not at all a daily date. This is also evident from your own listing.
yofd(date2) will just map date2 interpreted as daily dates into a year, and as all the daily dates are no greater than 31, all the results are in (January) 1960, and so the year is returned as 1960, always, which is nonsense. In your data example it should clearly be 2006.
Reading
is essential to understand how dates are handled in Stata
Conversely, I can't follow why it is interesting or useful to calculate the logit of R-square.
Moreover, date2 is just the day of the month 1 to 31 and not at all a daily date. This is also evident from your own listing.
yofd(date2) will just map date2 interpreted as daily dates into a year, and as all the daily dates are no greater than 31, all the results are in (January) 1960, and so the year is returned as 1960, always, which is nonsense. In your data example it should clearly be 2006.
Reading
Code:
help datetime
Conversely, I can't follow why it is interesting or useful to calculate the logit of R-square.
Comment