I have two raster maps that are the output of the same model (they describe the same variable) but ran with different parameters and I would like to assess if there is a statistically significance change in the two maps. How could I do that applying a statistical test and mapping also the pixels where the differences are statistically significant, like it is shown on the map below: https://phys.org/news/2016-03-raincloud-climate.html

I would like to do this in r. Thus far, I have tried to turn my two rasters as data frames and then calculate perform the wilcoxon test or a chisq test, but that results to getting simply the values of the test, such as "df" and "p-value". How could I produce a map such as the one displayed in the link above?

1 Answer 1


You can only make statements about statistically significant difference if you have a statistical model for your measurements. So the usual test of whether 10 year old boys are taller than 10 year old girls via a t-test is based on a model of boys and girls having a normally distributed height with either equal or different variances and the test is whether the means are different, and also that the boys and girls are independent samples from those normal distributions. If you compared four random boys with four girls from the same family you've violated that independence assumption because those four girls are likely to be more similar in height than a random four girls (because they've had the same nutrition, perhaps).

So, you have two model outputs, Z1 and Z2, say. Unless you have a statistical model for the means and variances of Z1 and Z2, you can't say anything about whether any part of |Z1-Z2| is "statistically significant".

If Z1 and Z2 are outputs from a deterministic model, so that if you ran the model again with the same parameters you'd get the same outputs (like a climate simulation) then there's no statistics involved, and no statistical model, and you can just present |Z1-Z2| as the difference. How likely any difference is will depend on how well you can argue for the differences in your input parameters (eg "We are 90% sure CO2 will be between X1 and X2, so here's a 90% certain difference in resulting Z1 and Z2"). I think this is what's done in the analysis you've linked to.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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