# Spatial Analysis with Factors/Classifications

When doing analysis on spatial data with associated information that is numeric, it is possible to use techniques such as Kriging or Interpolation or Cluster Analysis to find out interesting relationships in your data. Then you can visualise using your choice of poison/GIS. Okay.

Now, I want to do the same type of things with spatial data that has associated non-numeric data, i.e. a "Factor" in R or a "Classification". However I cannot find techniques that allow one to do this.

Does anyone know of methods that can be used to perform this type of analysis? It would also be a bonus you know whether they can be performed in R or QGIS.

I would really love a model to do interpolation with a non-numeric attribute. The set I would use this interpolation on would be lithology or other geological data.

-
Will upvote those answers when I get my rep up. – themartinmcfly Jan 21 '13 at 14:49
I believe you can vote on answers to your own question regardless of your rep. – whuber Jan 21 '13 at 16:43
You can use kriging and cluster analysis with nominal data. See, for instance, the geoRGLM package for `R`, which supports generalized linear models of spatial data. Note, too, that although rasters internally represent data as numbers, that is no different than how `R` encodes factors and has the same intention: a so-called "integer" grid can be used to represent a spatial field of factor values (such as land use classes). All raster-based GISes have tools to support such an interpretation. – whuber Jan 21 '13 at 16:47
It's mathematically possible, but I don't think it is proper way. Lithology/geology is discrete phenomenon. If you have to do this, try to find co-variable (DEM?) and use co-kirging. Other methods are delaunay triangulation and voronoi polygons. If density of points is high, results can be good. – Landscape Analysis Jan 21 '13 at 17:38
I am not sure how to correctly treat converting factors to numbers (or letting my GIS do that for me) For example if I have "Oak"=5 and "Pine"=4 how do I interpret a point/point on raster where the value is 4.4? Or is it mathematically sound for me to round that value as it is closer to pine? – themartinmcfly Jan 21 '13 at 22:48

If you have point data you can use Point Patter Analysis (PPA) techniques, for example kernel density with various weights for points with different "Factor" or class. It will be much easier to help you, if you post specific spatial problem and write more about origin of your data.

-
Okay, thanks for the reply and technique to investigate. I am trying to gather as many as possible, as I have multiple datasets in mind (points) that I could use this on. If you would like a specific goal, I would really love a model to do interpolation with a non-numeric attribute. The set I would use this interpolation on would be lithology or other geological data. – themartinmcfly Jan 21 '13 at 14:09
I just found a set of workshop notes that has a very good section on Point Patter Analysis, if anyone wants to try it themselves. See here – themartinmcfly Jan 21 '13 at 22:52

You actually have a few options for converting point data to raster format and doing analysis on it. You can use a fishnet style tool to create a regular grid of polygons and/or points, and from there use joins to get all the data where it should be before converting to a raster with the same pixel size as the grid cells in the net. However, this can be computationally intensive and may not work for large areas. This edited (or maybe your unedited - not entirely sure what it looks like or what you want to know about it from question) vector data could also be used in statistical analysis tools that use vector data as input (most programs should be able to calculate a measure of spatial autocorrelation, clustering coefficient,etc. Off of point data although you may need to make an extra column of data containing dummy variables or assigning numbers to the basis categories in some). Another option may be to obtain a polygon file containing the political or other boundaries relevant to your project and either join the two or use a zonal statistics function on a rasterized version of your point data.Finally you could just assign numbers to each category and use one of the tools you described.

-
Thank you Jezibelle, I am looking for general solutions. I tried giving categories numbers but unfortunately that implies that the categorisations are related. It seems I need to try again convert to the dark side (rasters), which also seem to want numeral inputs. – themartinmcfly Jan 21 '13 at 14:48
You might want to take a look at done of the manuals or papers from one of the global land use datasets (Glendive – Jezibelle Jan 22 '13 at 0:03
Sorry. Globcover or one of the usgs datasets. They seem to be working on similar problems. – Jezibelle Jan 22 '13 at 0:14
Here you have some good background geodacenter.asu.edu/eslides – Landscape Analysis Jan 23 '13 at 9:55