I used the focal sum to determine how many pixels (1s) of each landcover type occurred within the focal stats neighbourhood, not the focal mean.
I was then able to calculate the proportions by creating a new column in the attribute table, where I divided the focal sum by the total number of pixels in the neighbourhood. I added a column to compute the squared proportions as well.
I came across a new problem trying to calculate the sum of the squared proportions. I did not know you could single out a specific column in the attribute table by using the following syntax in the raster calculator:
[Output] = [Layer1].FIELD_NAME_HERE + [Layer2].FIELD_NAME_HERE + ...
I do have another question for you, Bill, regarding an old post that is now closed for replies. It was titled "Grid Correlation", from January 2006. You explained methodology for using spatial statistics and the raster calculator to determine correlation between 2 raster layers, specifically:
"Spatial Analyst can be persuaded to compute a moving window correlation grid.
To obtain consistent results around the edges, you will need an indicator grid to identify (and later count) the cells where neither of your grids and is empty. Start by computing the product grid [XY] as *. One way to produce this indicator (let's call it ) is to compute
[XY] - [XY] + 1
This will have 1's in all cells where [XY] is not null and will otherwise be null.
At this point, replace the original grid with * and replace with *.
Having done these preliminaries, compute the squares of the grids: the square [XX] equals *, and the square [YY] equals *.
The moving-window correlation grid is computed from focal means. Choose a window size and shape. Using this, compute the focal means of , , [XX], [YY], and [XY]. Let's call the resulting grids [Xm], [Ym], [XXm], [YYm], and [XYm], respectively. The correlation grid, by definition, is
([XYm] - [Xm]*[Ym]) / Sqrt(([XXm] - [Xm]*[Xm])*([YYm] - [Ym]*[Ym]))
It will have non-null values at all cells having neighborhoods where two more more cells both have non-null values of and and not all values of and in those neighborhoods are constant."
I understand everything here, I am just curious as to what type of correlation results? Is it Pearson's Correlation? I am interested in calculating correlations but there seems to be no straightforward way to do it.
Thanks!!:D