OLS regression with PC

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 Moderator, EViews Gareth

OLS regression with PC

Postby quynh_nguyennz on Fri Aug 10, 2012 5:12 am

Hi,
I have to run OLS regression with principal component each year.I save my PC as a matrix so when I tried to estimate return c pc , it doesnot work.
Please show me how to run it.
I am really sorry to bother you because this is my first time to use eviews. I don't know whether my file is pool or panel :?
this is my model
Rj,t = ∑i=1 5 βj,t PCi,t + εj,t
Regards
quynh_nguyennz
 
Posts: 25
Joined: Tue Aug 07, 2012 4:00 am

Re: OLS regression with PC

Postby quynh_nguyennz on Fri Aug 10, 2012 6:11 am

I think my data is times series data. it has 10 column The first one is the date, the second to the tenth is the return index of each countries
quynh_nguyennz
 
Posts: 25
Joined: Tue Aug 07, 2012 4:00 am

Re: OLS regression with PC

Postby EViews Glenn on Fri Aug 10, 2012 9:26 am

You don't want to save the eigenvalues/vectors, you want the scores. See the makepcomp proc, or click on Proc/Make Principal Components... from your group.
EViews Glenn
EViews Developer
 
Posts: 1994
Joined: Wed Oct 15, 2008 9:17 am

Re: OLS regression with PC

Postby quynh_nguyennz on Fri Aug 10, 2012 2:33 pm

You mean I don't need the eigenvalues/eigenvectors, I just need the score?But I think I need the eigenvectors to run the OLS regression. I have 10 PC and each PC contains the others 4 figures
Regards
quynh_nguyennz
 
Posts: 25
Joined: Tue Aug 07, 2012 4:00 am

Re: OLS regression with PC

Postby EViews Glenn on Fri Aug 10, 2012 3:45 pm

The eigenvalues and eigenvectors are summaries of the correlation/covariance matrix. If you want to run a regression you need something in the space of the original data. Look in the manual for a description of the scores.
EViews Glenn
EViews Developer
 
Posts: 1994
Joined: Wed Oct 15, 2008 9:17 am

Re: OLS regression with PC

Postby quynh_nguyennz on Sat Aug 11, 2012 4:27 pm

Hi, my mistake, I think I run the regression between the return index of each countries and the return of bond portfolio. therefore, i need the weight of the portfolio bond. they suggest to calculate the covariance matrix using the return index,once the eigenvectors are computed and sorted from the largest to the smallest eigenvalues, principal component are estimated from the return in the subsequent calendar year. they said the weightings are eigenvector. when I run principal component, I chose view/principal component/display table/calculation type variance ordinary. and when table come out, I use the eigenvalues there as my weight? IS it right? or I have to do something else?
Regards
quynh_nguyennz
 
Posts: 25
Joined: Tue Aug 07, 2012 4:00 am

Re: OLS regression with PC

Postby quynh_nguyennz on Mon Aug 13, 2012 2:43 am

Hi,
I used this command to make the principal component:
freeze(tab1) aus2005.pcomp(cov, eigval=v1, eigvec=m1) pc1 pc2 pc3 pc4
when I got the series PC1 to PC4, I run OLS regression using this model:
Rj,t = ∑i=1 5 βj,t PCi,t + εj,t
Is it alright?
regards
quynh_nguyennz
 
Posts: 25
Joined: Tue Aug 07, 2012 4:00 am

Re: OLS regression with PC

Postby EViews Glenn on Tue Aug 14, 2012 9:28 am

I'm confused. That appears to be the wrong syntax. Did the series PC1, PC2, PC3, PC4 already exist? Are you sure you didn't do makepcomp?
EViews Glenn
EViews Developer
 
Posts: 1994
Joined: Wed Oct 15, 2008 9:17 am

Re: OLS regression with PC

Postby quynh_nguyennz on Tue Aug 14, 2012 4:42 pm

Hi,
i use this command to make principal components:
freeze(tab1) aus2005.pcomp(cov, eigval=v1, eigvec=m1) pc1 pc2 pc3 pc4
because I need only the first four PC so I stored the first four PCs so that i can run the OLS regression
Is it right? and this is my model for ols:
Rj,t = ∑i=1 10 βj,t PCi,t + εj,t.
quynh_nguyennz
 
Posts: 25
Joined: Tue Aug 07, 2012 4:00 am

Re: OLS regression with PC

Postby EViews Glenn on Wed Aug 15, 2012 9:37 am

It appears that the form of the pcomp command you used does work, but it is an undocumented feature that is not guaranteed to work in the future. The correct command for making components is makepcomp.
EViews Glenn
EViews Developer
 
Posts: 1994
Joined: Wed Oct 15, 2008 9:17 am

Re: OLS regression with PC

Postby quynh_nguyennz on Thu Aug 16, 2012 4:15 am

I see the command in the reference:
group g1 x1 x2 x3 x4
freeze(tab1) g1.pcomp(cor, eigval=v1, eigvec=m1) pc1 pc2
The first line creates a group named G1 containing the four series X1, X2, X3, X4. The second
line stores the first two principal components of the sample correlation matrix in series
named PC1 and PC2. The output view is stored in a table named TAB1, the eigenvalues in a
vector named V1, and the eigenvectors in a matrix named M1.
I run and the series PC1 PC2 appears, Since I think I need the daily PC1, PC2 to run the OLS regression so that why I choose it
What is different between the makepcomp and my command?
quynh_nguyennz
 
Posts: 25
Joined: Tue Aug 07, 2012 4:00 am

Re: OLS regression with PC

Postby quynh_nguyennz on Thu Aug 16, 2012 4:28 am

Hi,
I have just tried your command. I think it is the same because I got the same result when I use this command:
makepcome (cov) comp1 comp2 comp3 comp4
Thank you very much for your kind advice and your patient to explain to me.
Thank you Thank you
I love you
Best regards
quynh_nguyennz
 
Posts: 25
Joined: Tue Aug 07, 2012 4:00 am

Re: OLS regression with PC

Postby EViews Glenn on Thu Aug 16, 2012 9:47 am

The PCOMP command is for displaying the loadings, scores and biplots. MAKEPCOMP is for saving the scores to the workfile. The syntax that you used in PCOMP has a potential conflict with the display of loadings when producing biplots. It works right now because the command maps to the same code as MAKEPCOMP, but that might not be the case in the future.

As the documentation states MAKEPCOMP is the method of producing the scores.
To compute principal components scores and save them in series in the workfile, see Group::makepcomp.

I do see that there is an example which shows your usage but that's a holdover that probably should have been changed when we added additional features to principal components. Either than or we should officially support your usage. I'll put in on the list of things for us to consider.
EViews Glenn
EViews Developer
 
Posts: 1994
Joined: Wed Oct 15, 2008 9:17 am

Re: OLS regression with PC

Postby quynh_nguyennz on Sun Aug 19, 2012 12:52 am

Hi,
I read the other topic about the principal component. They calculate the principal component base on those steps:
1 covariance matrix
2Calculate the eigenvectors and eigenvalues of the covariance
matrix
and last step is PC
Is it different from our syntax makepcomp?
quynh_nguyennz
 
Posts: 25
Joined: Tue Aug 07, 2012 4:00 am

Re: OLS regression with PC

Postby EViews Glenn on Fri Aug 24, 2012 1:57 pm

Probably the same, but it's difficult to tell from the description you provide.
EViews Glenn
EViews Developer
 
Posts: 1994
Joined: Wed Oct 15, 2008 9:17 am

Next

Return to Estimation

Who is online

Users browsing this forum: Bing [Bot] and 4 guests