Re: [R] PCA - scores

From: Joshua Wiley <jwiley.psych_at_gmail.com>
Date: Thu, 03 Mar 2011 17:15:34 -0800

Hi Shari,

Yes, please look at the documentation for principal. You can access this (assuming you have loaded psych) by typing at the console:

?principal

note the logical argument "scores".

Here is a small example:

##############################

require(psych)
require(GPArotation)

dat <- principal(mtcars[, c("mpg", "hp", "wt")], nfactors = 1,   rotate = "oblimin", scores = TRUE)

dat$scores

##############################

Cheerio,

Josh

On Thu, Mar 3, 2011 at 1:02 PM, Shari Clare <sclare_at_ualberta.ca> wrote:
> I am running a PCA, but would like to rotate my data and limit the
> number of factors that are analyzed.  I can do this using the
> "principal" command from the psych package [principal(my.data,
> nfactors=3,rotate="varimax")], but the issue is that this does not
> report scores for the Principal Components the way "princomp" does.
>
> My question is:
>
> Can you get an output of scores using "principal" OR, is there a way
> to limit the number of factors that are included when you use
> "princomp"?
>
> Thanks,
> Shari Clare
>
> PhD Candidate
> Department of Renewable Resources
> University of Alberta
> sclare_at_ualberta.ca
> 780-492-2540
>
>
>
>
>
>
>
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> 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.
>

-- 
Joshua Wiley
Ph.D. Student, Health Psychology
University of California, Los Angeles
http://www.joshuawiley.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.
Received on Fri 04 Mar 2011 - 01:18:25 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 04 Mar 2011 - 05:20:21 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive