Page 1 of 1

PCA on Panel data

Posted: Sun Jan 26, 2014 7:12 am
by abcd
Hi Admin


I am woring on panel data, haveing time series form 1970 to 2008. and number of countries are 30. I have to generate the PCA for each country. first of all I have to generate the eigen values for country one and store them in excel and generate the eigen vlaues for country two and save them in excel below the eigean values of first country eigen values. and so on

how i can do this
thanks

Re: PCA on Panel data

Posted: Mon Jan 27, 2014 2:38 pm
by EViews Glenn
You'll have to write a simple program to loop over the calculation for each cross-section. There are many examples of such looping on this forum and in the EViews documentation.

Re: PCA on Panel data

Posted: Wed Jan 29, 2014 3:40 am
by abcd
thanks for reply

can you please refer me to such loops

thanks
i am unalbe to find.

Re: PCA on Panel data

Posted: Wed Jan 29, 2014 10:30 am
by abcd
Not geeting the command to save the eigen values in Excel.

how to do this .

Re: PCA on Panel data

Posted: Wed Jan 29, 2014 10:46 am
by EViews Glenn

Code: Select all

!maxcrossid = @max(@crossid) for !i=1 to !maxcrossid smpl if @crossid = !i [do your thing here] next

Re: PCA on Panel data

Posted: Mon Jan 19, 2015 7:13 am
by aramibiaram
Can you explain more??????

Re: PCA on Panel data

Posted: Mon Jan 19, 2015 9:11 am
by EViews Glenn
Just substitute the lines to do the pca and save the results in place of the lines

[do your thing here]

I dont' remember the syntax but I believe something like

Code: Select all

grp.pcomp(eigen=a)
should save the eigenvalues for the correlation matrix of the group into the vector A. For each cross-section, you'll also want to put A in a different row of a results matrix.