Bookmark and Share

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]

Re: st: meansdplot with if statement


From   Nick Cox <njcoxstata@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: meansdplot with if statement
Date   Thu, 27 Sep 2012 23:54:53 +0100

-meansdplot- is a program from Phil Ender from UCLA:

meansdplot from http://www.ats.ucla.edu/stat/stata/ado/analysis
    meansdplot.  Plot mean and stendard deviation for multiple groups. /
    Philip B. Ender / Statistical Computing and Consulting / UCLA Academic
    Technology Services / ender@ucla.edu / Stata ado and hlp files in the
    package / distribution-date: 20071117

Please remember that you are asked to explain _where_ user-written
programs you refer to come from.

You have, I think, found a bug in -meansdplot-. The program accepts an
-if- qualifier [not a statement] but it only affects part of the plot
and does not affect the main calculations.

One work-around for what you want while Phil fixes the code is

forval j = 1/3 {
           preserve
           keep if group == `j'
           meansdplot var1 var2
           restore
}

-sttripplot- (SSC) and -dotplot- are other commands with broadly
similar aims. It is also always possible to -collapse- a dataset
-by()- some group variable and plot summary statistics directly.


On Thu, Sep 27, 2012 at 9:13 PM, Cathy Antonakos <cathya@umich.edu> wrote:
> Does the -meansdplot- command recognize an if statement? I issued the
> following commands and obtained the same graph for all 3 groups. Maybe
> there is an alternative way to do this, but the help suggests that if
> is operational. Thanks in advance!
>
> . meansdplot var1 var2 if group == 1
> . meansdplot var1 var2 if group == 2
> . meansdplot var1 var2 if group == 3
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index