Principal Components Analysis
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: Principal Components Analysis
There's an option when you run programs to continue even if you get errors up to a maximum number...It's set at 1 by default, make it bigger.
-
startz
- Non-normality and collinearity are NOT problems!
- Posts: 3797
- Joined: Wed Sep 17, 2008 2:25 pm
Re: Principal Components Analysis
This appears to be a response toThere's an option when you run programs to continue even if you get errors up to a maximum number...It's set at 1 by default, make it bigger.
Which of them do you think was committing a program error, such that more such errors should be permitted?Greentea wrote:
You’re a genius!!
Steady on, it'll go to his head....I have to work with him!
Re: Principal Components Analysis
By increasing the number, I've got my the programme working! How can I ever thank you enough!
Without exaggeration that you've made my day! Thank you!!
Without exaggeration that you've made my day! Thank you!!
Re: Principal Components Analysis
I’m afraid that I have to trouble you again about the program which you kindly helped me out last time.
Is that possible to display these 848 principal component analysis results one by one within Eviews, please? Last time, I had all the eigenvalues, eigenvectors and the ordinary correlation matrixes saved in Excel format. However, every time when I opened these Excel files, there were error messages saying that “File errors. Some number formats may have been lost.”.
Thank you very much as always!
Is that possible to display these 848 principal component analysis results one by one within Eviews, please? Last time, I had all the eigenvalues, eigenvectors and the ordinary correlation matrixes saved in Excel format. However, every time when I opened these Excel files, there were error messages saying that “File errors. Some number formats may have been lost.”.
Thank you very much as always!
Re: Principal Components Analysis
I’m afraid that I found another problem about the results of principal components analysis (PCA). Using those 2 programs which are shown in the 10th post (posted by me at 3:50 pm, Tue Jan 27, 2009 ), I only managed to get 22 eigenvalues (V1) for each of the programs. Taking the first programme for example, when I run the first programe, which is to get PCA results across years with a given firm, I should get 848*22 different V1. However, I only get one file with V1. Could you please be so kind to look into this for me, please?
Thank you!
Thank you!
Re: Principal Components Analysis
I think that I know where went wrong regarding my last post. However, could kindly lend me a hand for the post before that(to display results on screen)? Thank you!
-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: Principal Components Analysis
I'm afraid that I don't quite understand what it is you are trying to do. What exactly do you mean by displaying the results one by one?
Re: Principal Components Analysis
Thank you very much for the reply and sorry for the confusion I caused. I should have given you some background information!
I think that the aim of the 1st program in post 10 is to run a Principal Component Analysis (PCA) across years with a given firm using following 20 accounting measures.
group pclevel BOOKMV CACL CASHFLOWMV CASHFLOWTA CASHFLOWTLIABILITIES CREDITORMV CREDITORTA DY FIXATA IGEAR LTBORMV LTBORRATIO OPINCOMMV TAMV SALESTA SALESMV PMTA PMMV OPM OPINCOMTA
for !firm=1 to 848
smpl if crossid = !firm
pclevel.pcomp(cor, eigval=v1, eigvec=m1) pc1 pc2 pc3 pc4 pc5
v1.write v_1{!firm}.xls
m1.write m_1{!firm}.xls
group comps pc1 pc2 pc3 pc4 pc5
write comps_{!firm}.xls comps
next
At that moment, we showed the correlation matrixes and stored the results of eigenvalues (v1s), eigenvectors(m1) and the sores(comps) onto separated Excel firms. Since I have 848 firms in my data, I have 848 different files for v1, 848 files for m1 and 848 files for comps.
I’m wondering that is it possible to display the correlation matrixes, v1s, m1 and comps company by company, please? However, the program above only displays the correlation matrixes, v1s, m1 and comps of the last company in my data on the screen. I guess perhaps there is a way to pause the program and proceed again using each firm as a unit?
Thank you very much for your help!
I think that the aim of the 1st program in post 10 is to run a Principal Component Analysis (PCA) across years with a given firm using following 20 accounting measures.
group pclevel BOOKMV CACL CASHFLOWMV CASHFLOWTA CASHFLOWTLIABILITIES CREDITORMV CREDITORTA DY FIXATA IGEAR LTBORMV LTBORRATIO OPINCOMMV TAMV SALESTA SALESMV PMTA PMMV OPM OPINCOMTA
for !firm=1 to 848
smpl if crossid = !firm
pclevel.pcomp(cor, eigval=v1, eigvec=m1) pc1 pc2 pc3 pc4 pc5
v1.write v_1{!firm}.xls
m1.write m_1{!firm}.xls
group comps pc1 pc2 pc3 pc4 pc5
write comps_{!firm}.xls comps
next
At that moment, we showed the correlation matrixes and stored the results of eigenvalues (v1s), eigenvectors(m1) and the sores(comps) onto separated Excel firms. Since I have 848 firms in my data, I have 848 different files for v1, 848 files for m1 and 848 files for comps.
I’m wondering that is it possible to display the correlation matrixes, v1s, m1 and comps company by company, please? However, the program above only displays the correlation matrixes, v1s, m1 and comps of the last company in my data on the screen. I guess perhaps there is a way to pause the program and proceed again using each firm as a unit?
Thank you very much for your help!
-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: Principal Components Analysis
Possibly the best way for you is to, instead of storing everything onto disk in your loop, put your results in a spool object. Then you can look at individual results in EViews. You'll have to look at the docs for a discussion of how to do this...
Re: Principal Components Analysis
Thank you so much for the advice. I'll certainly look into spool object and if I face any problems, I may have to trouble you again. Thanks!
Re: Principal Components Analysis
Hi Admin
I am do the same type of analysis.
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 vales for vountry 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
what chages in the program i have to do
thanks
I am do the same type of analysis.
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 vales for vountry 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
what chages in the program i have to do
thanks
Re: Principal Components Analysis
what if I want to store only the principal components that has an eigen value greater than 1? I have mentioned something like this:
freeze(tab) all.pcomp(cor, mineigen=1, eigval=eval, eigvec=evec)
however, the eval vector still has all the principal components ( which equals the number of variables)
freeze(tab) all.pcomp(cor, mineigen=1, eigval=eval, eigvec=evec)
however, the eval vector still has all the principal components ( which equals the number of variables)
Who is online
Users browsing this forum: No registered users and 2 guests
