Thanks Scott. I never thought to use the merge variable.
Cameron
On May 6, 2005, at 8:39 PM, Scott Merryman wrote:
merge permno date using "C:\Documents and
Settings\Scott_2\Desktop\dates.dta"
gen type = 1 if _m == 3
replace type =1 if _m[_n + 1] == 3  _m[_n + 2] == 3 _m[_n  1] == 3 
_m[_n  2] == 3
replace type =3 if _m[_n  3] == 3  _m[_n  4] == 3  _m[_n  5] == 3

_m[_n 6] == 3  _m[_n 7] == 3
replace type =2 if _m[_n + 3] == 3  _m[_n + 4] == 3  _m[_n + 5] == 3

_m[_n +6] == 3  _m[_n +7] == 3
l in 39/57
*
* 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/