I have used a simple forvalues loop for this, but my problem is how to get the standard values into the loop. My crude and inefficient solution is to add standard values to the dataset, calculate their mean value, and then use this as the reference.
set more off
forvalues i=1/7{
di "`: label (sys) `i''"
qui{
su ts if sys==`i'
local tsm=r(mean)
}
ttest m=`tsm' if sys==`i'
stripplot m if sys==`i',over(bn) vert bar stack separate(set) title("`: label (sys) `i''") yline(`tsm')
}
set more on
Is there a straight forward method of getting these standard values into the loop? Eventually there will be in excess of 100 systems.
Many thanks,
Martyn
*
* 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/