Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
"Lynn Lee" <firstname.lastname@example.org>
Sat, 22 Sep 2012 19:24:31 +0800
Thank Prof. Pisati and Prof. Cox. I really appreciate for your reply and
very helpful suggestion.
Prof. Pisati, if I want to label two variables on the map, for example, one
is region's name, another is region's GDP, is it possible? I tried to put
label(GDP) in label() option, the command was wrong. Could you please give
me some suggestion? I appreciate.
[mailto:email@example.com] On Behalf Of Maurizio Pisati
Sent: Saturday, September 22, 2012 7:10 PM
Subject: Re: st: spmap
I apologize for not being more explicit. In my example x is just a dummy
variable, i.e., a variable I created to exemplify the procedure you were
looking for. In your case, x should be created by yourself according to your
needs, assigning value 0 to polygons you want to represent as "white", and
value 1 to those you want to represent as "green". For instance, suppose
your dataset includes 10 regions; regions 1, 3, 6, 8 are "white" (value 0),
while the remaining regions are "green" (value 1). To create the new
variable x, you might run the following command:
. generate x = 1 - inlist(id,1,3,6,8)
where -id- is an existing variable that uniquely identifies regions.
Il giorno 22/set/2012, alle ore 12.40, Lynn Lee ha scritto:
> Dear Prof. Pisati,
> The -spmap- I used is the program written by you.
> I appreciate for your reply. I still have one more question. It looks
> like command "generate x = runiform()>0.5" assigns 0 or 1 randomly to
> each region. I tried the command you suggested, but there are other
> regions(not the region I want to color) also have the values fall into
> the range of "<0.5". How to exclude them? If I want to choose the
> region I want(not
> randomly) and to color them, how to do that?
> I appreciate for your help.
> Best Regards,
> Lynn Lee
> -----Original Message-----
> From: firstname.lastname@example.org
> [mailto:email@example.com] On Behalf Of Maurizio
> Sent: Saturday, September 22, 2012 3:17 PM
> To: firstname.lastname@example.org
> Subject: Re: st: spmap
> Dear Lynn,
> the following example, using datasets distributed with -spmap-, might
> be of help for drawing the map you're looking for:
> . use "Italy-RegionsData.dta", clear
> . generate x = runiform()>0.5
> . spmap x using "Italy-RegionsCoordinates.dta", id(id) ///
> clmethod(unique) fcolor(white green) ///
> label(label(region) xcoord(xcoord) ycoord(ycoord) ///
> size(*.6) pos(0) angle(50))
> Best wishes,
> Il giorno 22/set/2012, alle ore 08.42, Lynn Lee ha scritto:
>> Dear all,
>> I am now using -spmap- drawing map. When I write the following commad:
>> spmap x using " map.dta", ///
>> id(id) label(label(ename) ///
>> xcoord(x_coord) ycoord(y_coord) size(*.6) ///
>> pos(0) angle(50))
>> The Stata11 generates the map and automatically color every region on
>> the map.
>> So, I use "fcolor(white)" to set base map color to be white. But I
>> only want to color several regions(not every region) on the map to be
>> green. Which command is useful?
>> Any suggestion is appreciated.
>> Best Regards,
>> Lynn Lee
* For searches and help try:
* For searches and help try: