FamaMacBeth regression
Moderators: EViews Gareth, EViews Moderator, EViews Esther
Re: FamaMacBeth regression
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 Developer
 Posts: 98
 Joined: Thu Apr 18, 2013 8:37 am
Re: FamaMacBeth regression
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 addin. In the workfile you posted this gives 75 portfolios. This may be the source of your difference.
Re: FamaMacBeth regression
I am trying to replicate FamaMacBeth 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 NeweyWest (HAC) standard errors correction.
Could anybody help me with this?
Thanks in advance.
Could anybody help me with this?
Thanks in advance.

 EViews Developer
 Posts: 98
 Joined: Thu Apr 18, 2013 8:37 am
Re: FamaMacBeth regression
Code: Select all
ls(cov=hac) (depvar) (indepvars)
Re: FamaMacBeth regression
This addin 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 Developer
 Posts: 98
 Joined: Thu Apr 18, 2013 8:37 am
Re: FamaMacBeth regression
The code for the EViews rolling regression addin should help you modify the FamaMacBeth code to do what you want.
Re: FamaMacBeth regression
Hey I have download the famamacbeth addin but I still have trouble to do the test for 6 Portfolios Formed on Size and BooktoMarket (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.TStat are 5.37 and 3.
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.TStat are 5.37 and 3.

 EViews Developer
 Posts: 98
 Joined: Thu Apr 18, 2013 8:37 am
Re: FamaMacBeth regression
The FamaMacBeth 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.
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: FamaMacBeth regression
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 Developer
 Posts: 98
 Joined: Thu Apr 18, 2013 8:37 am
Re: FamaMacBeth regression
There's no such thing as "gamma," as defined in the addin, 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.
I strongly suggest you read the documentation so you understand what gamma is.
Re: FamaMacBeth regression
Ok yes thx that's clear now. Two more stupid question: First, when testing the joint null hypothesis in CS average regression one with Fstatistics, whats the critical value used in the test? Is it 5 %? Hence, the critical value of the Fdistribution is 2.60 with three betas? Second, is the Fstatistics heteroscedasticity robust as we use HAC standard errors?

 EViews Developer
 Posts: 98
 Joined: Thu Apr 18, 2013 8:37 am
Re: FamaMacBeth regression
1. EViews simply reports the Fstatistic. It's up to you to decide what significance level you want.
2. Since the crosssectional average regression uses robust standard errors, use the robust Fstatistic (Wald Fstatistic).
2. Since the crosssectional average regression uses robust standard errors, use the robust Fstatistic (Wald Fstatistic).
Re: FamaMacBeth regression
Ok thx that's clear now. One more question: how do I get the betas from the first step timeseries 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 ?
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 Developer
 Posts: 98
 Joined: Thu Apr 18, 2013 8:37 am
Re: FamaMacBeth regression
See Equation 1 in the documentation.

 Posts: 3
 Joined: Wed May 07, 2014 2:15 am
Re: FamaMacBeth regression
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
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
Who is online
Users browsing this forum: No registered users and 1 guest