Calculate weighted estimated variance

128 Views Asked by At

Hello I have to calculate the estimated variance between 3 samples

Here is an example

      SP1  SP2   SP3
ni    20   30    46
Meani 67   56    90
Si^2  12.3 23.2  11.2

I know how to calculate the weighted average by doing :

67*21+56*20+90*46/(20+30+46)

But how to calculate the estimated weighted variance ?

I guess we should first calculate the corrected variance such as S^2 * (n/n-1) :

12.3*(20/19)=12.94737
23.2*(30/29)=24
11.2*(46/45)=11.44889

and then do as for mean

12.94737*20+24*30+11.44889*46/(20+30+46)

But I'm not sure it is correct.

1

There are 1 best solutions below

5
On BEST ANSWER

First of all, it is an unfortunate consequence of the way Math.SE has changed the language of flagged duplicate questions that causes those who submitted the question to think that the flag is only a suggestion; i.e. the phrase

Does this answer your question

is in this case not an opportunity for you to disagree. It is a canned reply that I have no control over, when the reality is that it absolutely and certainly does answer your question, and if you do not think it does, you have not studied what the answer says. I am the author of that answer. I know what it says because I wrote it. And I am telling you that it answers your question, which I will now proceed to demonstrate.

Your table of summary statistics is $$\begin{array}{c|ccc} & SP1 & SP2 & SP3 \\ \hline n_i & 20 & 30 & 46 \\ \bar x_i & 67 & 56 & 90 \\ s_i^2 & 12.3 & 23.2 & 11.2 \\ \end{array}$$

Using the formula $$\bar z = \frac{n \bar x + m \bar y}{n + m}$$ adapted to your notation on $i = 1, 2$, we have $$\bar x_{1,2} = \frac{n_1 \bar x_1 + n_2 \bar x_2}{n_1 + n_2} = \frac{20(67)+30(56)}{20+30} = \frac{302}{5}.$$

Using the formula $$s_z^2 = \frac{(n-1) s_x^2 + (m-1) s_y^2}{n+m-1} + \frac{nm(\bar x - \bar y)^2}{(n+m)(n+m-1)},$$ also adapted to your notation, we have $$\begin{align*} s_{1,2}^2 &= \frac{(n_1 - 1) s_1^2 + (n_2 - 1) s_2^2}{n_1 + n_2 - 1} + \frac{n_1 n_2(\bar x_1 - \bar x_2)^2}{(n_1 + n_2)(n_1 + n_2 - 1)} \\ &= \frac{19(12.3) + 29(23.2)}{20 + 30 - 1} + \frac{20(30)(67 - 56)^2}{(20 + 30)(20 + 30 - 1)} \\ &= 48.1327. \end{align*}$$ Therefore, we have combined the mean and variance for $SP1$ and $SP2$. Now we repeat the process to combine $SP(1,2)$ with $SP3$. This I leave as an exercise.