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: meansdplot with if statement


From   Nick Cox <[email protected]>
To   [email protected]
Subject   Re: st: meansdplot with if statement
Date   Fri, 28 Sep 2012 00:13:38 +0100

See also

1. on -statsby- as a prelude to graphics

http://www.stata-journal.com/article.html?article=gr0045

2. -anovaplot- from

gr0009_1 from http://www.stata-journal.com/software/sj10-1
    SJ10-1 gr0009_1.  Update: Speaking Stata: Graphing model... / Update:
    Speaking Stata: Graphing model diagnostics / by Nicholas J. Cox, Durham
    University, UK / Support:  [email protected] / After installation,
    type help anovaplot, indexplot, / modeldiag, ofrtplot, ovfplot, qfrplot,


On Fri, Sep 28, 2012 at 12:06 AM, Cathy Antonakos <[email protected]> wrote:
> Many thanks, Nick. This is very helpful, in many ways.
> Cathy
>
> On Thu, Sep 27, 2012 at 6:54 PM, Nick Cox <[email protected]> wrote:
>> -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 / [email protected] / 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 <[email protected]> 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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index