Folks,
I'm just getting started with STATA and am trying to
get the IF command to select using multiple
catagories.
The 'do' file below is supposed to keep cases in which
one (or more) of the eligibility conditions applies:
poverty rate (pov_rate) >= national average plus 1
point (nat_avg)
OR
unemployment rate (ue_rate) >= national average
(ue_rate)
OR
1 year change in unemployment rate (ue_chg) as long as
the resulting unemployment rate is > the national
average.
When I run this against known datasets, it fails to
drop the appropriate observations.
Am I overlooking something obvious?
Here's the code:
use "C:\Documents and Settings\wkittredge\My
Documents\SACI STATA\book4.dta", clear
gen nat_pov = .106
gen nat_ue = .052
gen pov_rate = ncollpov/ncolpovu
gen ue_rate = bls_unempl_rate_04
gen ue_chg = bls_unempl_rate_04 - bls_unempl_rate_03
order pov_rate ue_rate ue_chg nat_pov nat_ue cdbgname
rgn state
keep if pov_rate >=(nat_pov+.01)|ue_rate>=
(nat_ue+.01)|ue_chg>=.4 & ue_rate>nat_ue
list pov_rate ue_rate ue_chg cdbgname state, clean
Thanks,
Bill Kittredge
William P. Kittredge, Ph.D.
Research Director
Center for the Study of Capital Markets and Democracy
voice: 571-344-5034
email: [email protected]
http://capitalmarketscenter.org/
"if to do were as easy as to know what were good to do,
chapels had been churches and poor men's cottages princes' palaces"
*
* 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/