# How to analyse point data as covariate for areal data

I have two data sets:

a) a set of polygons with areal data variables.
b) point measures of various co-variates of interest (note I do not necessarily have a point for each polygon)

How do I correctly analyse this data set for correlations between an areal variable (dependent variable) and point measures (independent variable)?

Unsure what techniques I need to use. Working in R.

Edit on 7 July 2014:

What I'm really wondering is - if you have areal data i.e. some variable that depends on an area and not points - so something related to population density for example - and you want to analyze that versus a point measurement - rainfall at specific measurement points for example. What is the correct/best way to do this ? I've thought about it since and I see two approaches: 1) Krige the point data and get an average value for each polygon (I presume by picking multiple sample points within the polygon and getting an average) - then build polygon based models using the kriged estimates as covariates. 2) Treat the areal data as point estimates of a field taking the centroid of each polygon as the location for each point estimate, then build a geostatistical model using all data as point estimates. Both these approaches strike me as "incorrect" - what I'm asking really is which is least "incorrect" ?

For future reference, you likely did not get a previous response because your question was lacking adequate detail and a reproducible example. Often, folks like to see what your data looks like and what you have already tried.

If I understand you correctly, all you want is correlation between the attributes in a polygon and point feature class. You can relate the data using over() and then calculate a simple correlation matrix on the results.

``````require(sp)
require(rgeos)

######################################################################
# Create example data using meuse data in sp
data(meuse)
coordinates(meuse) <- ~x+y

# Create polygon buffers, perturb data and subsample to
#   create unequal problem
polys <- gBuffer(meuse, byid=TRUE, width=runif(nrow(meuse),30,100))
polys@data <- data.frame( V1=polys@data[,1]*runif(nrow(polys)),
V2=polys@data[,2]*runif(nrow(polys))^2,
V3=polys@data[,3]**2)
polys <- polys[sample(nrow(polys),100),]
######################################################################

# Use over to associated attrubutes spatially and then remove NA's
( cor.data <- data.frame(over(meuse, polys), meuse@data[,1:3]) )
cor.data <- na.omit(cor.data)

# Create and plot correlation matrix
cor(cor.data)
pairs(cor.data)
``````
• I believe there are important complications related to the very meaning of a "correlation." How is a "correlation" to be interpreted (and calculated) when different numbers of points correspond to each polygon (and, as stated in the question, sometimes no points correspond to polygons)? An answer that might be useful for one kind of data (e.g., to block krige polygon values from points that sample a continuous quantity) could be nonsense for another kind (e.g., locations of discrete objects like archaeological sites, or egg counts in bird nests, etc). – whuber May 19 '14 at 14:22
• I completely agree. However, I was just answering the question at-hand and, for once, not offering any additional commentary on the tractability of the analysis. – Jeffrey Evans May 19 '14 at 16:11
• Thanks. I was prompted to post my comment because it's not evident what the question at hand even is! (Exactly as you intimate at the beginning of your answer...) A definite answer to a vague question is fine provided it clearly specifies how it interprets the question. Otherwise, it can be counterproductive because people who read the question differently might end up employing an invalid analysis in their situation. But I'm still not sure what you really mean by "correlation between the attributes in a polygon and point feature class" and was hoping you could make that more clear. – whuber May 19 '14 at 16:33
• Depending on the analysis goals, this strikes me as a potential instance of pseudoreplication and could also be effected by aggregation issues that would result in a change of support problem. Whereas, there is a tractable coding solution, I would by no means draw inference from the results. – Jeffrey Evans May 19 '14 at 16:39
• Apologies all I did not realise this question was getting any answers/comments. The reason I did not supply reproducible example is because it was more of a theoretical question for data I don't have my hands on yet. And it is more the theoretical approach I am wondering about than the implementation. Perhaps it is a bad place for this question. @JeffreyEvans - thanks for your suggestion but this is not what I was looking - I'm familiar with the over() command already. I've edited the question above to make my query clearer. – unsure.person Jul 7 '14 at 9:58