Skip to content

Factor Analysis using R and grass

3 messages · Tomislav Hengl, Dylan Beaudette, Agustin Lobo

#
Hi Brian,

The PCA you can also run without GRASS e.g.:
If you have missing pixels or if you use a max, then you will need to select the generated
components before you can reproduce the maps.

See also: http://spatial-analyst.net/wiki/index.php?title=Analysis_of_DEMs_in_R%2BILWIS/SAGA 

HTH

Tom Hengl
http://spatial-analyst.net 



-----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: Wednesday, March 25, 2009 2:27 PM
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
#
Hi,

Alternatively, if you must use all of the pixels in a massive grid, you can do 
PCA in GRASS with the i.pca command. Note that you must take care of 
standardization if you are using variables with different units / scales.

Cheers,

Dylan
On Wednesday 25 March 2009, Tomislav Hengl wrote:

  
    
#
Note that there has recently been a lot of
traffic on this issue, visit
http://grass.osgeo.org/wiki/Principal_Component_Analysis

i.pca has given trouble since many years ago, the consensus
was rather using m.eigensystem and r.mapcalc instead.

It seems that the fact is the i.pca is equivalent
to prcomp(X,center=F) in R. Non-centered PCA is not
a common use of PCA (IMHO, pretty useless in our context),
and actually has no equivalent in princomp()

Anyway, note that if you do a random selection of, say,
5% of your pixels, save values to a table and import
to R, you can calculate the eigenvectors and then use
them in r.mapcalc to calculate the PCs. This gives you much
more control of the statistical part. You can also calculate
the covar matrix in grass, pass it to R and carry out your analysis
there. In that way you will not have to sample, but I encourage you
to test the sampling procedure.

Finally note that factor analysis and PCA are not identical.

Agus
Dylan Beaudette wrote: