Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: RE: [Stata 8] Merge question


From   Cameron Hooper <[email protected]>
To   [email protected]
Subject   Re: st: RE: [Stata 8] Merge question
Date   Sat, 7 May 2005 00:56:34 -0400

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/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index