[R] computing scores from a factor analysis

William Revelle lists at revelle.net
Thu Jan 19 22:53:16 CET 2012


Wolfgang, 

Since you seem to be doing this in the psych package, it would have been faster to directly ask the author (me).  Luckily, I saw the question on R-Help.
 

The principal components step is being done on the correlation matrix, not on the raw data matrix, thus, it is not able to find scores.

However, since you have the components solution, you also the scoring weights.

Taking your analysis:

> tetra <- tetrachoric (image_na, correct=TRUE)
> t_matrix <- tetra$rho
> pca.tetra <- principal(t_matrix, nfactors = 10, n.obs = nrow(image_na),
> rotate="varimax", scores=FALSE)

scores <- image_na %*% pca.tetra$weights

Bill






On Jan 18, 2012, at 4:27 AM, wolfgang wrote:

> Haj
> 
> i try to perform a principal component analysis by using a tetrachoric
> correlation matrix as data input
> 
> tetra <- tetrachoric (image_na, correct=TRUE)
> t_matrix <- tetra$rho
> pca.tetra <- principal(t_matrix, nfactors = 10, n.obs = nrow(image_na),
> rotate="varimax", scores=TRUE)
> 
> the problem i have is to compute the individual factor scores from the pca.
> the code runs perfect if i do not ask for the scores
> 
> if i ask for the scores i get an error message
> "Error in scale(x.matrix): object 'x.matrix' not found"
> 
> can somebody help me?
> 
> cheers
> wolfgang
> 
> --
> View this message in context: http://r.789695.n4.nabble.com/computing-scores-from-a-factor-analysis-tp4306234p4306234.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
> 

William Revelle		           http://personality-project.org/revelle.html
Professor			           http://personality-project.org
Department of Psychology   http://www.wcas.northwestern.edu/psych/
Northwestern University	   http://www.northwestern.edu/
Use R for psychology             http://personality-project.org/r
It is 5 minutes to midnight	   http://www.thebulletin.org



More information about the R-help mailing list