Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Question on forvalues


From   "=?UTF-8?B?5a6L5pe25q2M?=" <shigesong@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: Question on forvalues
Date   Sun, 21 May 2006 15:09:16 +0800

Dear all,

Can anybody kindly point out why the following code is not working?

	forvalues n=1989 1991 1993 1997 2000 {
		replace waglevl_f`n' = . if waglevl_f`n'<0
		replace waglevl_m`n' = . if waglevl_m`n'<0		
		}

I want to recode all negative values in waglevl_fX and waglevl_mX
where X=(1989, 1991, 1993, 1997, 2000) into missing. But I got the
error message "invalid syntax". Thanks!

Best,
Shige

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index