# Standard deviation of aggregated data

KThy
This might be embarrasingly easy or impossible; I've been a computer programmer for too long since my statistics classes to tell for sure

I have a set of records with the following data for each record: interval, mean speed, standard deviation of speed, number of observations. Exempli gratia:

Code:
1, 77.2, 1.75, 10
2, 75.9, 2.05, 12

Now, if I want to aggregate the data to get mean speed and standard deviation over two or more intervals (1 and 2 above), calculating the weighted mean is no problem but how - if possible - do I calculate the standard deviation for the aggregated intervals?

Given the std. dev. and mean, you can easily get the second moment. Combine the second moments by the same procedure you used for the means. Finally calculate the std. dev. from the weighted mean and weighted second moment.

KThy
Combine the second moments by the same procedure you used for the means. Finally calculate the std. dev. from the weighted mean and weighted second moment.

Right, of course. As I said, embarrasingly simple - thanks!

I recently encountered a similar problem at work.

However, for me the problem is that some of the intervals used for measuring average speed are different lengths of time. I believe the problem is the same?

Since we consider the data to be a sample, we want the unbiased estimator for the standard deviation which takes on the following form given on wikipedia website (i derived it alone to make sure).

http://en.wikipedia.org/wiki/Mean_square_weighted_deviation

Cheers.