Finding correlation coefficient using moving window

Discussion created by taejnkwon on Dec 21, 2012


I am trying to calculate correlation coefficient for each cell and all cells by taking the neighbouring grids into account. For example, in the attached image, the black rectangle could be a moving window and the black dot contains a grid that correlation coefficient (possibly pearson) should be determined by considering all the neighbouring grids within the black rectangle. So the center grid would have a correlation coefficient. When there is just one neighbouring grid, then the correlation should be determined by taking only that grid.. Note that each grid contains a certain values... Please advise if there is any way to do this for all grids... Sorry I am not family with VBA.. if there is any script available it would be nice.. Any help would be greatly appreciated.