Page 2 of 11

Re: Fama-MacBeth regression

Posted: Tue Nov 05, 2013 11:08 am
by WhutWhut
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.

Re: Fama-MacBeth regression

Posted: Tue Nov 05, 2013 11:35 am
by EViews Rebecca
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.

Re: Fama-MacBeth regression

Posted: Fri Nov 08, 2013 9:17 pm
by rbraga
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.

Re: Fama-MacBeth regression

Posted: Mon Nov 11, 2013 9:39 am
by EViews Rebecca

Code: Select all

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

Re: Fama-MacBeth regression

Posted: Tue Feb 04, 2014 2:15 am
by tariqaziz
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

Re: Fama-MacBeth regression

Posted: Tue Feb 04, 2014 12:32 pm
by EViews Rebecca
The code for the EViews rolling regression add-in should help you modify the Fama-MacBeth code to do what you want.

Re: Fama-MacBeth regression

Posted: Tue Mar 04, 2014 4:13 am
by hemiso
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.

Re: Fama-MacBeth regression

Posted: Tue Mar 04, 2014 10:13 am
by EViews Rebecca
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.

Re: Fama-MacBeth regression

Posted: Thu Mar 06, 2014 10:24 am
by hemiso
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.

Re: Fama-MacBeth regression

Posted: Thu Mar 06, 2014 10:59 am
by EViews Rebecca
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.

Re: Fama-MacBeth regression

Posted: Fri Mar 07, 2014 7:17 am
by hemiso
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?

Re: Fama-MacBeth regression

Posted: Fri Mar 07, 2014 12:40 pm
by EViews Rebecca
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).

Re: Fama-MacBeth regression

Posted: Tue Mar 11, 2014 8:03 am
by hemiso
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 ?

Re: Fama-MacBeth regression

Posted: Tue Mar 11, 2014 9:12 am
by EViews Rebecca
See Equation 1 in the documentation.

Re: Fama-MacBeth regression

Posted: Wed May 07, 2014 3:01 am
by franknijenhuis
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