Cross Validated is a question and answer site for people interested in statistics, machine learning, data analysis, data mining, and data visualization. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

If you have a 100x100 grid of values and you want to report the standard deviation of an area that takes up a 20x20 portion of the grid, this is not problem. But what is the correct way to calculate the standard deviation of the 20x20 area if all the values in the 100x100 grid are themselves averages and therefore also have an associated (common) standard deviation?

I haven't dealt with such a spatial statistics problem for a while and I think I have forgotten some terminology...

share|improve this question
Yes I don't know what you are talking about. What is the random quantity that you are computing the stanard deviation for? I don't even see what it is in the case of the 20x20 portion of the gtid where you claim there is no difficulty computing the standard deviation. – Michael Chernick Sep 28 '12 at 2:43
As a general policy, when you've forgotten (or don't know) terminology, I find it best to explain your question in terms that are as simple as possible. With many of my clients, my first goal is to get them to explain their question in simple, substantive terms. Then I can (often) figure out the statistics. – Peter Flom Sep 28 '12 at 10:22

The fact that it is spacial data doesn't matter. But to correctly calculate the standard deviation of a collection of values which are, themselves, averages, you also need two other numbers for each of those values: the number of measurements which were averaged to produce each (average) value, and the standard deviation of those measurements.

So each point on the grid must have, not just one, but three numbers associated with it: the mean (the value which is the average of the measurements at that grid point), the number of measurements that were averaged to calculate that mean, and the standard deviation of those measurements. Thus, for a 20x20 grid (400 grid points) you'll have 400 averages, 400 standard deviations, and 400 sample counts.

If you have that, then you can exactly calculate the combined/composite mean and standard deviation for the whole set of 400 grid points. This web page describes how to do it, and why it works; it also includes source code in Perl and Python:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.