Re: [R] computing scores from a factor analysis

2012-02-09 Thread francesca
William,
I had a problem similar to Wolfgang and I solved it through your help.
Many thanks!

Just an observation which sounded strange to me ( I am not a statistician,
just a wildlife biologist)
I have noticed  that  running the pca using principal with raw data  (and
therefore using scores=TRUE in the command line) gives different pca scores
than running the same pca with the correlation matrix (using scores=FALSE in
the command line and therefore calculating the scores in the way you
suggested to Wolfgang). Is that normal?

Thanks

francesca




--
View this message in context: 
http://r.789695.n4.nabble.com/computing-scores-from-a-factor-analysis-tp4306234p4372993.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@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.


Re: [R] computing scores from a factor analysis

2012-01-19 Thread William Revelle
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@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 Revellehttp://personality-project.org/revelle.html
Professor  http://personality-project.org
Department of Psychology   http://www.wcas.northwestern.edu/psych/
Northwestern Universityhttp://www.northwestern.edu/
Use R for psychology http://personality-project.org/r
It is 5 minutes to midnighthttp://www.thebulletin.org

__
R-help@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.


[R] computing scores from a factor analysis

2012-01-18 Thread wolfgang
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@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.