Print

Print


Dear Christopher,

Unfortunately, still does not work:

For example two samples are:
a=[1 2 1 2 1 2]; b=[10 11 10 11 10 11];

c=[a,b] % pooled samle

std(c)
=4.7290 % standard deviation of pooled sample

std(a)

=0.5477 % standard deviation of separate samples

std(b)
=0.5477

sqrt( (5*(std(a)^2)+5*(std(b)^2) )/ 10) % "total" standard deviation
=0.5477

0.5477 is obviously less than 4.7290

g=sqrt((6*( std(a)^2+mean(a)^2) + 6*(std(b)^2 + mean(b)^2) )/12 - mean(c)^2)
g=
4.5332

Close, but not the same. Maybe there is a mistake in the code... Could you please have a look at the formula I used?

Thank you very much for you help!

Sincerely yours,
Vladimir



>________________________________
> From: "Watson, Christopher" <[log in to unmask]>
>To: Vladimir Bogdanov <[log in to unmask]>; "[log in to unmask]" <[log in to unmask]> 
>Sent: Tuesday, March 18, 2014 4:00 PM
>Subject: RE: [SPM] simple question of statistic, how to calculate total variance?
> 
>
>You can try this: http://stats.stackexchange.com/a/43183
>________________________________________
>
>From: SPM (Statistical Parametric Mapping) [[log in to unmask]] on behalf of Vladimir Bogdanov [[log in to unmask]]
>Sent: Tuesday, March 18, 2014 6:55 AM
>To: [log in to unmask]
>Subject: [SPM] simple question of statistic, how to calculate total variance?
>
>Dear SPM experts,
>
>I have a very basic question, not specific to neuroimaging.
>
>I have statistical parameters for few samples: M1, M2, M3..., SD1, SD2, SD3..., N1, N2, N3... (mean, standard deviation and the size of each sample). I dont have original data. I want to estimate total M and SD. Estimation of total mean seems easy: (M1*N1+M2*N2+M3*N3... ) N1+N2+N3...
>
>However I have a problem with total SD. With a model data sample the formula:  sqrt(  ((N1-1)*SD1^2+(N2-1)*SD2^2+(N3-1)*SD3^2) / (N1+N2+N3-3) ) does not work. Perhaps the problem is that valiance between meas (M1 M2 and M3) is not taken into account.
>
>Thank you very much for nay help!
>
>Sincerely yours,
>Vladimir
>
>