Page 1 of 1

Principal component analysis on a matrix

Posted: Wed Feb 01, 2012 1:06 pm
by PMaier
Hi,

I'd like to use principal component analysis on a matrix and retrieve the scores.

I can use

matrixname.pcomp(eigval=v1, eigvec=m1)

to calculate the eigenvalues and eigenvectors, but there doesn't seem to be a command to calculate the scores -- although when I use the dialog box, I can store them in a series, so the capability is there.

Put differently, if my matrix were a group object, I'd use

groupname.makepcomp

and I'm assuming that there is a similar command for matrices, too?

Many thanks, Philipp

Re: Principal component analysis on a matrix

Posted: Wed Feb 01, 2012 2:32 pm
by EViews Gareth

Code: Select all

matrix.makepcomp(score=myname) 3
saves the first 3 scores in a matrix called myname.

Re: Principal component analysis on a matrix

Posted: Wed Feb 01, 2012 2:39 pm
by EViews Glenn
The reason for the difference is that the matrices are not generally the same size as a workfile so that the scores can't be put into a set of series as in the group case. Thus, we allow you to save them into a matrix.

Re: Principal component analysis on a matrix

Posted: Wed Feb 01, 2012 2:47 pm
by PMaier
Gareth,

You made my day.

Philipp

PS I don't think it's in the manual -- if that's correct, it might be worth adding for the next iteration.

Re: Principal component analysis on a matrix

Posted: Wed Feb 01, 2012 4:06 pm
by EViews Glenn
I believe you are correct. On both counts.