Efficiently find the group with largest effect on standard deviation I have some "groups" of measurements with varying numbers of items, for example:
 Group 1: { 1.2, 1.3, 1.4, 1.1 }
 Group 2: { 2 }
 Group 3: { 2.1, 1.2 }
 etc ...

(Any single item within a group I'll refer to as a measurement).
I'd like to find the group with the largest adverse effect on the standard deviation of all the measurements.  My current approach is the following:

*

*Find the standard deviation of all measurements

*Remove a single group

*Find standard deviation with all measurements except those in the removed group

*Return the removed group

*Repeat steps 2 through 4 for each group

*Report the removal that caused largest reduction to the standard deviation

This approach works for what I'm doing, but it's very computationally expensive.
I'd like to know if there is a more efficient way of calculating which group will have the largest adverse effect.  My first guess is maybe a weighted average would work, but I don't have a ton of faith in my guess.
EDIT:
Second, more educated guess (based on the actual formula for standard deviation): For each group: Sum of (measurement - mean_of_all)^2

Let your overall sample be $y_1, y_2,\dots,y_n,$ and let
$$\overline{y}=\frac1n\sum_{i=1}^ny_i$$
be the overall sample mean. Partition the sample into $m$ subgroups, which we will denote by $y_{g_i}.$ Now the variance for the entire sample is given by
$$\frac{1}{n-1}\sum_{i=1}^n(y_i-\overline{y})^2.$$
We can also write this as
$$\frac{1}{n-1}\!\left[\sum_{j=1}^m\left(\sum_{i=1}^{n_j}(y_{g_i}-\overline{y})^2\right)\right]$$
To find which subgroup contributes the most to this variance, simply form the sums
$$\sum_{j=1}^{n_i}(y_{g_j}-\overline{y})^2$$
for each subgroup and rank the subgroups by the results.
