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

WhutWhut

Re: Fama-MacBeth regression

Postby WhutWhut » Tue Nov 05, 2013 11:08 am

Don't use code, I simply open a system of the 25 dependent variables and fill in c mkt smb hml in the equation specific equations and then estimate using ols. This yields the beta's, which i then use in a new file where I take the 25 returns of the portfolio's at the time t and use the beta's i have estimated per regression as independent variables in the cross sectional regression, which yields risk premia per time period t. This can be done for any one time period, I chose to do this for the first month and the second month to check the add in since the outcomes of the check should be similar as the data in the gamma01 matrix of the add in.

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

Re: Fama-MacBeth regression

Postby EViews Rebecca » Tue Nov 05, 2013 11:35 am

Without knowing exactly what you're doing it's impossible to know what's going wrong. However, you say your replication uses 25 portfolios. Earlier you said you use eqexrf* as your portfolios in the add-in. In the workfile you posted this gives 75 portfolios. This may be the source of your difference.

rbraga
Posts: 1
Joined: Fri Nov 08, 2013 8:44 pm

Re: Fama-MacBeth regression

Postby rbraga » Fri Nov 08, 2013 9:17 pm

I am trying to replicate Fama-MacBeth regression for the example in the Add in, but I don’t know the code to run OLS corrected for heteroskedasticity and autocorrelation, that is, using Newey-West (HAC) standard errors correction.

Could anybody help me with this?

Thanks in advance.

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

Re: Fama-MacBeth regression

Postby EViews Rebecca » Mon Nov 11, 2013 9:39 am

Code: Select all

ls(cov=hac) (depvar) (indepvars)

tariqaziz
Posts: 5
Joined: Fri Sep 27, 2013 4:26 am

Re: Fama-MacBeth regression

Postby tariqaziz » Tue Feb 04, 2014 2:15 am

This add-in performs the first step regressions for the whole period instead of rolling periods. Can anyone help me in modifying the code so that we can specify the rolling period for calculating the betas in the first step time series regressions? Thanks a lot in advance for any help

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

Re: Fama-MacBeth regression

Postby EViews Rebecca » Tue Feb 04, 2014 12:32 pm

The code for the EViews rolling regression add-in should help you modify the Fama-MacBeth code to do what you want.

hemiso
Posts: 5
Joined: Mon Feb 24, 2014 5:01 pm

Re: Fama-MacBeth regression

Postby hemiso » Tue Mar 04, 2014 4:13 am

Hey I have download the fama-macbeth add-in but I still have trouble to do the test for 6 Portfolios Formed on Size and Book-to-Market (2 x 3) from Europe. Data is from Kenenth R. French website.

I have uploaded the portfolios pr1, p2.. pr6 + SMB, RF, MKT_RF, MKT and HML to eviews from excel spreadsheet. Questions:

1. How do I run all factors (MKT_RF, SMB, HML) together against all portfolio returns? I have named the portfolios pr1, pr2... so list of portfolios returns is pr*. Do I have to run separately each factor against the portfolios?

2. I am not familiar with term gamma in regression model. Is it the regression coefficient that is used to calculate the risk premium? For example gamma0 median is 1.567 and -0.234 for gamma1 when MKT_RF is only factor.T-Stat are 5.37 and -3.

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

Re: Fama-MacBeth regression

Postby EViews Rebecca » Tue Mar 04, 2014 10:13 am

The Fama-MacBeth documentation will answer your questions.

1. See section 2 ("GUI") on how to enter portfolio returns and factors.

2. See equation 2 and surrounding text for the definition and use of gamma.

hemiso
Posts: 5
Joined: Mon Feb 24, 2014 5:01 pm

Re: Fama-MacBeth regression

Postby hemiso » Thu Mar 06, 2014 10:24 am

Okey when I regress factors against portfolios pr* I get four gammas for the factors. Are the gammas weighted averages from all portfolios? When I try to regress for example portfolio 1 against factors it says "Near singular matrix.." and it does not show results. What am I doing wrong here? How can I get the results of gammas for each portfolio separately.

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

Re: Fama-MacBeth regression

Postby EViews Rebecca » Thu Mar 06, 2014 10:59 am

There's no such thing as "gamma," as defined in the add-in, for individual portfolios. gamma is a measure of the premium you get from exposure to a certain risk factor. That's why there's one for each factor (plus the constant).

I strongly suggest you read the documentation so you understand what gamma is.

hemiso
Posts: 5
Joined: Mon Feb 24, 2014 5:01 pm

Re: Fama-MacBeth regression

Postby hemiso » Fri Mar 07, 2014 7:17 am

Ok yes thx that's clear now. Two more stupid question: First, when testing the joint null hypothesis in CS average regression one with F-statistics, whats the critical value used in the test? Is it 5 %? Hence, the critical value of the F-distribution is 2.60 with three betas? Second, is the F-statistics heteroscedasticity robust as we use HAC standard errors?

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

Re: Fama-MacBeth regression

Postby EViews Rebecca » Fri Mar 07, 2014 12:40 pm

1. EViews simply reports the F-statistic. It's up to you to decide what significance level you want.

2. Since the cross-sectional average regression uses robust standard errors, use the robust F-statistic (Wald F-statistic).

hemiso
Posts: 5
Joined: Mon Feb 24, 2014 5:01 pm

Re: Fama-MacBeth regression

Postby hemiso » Tue Mar 11, 2014 8:03 am

Ok thx that's clear now. One more question: how do I get the betas from the first step time-series regression?

Do I have to run basic OLS regression for each portfolio separately like PR*=C(1)+C(2)*MKT_RF+C(3)*SMB+C(4)*HML ?

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

Re: Fama-MacBeth regression

Postby EViews Rebecca » Tue Mar 11, 2014 9:12 am

See Equation 1 in the documentation.

franknijenhuis
Posts: 3
Joined: Wed May 07, 2014 2:15 am

Re: Fama-MacBeth regression

Postby franknijenhuis » Wed May 07, 2014 3:01 am

Hi,
I searched the forum but couldn't find any answer concerning how to run a Fama Macbeth, adding an additional factor in the second step in eviews. Any help on this would be great.

I have about 2000 stocks with monthly data from 1992 till 2012, so running regressions manually is too extensive. First I want to calculate betas using FF three factor model time series approach. Then I want to make the cross sectional regression with the found betas using an additional variable to evaluate the effect of this variable on the returns.

Does a code exist to run this? or does anyone know how to ammend the existing program code so I can do this?

Thanks!
Frank


Return to “Add-in Support”

Who is online

Users browsing this forum: No registered users and 20 guests