Statalist


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

Re: st: RE: old question, new solutions?


From   Austin Nichols <austinnichols@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: RE: old question, new solutions?
Date   Mon, 16 Nov 2009 13:19:23 -0500

Nick--
Do the proposed solutions offer graphing bars +/- some number of
standard deviations around the mean, rather than standard errors?  I
would think -vioplot- from SSC would be a better choice than either
what the poster requests or a boxplot, but you could also adapt this
approach for SDs:

sysuse auto, clear
levelsof rep78, loc(rs) miss
loc g
loc l
foreach r of loc rs {
 qui su mpg if rep78==`r'
 if `r'>=. {
  loc l `l' `max' "`r'"
  loc r `max'
  loc max=`max'+1
  }
 else {
  loc l `l' `r' "`r'"
  loc max=`r'+1
 }
 loc g `g'||pci `=r(mean)-2*r(sd)' `r'
 loc g `g' `=r(mean)+2*r(sd)' `r'
 loc g `g'||scatteri `=r(mean)' `r', ms(o) msize(large)
}
tw `g' leg(off) xla(`l')


On Mon, Nov 16, 2009 at 12:48 PM, Nick Cox <n.j.cox@durham.ac.uk> wrote:
> But personally I'd prefer -stripplot- from SSC. Check out its -bar-
> option.
>
> Nick
> n.j.cox@durham.ac.uk
>
> Nick Cox
>
> The official command -serrbar- does precisely this.
>
> Hoffman, George
>
> Has anyone found/written/adapted a program which will plot means +/- sd
> for observations of Y over categories X, without drawing a connecting
> line between means (as in grby)? The desired solution would be like
> 'graph box Y, over(X)' except that box would be a single symbol with
> upper and lower ranges for sd or sd. Nick cox' civplot is close, but
> doesn't allow sd's.
> I've gotten around this by using joanne garrett's 'predxat' but that
> plots se's not sd's.
>
> I understand some of the reasons why not to use this sort of display,
> but it does occasionally become useful to display data.
*
*   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