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

st: RE: Foreach Loop with anovaplot

From   "Nick Cox" <>
To   "Nick Cox" <>, <>
Subject   st: RE: Foreach Loop with anovaplot
Date   Thu, 1 Oct 2009 19:26:46 +0100

An extra comment is that by suppressing the data -- ms(none)- -- you are
losing much of the potential value of the plot. Regression people who
leave the data off a scatter plot showing a regression line are usually
regarded as missing the plot (so to speak). Why are ANOVA people allowed
to get away with it? 


-----Original Message-----
From: Nick Cox 
Sent: 01 October 2009 18:31
To: ''
Subject: RE: Foreach Loop with anovaplot

-anovaplot- is a user-written command from SJ 4-4. Please remember to
say, as requested in the FAQ, whenever you are using a user-written
command and where it comes from. 

The error message indicates what the help for -anovaplot- explains: 

"With the second syntax [that used here: NJC], a varlist is supplied,
which must be a permutation of the predictors previously used."

So, the short answer is: Make sure your call to -anovaplot- is legal. 

I don't know, however, why you are using this second syntax at all. As
your loop is over 

anova <something> exam_nb clinic 

a call to -anovaplot- without specifying any variables at all would seem
to be what you want, i.e. -anovaplot-'s first syntax. 


Diego Bellavia

I am trying to build a simple script to loop into
some ANOVA for repeated measures tests and
graph them with anovaplot.

The script is the following:

#delimit ;

foreach X of varlist  age blood_p cholesterol...

anova  `X' exam_nb clinic, repeated(exam_nb);
anovaplot exam_nb, scatter(msym(none));


#delimit cr

Where of course clinic is the ID of the subject, and exam_nb the ID of
single observation.
When  I run it as a command everything works fine but as soon as I put
in a .do file, I see the following message:

"exam_nb not a permutation of exam_nb clinic"

that  makes  sense to me but when I try to add clinic in the anovaplot
command I get some weird graph I cannot understand...

*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index