Statalist


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

st: Foreach Loop with anovaplot


From   Diego Bellavia <[email protected]>
To   [email protected]
Subject   st: Foreach Loop with anovaplot
Date   Thu, 01 Oct 2009 10:00:13 -0700

Dear Statalisters,

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 the
single observation.
When  I run it as a command everything works fine but as soon as I put this
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...

Might you help in this ?

Thank you in advance,

Diego

*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index