[R] PCA - princomp can only be used with more units than variables
jwiley.psych at gmail.com
Wed Jul 20 04:56:18 CEST 2011
On Mon, Jul 18, 2011 at 10:48 AM, a.mewes at yahoo.co.uk
<a.mewes at yahoo.co.uk> wrote:
> Ok thank you Josh.
> Basically I have a matrix A with 7 rows and 18 columns.
If i < j (where i is the number of rows in your matrix and j is the
number of columns), then the determinant of the covariance (or
correlation) matrix |Sigma_A| will be 0 (or very near zero, you can
easily convince yourself of this by running det(cov(matrix(rnorm(90),
9))) as many times as you need). From Cramer's Rule, if the
determinant of the matrix is 0, there is not a unique solution
(clarifications/corrections are welcome if any of this is wrong).
> What I am told is I need the 'varimax rotated scores from the PCA analysis
> of matrix A'
Who told you that? Is this homework? You could look at the
?principal function in package "psych". That said, if this is
homework I would talk with your instructor more, and if this is
anything beyond an exercise (i.e., has real world implications), I
would seek the advice/help of a local statistician.
> I can choose from 3 up to 7 components. My problem is how to carry out the
> Have you any ideas?
> Would appreciate your help!
> On 18/07/2011 18:07, Joshua Wiley wrote:
>> You need to explain what you want to do. This is not a software
>> issue, you simply cannot create more uncorrelated variables than you
>> have observations.
>> On Mon, Jul 18, 2011 at 8:53 AM, a.mewes at yahoo.co.uk
>> <a.mewes at yahoo.co.uk> wrote:
>>> May I ask a question about a thread
>>> I understand I need to use prcomp instead of princomp when i have less
>>> units than variables.
>>> However, when I use prcomp the scores is NULL. How can I overcome this?
>>> Kind Regards,
>>> Armin Mewes
>>> 10 Jerusalem street
>>> BT7 1QN
>>> Tel. (0044)(0)2890280887
>>> Email. enquiries at groundesign.net
>>> www. www.groundesign.net
>>> [[alternative HTML version deleted]]
>>> R-help at r-project.org mailing list
>>> PLEASE do read the posting guide
>>> and provide commented, minimal, self-contained, reproducible code.
> Kind Regards,
> Armin Mewes
> 10 Jerusalem street
> BT7 1QN
> Tel. (0044)(0)2890280887
> Email. enquiries at groundesign.net
> www. www.groundesign.net
Ph.D. Student, Health Psychology
University of California, Los Angeles
More information about the R-help