Skip to content

Factor Analysis using R and grass

3 messages · Brian Cooper, Agustin Lobo

#
Thanks for the response; the data sets are centroid based with 20 to 30
variables per centroid. What has been suggested will work with rasters but
not with vectors. What I need to know it is possible to conduct a PCA on
vector data sets and store the results as additional variables. I am
interested in the impact of the nearest neighbour on the particular score. I
work with human services planning data and am looking at developing more
effective measures for local area planning. Theoretically speaking a
geo-statistical approach will give a truer result that current aspatial
approaches.

Brian Cooper

-----Original Message-----
From: r-sig-geo-bounces at stat.math.ethz.ch
[mailto:r-sig-geo-bounces at stat.math.ethz.ch] On Behalf Of Brian Cooper
Sent: Thursday, 26 March 2009 12:27 AM
To: r-sig-geo at stat.math.ethz.ch
Subject: [R-sig-Geo] Factor Analysis using R and grass

I am new to both R and Grass. I need to duplicate the Principal Component
Analysis approach used in SPSS with GRASS and R. Is this possible?
 
brian Cooper


_______________________________________________
R-sig-Geo mailing list
R-sig-Geo at stat.math.ethz.ch
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
#
Brian,

PCA does not care about raster or vector. All you need is
a table of individuals x variables. Whether you get that
from a vector or a raster does not matter at all. Instead,
you must be careful with what your data mean. In particular,
you mention centroids. If those are centroids of polygons
which do not have the same area and your centroid
is the mean of a surface-dependent variable
, you must be aware of the fact
the PCA of A and B below is not the same (B has the first row of A 3 
times, the second once
and the third 5, i.e the area of the 3 polygons would be 3, 1, 5 units)

 > A
[,1] [,2] [,3] [,4]
[1,] 0.7142542 2.4097913 0.36845987 -0.08292664
[2,] -0.1718578 -1.2655390 -0.01597638 -0.51156564
[3,] 0.3774107 -0.4042545 0.35403702 -1.01637522
 > B
[,1] [,2] [,3] [,4]
[1,] 0.7142542 2.409791 0.36845987 -0.08292664
[2,] 0.7142542 2.409791 0.36845987 -0.08292664
[3,] 0.7142542 2.409791 0.36845987 -0.08292664
[4,] -0.1718578 -1.265539 -0.01597638 -0.51156564
[5,] 0.7142542 2.409791 0.36845987 -0.08292664
[6,] 0.7142542 2.409791 0.36845987 -0.08292664
[7,] 0.7142542 2.409791 0.36845987 -0.08292664
[8,] 0.7142542 2.409791 0.36845987 -0.08292664
[9,] 0.7142542 2.409791 0.36845987 -0.08292664

Also, note that PCA is not spatial at all.

Agus
Brian Cooper wrote: