Fama-MacBeth regression

For questions about EViews Add-ins available from the EViews Add-ins webpage. Note each add-in available on our webpage will have its own individual thread.

Moderators: EViews Gareth, EViews Moderator, EViews Esther

EViews Rebecca
EViews Developer
Posts: 113
Joined: Thu Apr 18, 2013 8:37 am

Re: Fama-MacBeth regression

Postby EViews Rebecca » Tue Oct 21, 2014 10:40 am

Can you post the workfile you used?

fan
Posts: 7
Joined: Fri Oct 17, 2014 4:07 pm

Re: Fama-MacBeth regression

Postby fan » Tue Oct 21, 2014 10:30 pm

EViews Rebecca wrote:Can you post the workfile you used?


Thanks for the reply. This is my workfile. I am looking forward to hearing from you.
Attachments
myworkfile.wf1
(119.53 KiB) Downloaded 609 times

EViews Rebecca
EViews Developer
Posts: 113
Joined: Thu Apr 18, 2013 8:37 am

Re: Fama-MacBeth regression

Postby EViews Rebecca » Wed Oct 22, 2014 2:45 pm

Are you using "r*" to enter your portfolio returns in the add-in? In that case you will include the "resid" series, which you probably don't want to do. One solution is to rename the returns series to something that won't overlap with other series in your workfile.

fan
Posts: 7
Joined: Fri Oct 17, 2014 4:07 pm

Re: Fama-MacBeth regression

Postby fan » Wed Oct 22, 2014 8:33 pm

EViews Rebecca wrote:Are you using "r*" to enter your portfolio returns in the add-in? In that case you will include the "resid" series, which you probably don't want to do. One solution is to rename the returns series to something that won't overlap with other series in your workfile.

thanks for the reply.

fan
Posts: 7
Joined: Fri Oct 17, 2014 4:07 pm

Re: Fama-MacBeth regression

Postby fan » Tue Oct 28, 2014 1:15 pm

I am looking for help to implement following tests in the Fama-MacBeth regression. First, how can I include constant as a factor in the regression as many people do in their studies; second, how can I have the newey-west estimators from the time-series regressions and how can I test the joint significance of the loadings via SUR system; third, how can I have the t-statistics which are adjusted for errors-in-variables following Shanken (1992) and how can I have the adjusted R2 follows Jagannathan and Wang (1996) in the cross-sectional regressions. Thank you for your help

vickyzao
Posts: 2
Joined: Tue Oct 28, 2014 8:57 am

Re: Fama-MacBeth regression

Postby vickyzao » Tue Oct 28, 2014 1:19 pm

trubador wrote:First of all, make sure that you have EViews version 7.x or higher. Then, download the add-in and run the installation program (or simply unzip it). It will upload a documentation file into the related folder (C:\Users\...\Documents\EViews Addins\...), where you can find your answers.


1 point that i could not understand in file "fm_example". For specific rmkt is a factor, it had value during the period, so these values corresponded with pr11 or pr12 ,..? What about for each portofilios/asset return. X is a factor, in general, X has panel data (for example 25 porfolios, 588 observations), how can it be showed in a sheet? . Could anyone help me how to present a factor in a workfile? Could you please tell me soon?
Thank you so much for your help. :)

EViews Rebecca
EViews Developer
Posts: 113
Joined: Thu Apr 18, 2013 8:37 am

Re: Fama-MacBeth regression

Postby EViews Rebecca » Tue Oct 28, 2014 2:23 pm

fan wrote:I am looking for help to implement following tests in the Fama-MacBeth regression. First, how can I include constant as a factor in the regression as many people do in their studies; second, how can I have the newey-west estimators from the time-series regressions and how can I test the joint significance of the loadings via SUR system; third, how can I have the t-statistics which are adjusted for errors-in-variables following Shanken (1992) and how can I have the adjusted R2 follows Jagannathan and Wang (1996) in the cross-sectional regressions. Thank you for your help


To answer your first question, look at equations 1 and 2 in the documentation. Your other questions are not covered by the add-in and you will need to do them yourself.

EViews Rebecca
EViews Developer
Posts: 113
Joined: Thu Apr 18, 2013 8:37 am

Re: Fama-MacBeth regression

Postby EViews Rebecca » Tue Oct 28, 2014 2:24 pm

vickyzao wrote:
trubador wrote:First of all, make sure that you have EViews version 7.x or higher. Then, download the add-in and run the installation program (or simply unzip it). It will upload a documentation file into the related folder (C:\Users\...\Documents\EViews Addins\...), where you can find your answers.


1 point that i could not understand in file "fm_example". For specific rmkt is a factor, it had value during the period, so these values corresponded with pr11 or pr12 ,..? What about for each portofilios/asset return. X is a factor, in general, X has panel data (for example 25 porfolios, 588 observations), how can it be showed in a sheet? . Could anyone help me how to present a factor in a workfile? Could you please tell me soon?
Thank you so much for your help. :)


I don't understand what you're asking.

vickyzao
Posts: 2
Joined: Tue Oct 28, 2014 8:57 am

Re: Fama-MacBeth regression

Postby vickyzao » Wed Oct 29, 2014 2:54 am

I would talk my case in details. I had 100 asset returns (in 36 months), monthly returns were estimated a below picture http://i1128.photobucket.com/albums/m486/vickyzao/myissue.png
To use addin in Eviews, my workfile inclueded:
+ rm* (representative rm1, rm2,..., rm100: monthly returns of stock 1, 2, ...., 100) in 36 months
+ factors: lnBM, lnMV, E_A, E_Y, 4 variables

Hope this picture help you understand me
I am waitng for your reply
Thanks

EViews Rebecca
EViews Developer
Posts: 113
Joined: Thu Apr 18, 2013 8:37 am

Re: Fama-MacBeth regression

Postby EViews Rebecca » Wed Oct 29, 2014 1:17 pm

vickyzao wrote:I would talk my case in details. I had 100 asset returns (in 36 months), monthly returns were estimated a below picture http://i1128.photobucket.com/albums/m486/vickyzao/myissue.png
To use addin in Eviews, my workfile inclueded:
+ rm* (representative rm1, rm2,..., rm100: monthly returns of stock 1, 2, ...., 100) in 36 months
+ factors: lnBM, lnMV, E_A, E_Y, 4 variables

Hope this picture help you understand me
I am waitng for your reply
Thanks


The add-in does not handle factors that consist of multiple series.

fan
Posts: 7
Joined: Fri Oct 17, 2014 4:07 pm

Re: Fama-MacBeth regression

Postby fan » Thu Oct 30, 2014 11:55 am

Can anyone help me understand why I am getting this error message: "MATRIX-VECTOR INDEX IS OUT OF RANGE IN "VECTOR RETIC=@TRANSPOSE@ROWEXTRACT(RM,J))" ? Many Thanks

EViews Rebecca
EViews Developer
Posts: 113
Joined: Thu Apr 18, 2013 8:37 am

Re: Fama-MacBeth regression

Postby EViews Rebecca » Thu Oct 30, 2014 1:26 pm

Again, you need to post the workfile you're using.

fan
Posts: 7
Joined: Fri Oct 17, 2014 4:07 pm

Re: Fama-MacBeth regression

Postby fan » Wed Nov 05, 2014 2:51 pm

EViews Rebecca wrote:Again, you need to post the workfile you're using.

This is my work file. I am trying estimate returns on pm1 to pm10 and pr11 to pr55. I am not sure why I am getting the error message. Thank you
Attachments
25 portoilo.WF1
(220.89 KiB) Downloaded 614 times

EViews Rebecca
EViews Developer
Posts: 113
Joined: Thu Apr 18, 2013 8:37 am

Re: Fama-MacBeth regression

Postby EViews Rebecca » Thu Nov 06, 2014 7:57 am

Works for me.

ecofin
Posts: 182
Joined: Fri May 10, 2013 11:24 am

Re: Fama-MacBeth regression

Postby ecofin » Mon Nov 17, 2014 2:49 am

hi,
how can use GLS or GMM instead OLS in this add-in?
1-suppose that pr* and rmkt are autocorrelation i can modifie the code to add ar(1) in the end of equation, but the problem i lose one observation (nobs=587) :(

Code: Select all

equation {%subbetaeq}.ls {%subrets}(!i) c {%subfacs} ar(1)

how can generate error equations (E(i)=c(i)*Ei(-1)) for each equations (pr11 c rmkt, pr12 c rmkt,...etc), and use the c(i) to transform the observation to make the first step of regression of Fama-Macbeth and show all equation in the spool objects resolt and importe the c(i) in the vector, and show the transformed series pr* and rmkt.
same problem with the second step if i add ar(1) in the end of equation i lose 1 observation (n=24)

Code: Select all

equation {%subcsavg}.ls avgrets c betag ar(1)


2-how can make Fama-Macbeth with GMM?


Return to “Add-in Support”

Who is online

Users browsing this forum: No registered users and 12 guests