Scott:

Here is a Minitab macro to obtain means and standard deviations successively.
I think it is readable even if you don't do Minitab macros. Is that what you wanted?
Where do I send my bill?

Jon Cryer

GMACRO # The data are in column C1.
Stats # The running means and standard deviations are placed in columns C2 and C3
NoEcho
NoTitle
MTitle 'Running Means and Standard Deviations'
Let K2=N(C1) # get total sample size
Name C2 'Means' C3 'StDevs'
Let C2(1)=C1(1) # initial values for mean
Let C3(1)=0 # and variance
DO K1=2:K2
Let K3=K1-1
Let C2(K1)=(1-1/K1)*C2(K3)+C1(K1)/K1 # update mean
Let C3(K1)=(1-1/K3)*C3(K3)+(C1(K1)-C2(K3))**2/K1 # update variance
EndDo
Let C3=Sqrt(C3) # get standard deviations
Print C2 C3 # print running means and standard deviations
Title
EndMacro


At 03:06 PM 1/8/2003 +0000, you wrote:
Does anyone know the formula for recursively calculating standard deviation?

Thanks in advance,

-Scott S

.
.
=================================================================
Instructions for joining and leaving this list, remarks about the
problem of INAPPROPRIATE MESSAGES, and archives are available at:
.                  http://jse.stat.ncsu.edu/                    .
=================================================================

Reply via email to