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

st: Re: Loop programming

From   "Sherriff, Martyn" <>
To   "''" <>
Subject   st: Re: Loop programming
Date   Thu, 7 May 2009 12:10:27 +0100

	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''"
		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,


*   For searches and help try:

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