Cameron said
I tried the following (and a
number of other things):
generate fyed = mdy(12,31,year)
forvalues i = 1/11 {
if `i' <= 5 local yy = year - 1
else local yy = year
replace fyed = mdy(`i'+1,1,`yy') - 1 if fyr == `i'
}
I think this should work:
clear
set obs 100
g year= 1901+_n
g fyr = int(12*uniform())+1
g fyed = mdy(12,31,year)
replace fyed = mdy(fyr+1,1,cond(fyr<5,year-1,year)) if fyr<12
format fyed %td
Kit Baum, Boston College Economics [email protected]
http://ideas.repec.org/e/pba1.html
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/