Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: spmap myseriously dropping a category


From   Dorothy Bridges <[email protected]>
To   [email protected]
Subject   Re: st: spmap myseriously dropping a category
Date   Fri, 26 Feb 2010 13:13:35 -0500

Brilliant!  This solved the problem.  Thanks so much, Scott.

(Nick: Per your last email, I was trying (in vain) to replicate my
problem with a toy dataset ... Scott beat me to it).

Thanks again,
Dorothy

On Fri, Feb 26, 2010 at 12:57 PM, Scott Merryman
<[email protected]> wrote:
> I suspect it is due to the distribution of the var categories within
> year 1995.  The default method is quantile so I would guess the var
> was only broken into two groups.  Is you only have 3 categories
> wouldn't it be easier to use -clm(u)-?
>
> Using one of the example data sets from -spmap- compare:
>
>  use "Italy-RegionsData.dta", clear
>  keep if inrange(id, 8,13)
>  spmap zone using "Italy-RegionsCoordinates.dta"  , id(id)
>  spmap zone using "Italy-RegionsCoordinates.dta"  , id(id) clm(u)
>  replace zone = 1 in 2
>  replace zone = 3 in 5
>  spmap zone using "Italy-RegionsCoordinates.dta"  , id(id)
>
>
> Scott
>
> On Fri, Feb 26, 2010 at 11:08 AM, Dorothy Bridges <[email protected]> wrote:
>> Dear Statalist,
>>
>> Allow me to preface this inquiry with an apology: I'm sorry that I am
>> not able to replicate my problem with publicly available datasets, and
>> that therefore this question may well be annoying and unanswerable.  I
>> simply don't know where else to turn.
>>
>> I am using spmap to graph a ternary variable onto a map of the world.
>> My variable is time-series, and I would like to create one map for
>> each year.  When I create the map for 2005, or for 2000, or for 1990,
>> it appears just as I imagined it.  When I create the map for 1995,
>> though, Stata treats the first two categories as a single category.  I
>> cannot fathom why this is the case (yes, I'm sure that all three
>> levels of my variable occur in 1995).  The only difference in the
>> command line is an "if" clause.  In other words:
>>
>> spmap var using file if year==2005 works beautifully, displaying three
>> colors corresponding to the three levels of var, but
>> spmap var using file if year==1995 displays only two colors, the first
>> corresponding to levels one and two, and the second corresponding to
>> level three.
>>
>> There is nothing fancy about the variable -- it takes the values 1, 2, and 3.
>>
>> Thanks so much in advance for your thoughts.
>>
>> Dorothy
>> *
>> *   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/
>>
>
> *
> *   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/
>

*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index