Statalist


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

Re: st: Classes in spmap


From   "Richard Ohrvall" <richard.ohrvall@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Classes in spmap
Date   Tue, 29 Apr 2008 10:27:41 +0200

Thank you both Nick and Scott for your solutions,

it solved my problem even if it was not elegant. I had not used
-clonevar- before, it seems like a valuable command.

And despite this minor problem, I have to say that spmap is a great program.

Richard

On 4/28/08, Nick Cox <n.j.cox@durham.ac.uk> wrote:
> You are not getting what you want in the case of exact matches with
> boundaries.
>
> It's not elegant, but fudging boundary cases upwards would seem to solve
> your problem.
>
> clonevar myvar2 = myvar
> replace myvar2 = myvar2 + 0.5 if inlist(myvar2, 30, 40, 45, 50, 100)
>
> Note that
>
> 1. I recommend working on a cloned version of your data _only_.
>
> 2. This will work well in your example as your boundaries are integers
> and no precision issues arise with testing for equality. It wouldn't
> work so easily with fractions.
>
> -----Original Message-----
> From: owner-statalist@hsphsun2.harvard.edu
> [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Richard
> Ohrvall
> Sent: 28 April 2008 18:05
> To: statalist@hsphsun2.harvard.edu
> Subject: Re: st: Classes in spmap
>
> Thank you for your reply,
>
> I assume you mean the other way around, i.e. to set the clbreak
> slightly smaller.
>
> Yes, that was my solution as well. But it seems a bit unpractical
> since I have to check the observations in order to know how much
> smaller I should set the breaks. It works, but I just wanted to know
> if there was an option I could use to handle this.
>
> All the best,
> Richard
>
> On 4/28/08, Scott Merryman <scott.merryman@gmail.com> wrote:
> > You could set the clbreak slightly larger and then relabel the legend
> > keys.  Something like:
> >
> > spmap var1 using "geo_kor.dta", id(id) fcolor(Greys2) clmethod(custom)
> > clbreaks(0 30.01 40.01 45.001 50.01 100) legend(symy(*2) symx(*2)
> > size(*2) position
> > (10)) legorder(lohi) legend(label(2 "0 to 30") label(3 "30 to 40" )
> > label(4 "40 to 45" )  label(5 "45 to 50" )  label(6 "50 to 100" ))
> >
> > Scott
> >
> >
> > On Mon, Apr 28, 2008 at 9:26 AM, Richard Ohrvall
> > <richard.ohrvall@gmail.com> wrote:
> > > Dear all,
> > >
> > > I am creating a map using the great user-written ado-file spmap.
> > > However, I have a small problem. I am using the following code:
> > >
> > > spmap var1 using "geo_kor.dta", id(id) fcolor(Greys2)
> clmethod(custom)
> > > clbreaks(0 30 40 45 50 100) legend(symy(*2) symx(*2) size(*2)
> position
> > > (10)) legorder(lohi)
> > >
> > > The class breaks are where I would like them, but I would like the
> > > first class to include all values up to, but not including, 30. The
> > > default is that the value 30 will be included in the first class
> > > (0-30). Is there some way to change this so that observations with
> > > value 30 on var1 will be included in the second class (30-40)? I
> have
> > > looked in the help for spmap, but I could not find any solution.
> > >
>
> *
> *   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/
>
*
*   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