Obtaining weights with Principal component analysis

For technical questions regarding estimation of single equations, systems, VARs, Factor analysis and State Space Models in EViews. General econometric questions and advice should go in the Econometric Discussions forum.

Moderators: EViews Gareth, EViews Moderator

nienkelangen1992
Posts: 1
Joined: Mon May 23, 2016 4:43 am

Obtaining weights with Principal component analysis

Postby nienkelangen1992 » Mon May 23, 2016 5:40 am

Hi all,

I am working with panel data (t=12, N=13) in order to obtain an index. There are 13 indicators that I want to include in this index. I divided these 13 indicators into 3 main subcategories based on economic theory. Now I want to perform PCA in order to test if I divided the indicators correctly and in order to decide upon the weight each subcategory and each indicator should get.

When I perform PCA, I obtain 13 components of which 3 determine 47% and 4 determine 58%, giving me the idea that I should use 4 categories. However, I do not know how to translate the PCA output into weights. For example, if variable x has the highest eigenvector (loading) in component 1, how do I know what its weight within component 1 will be. Just summing up the eigenvector loadings of all the variables that should be in component 1 does not equal 100%. I read something about rotating factors loadings but I am totally not familiar with this.

Can someone help me?
Many thanks,

Nienke

EViews Glenn
EViews Developer
Posts: 2597
Joined: Wed Oct 15, 2008 9:17 am

Re: Obtaining weights with Principal component analysis

Postby EViews Glenn » Tue May 24, 2016 10:02 am

I'm not entirely sure what it is you want to do, but my best guess from the question is that you want to make the component scores. You can use the group procedure Proc/Make Principal Components... to make the component scores. There are options to make variants of the scores which have different variance properties.

awatt43
Posts: 17
Joined: Mon Aug 21, 2017 12:19 am

Re: Obtaining weights with Principal component analysis

Postby awatt43 » Wed Sep 12, 2018 10:54 am

Hi there,

I have a very similar question on PCA to the original here so hopefully this is the right place to post this.

I have run covariance PCA on a set of normalised data and extracted the eigenvectors, eigenvalues and the first principle component. What I am struggling with is if I apply the following transformation: (1) take the first eigenvector and transpose this into a diagonal matrix (2) multiply this by the underlying data (3) sum the rows of this matrix to get back to the first principle component, the summed series is always consistently out by a factor versus the EViews computed PC1??

If I do the same process with correlation PCA then I end up with the summed rows being different to the EViews PC1 by a different amount each period.

Is there something that I am missing in the calculation of the principle components which would mean that the sum of the (evec*underlying data) does not equilibrate to the EViews estimated principle component?

For context I am trying to understand the contribution of each series to the PC1 in each time period so that I can see how the relevance of series in my dataset changes overtime.

Unfortunately I cannot share my work file due to data privileges but hopefully the explanation above is clear enough.

Thanks in advance,
Abi

EViews Glenn
EViews Developer
Posts: 2597
Joined: Wed Oct 15, 2008 9:17 am

Re: Obtaining weights with Principal component analysis

Postby EViews Glenn » Thu Sep 13, 2018 11:47 am

I must admit that I don't entirely understand what you are trying to do with your calculation. The following shows the equivalence between post-multiplying the data by the eigenvectors and the score series created using normalize loadings scaling. Note that as expected the average sum of the squared scores equals the corresponding eigenvalue.

Code: Select all

workfile u 1000

group group01
for !i = 1 to 3
   series a!i = nrnd
   a!i = (a!i - @mean(a!i))/@stdevp(a!i)
   group01.add a!i
next
stom(group01, yy)

freeze(pcomp) group01.pcomp(cov=cov, eigval=abc1, eigvec=abc2)
matrix v1 = yy*abc2

group01.makepcomp(cov=cov) v1a v1b v1c
group v1alt v1a v1b v1c

vector ev = @csumsq(v1)/@rows(v1)

awatt43
Posts: 17
Joined: Mon Aug 21, 2017 12:19 am

Re: Obtaining weights with Principal component analysis

Postby awatt43 » Tue Sep 18, 2018 11:38 pm

Thank you for your response Glenn - I have managed to obtain what i wanted to calculate from your code.

I did have another more general question - i understand that EViews can report both the loadings and the eigenvectors, why would these be the same when using the covariance method of PCA?

Thanks,
Abi


Return to “Estimation”

Who is online

Users browsing this forum: No registered users and 9 guests