Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Re: using "keep if"


From   "Vitorino, Maria Ana" <mvitorin@chicagobooth.edu>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Re: using "keep if"
Date   Thu, 02 Apr 2009 19:38:46 -0500

Title: Re: st: Re: using "keep if"

Dear Martin,
Thanks for your reply.
I'm not sure why that is...but it seems to be working now!!
Thanks again,
Ana


On Apr 2, 2009, at 7:15 PM, Martin Weiss wrote:

<>
This example from the help file works, even though it does not make too much
sense. I have Version 1.2.0 - 14 March 2008

****
use "Italy-OutlineData.dta", clear
spmap using "Italy-OutlineCoordinates.dta", id(id)
label(data("Italy-RegionsData.dta") select(keep if id<3 & id>1)
xcoord(xcoord)  ycoord(ycoord) label(relig1) color(white) size(*0.7))
****

-set trace on- to find the spot where Stata issues the error and report back
to the list...


HTH
Martin
_______________________
----- Original Message -----
From: Vitorino, Maria Ana
To: statalist@hsphsun2.harvard.edu
Sent: Friday, April 03, 2009 12:36 AM
Subject: st: using "keep if"


Hi,
I am trying to use "keep if" to trim down the data that I want to use to
label some observations on a plot.

Using "keep if" in the following command line seems to work:

spmap using "uscounty.dta" if state=="42", id(_ID) cln(2) ocolor(gs12 gs12)
fcolor(white white) legend(off) label(data ("coord.dta") select(keep if
batch <3) y(lati) x(longi)
label(batch) ) title("Big Foot Sightings in Pennsylvania")

BUT, if I try to do the following:
...label(data ("coord.dta") select(keep if batch >3 & batch<6) y(lati)
x(longi)...

I get an "invalid syntax" error...

How can I use the keep command with 2 conditioning statements?

Any suggestions are appreciated.
Thanks!
Ana

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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