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 » Wed May 07, 2014 9:57 am

You will need to make some minor code changes. Change the size of "subbhat" to hold the additional variable, and add it before the cross-sectional regressions are done. Also change the size of "subgamma" to hold the coefficient from the additional variable and the size of the "design" matrix in the fmb subroutine.

quachhao
Posts: 4
Joined: Tue May 13, 2014 8:23 am

Re: Fama-MacBeth regression

Postby quachhao » Tue May 13, 2014 8:39 am

Hello,

I am new to this. I have tried to run the Fama-Macbeth add-in but it fails every time - I don't know why. I attach the sample used in here with factors including Rf,MK, F1..F3 and excess portfolio returns from P1...P18. Can anyone help instruct how to run the regression with this sample?

Thanks.
QH
Last edited by quachhao on Thu May 15, 2014 4:42 am, edited 1 time in total.

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

Re: Fama-MacBeth regression

Postby EViews Rebecca » Tue May 13, 2014 8:52 am

If you look at your data you will see that series "p5" has NAs. The add-in will not work with NAs in series. One solution is to change the sample to exclude them.

quachhao
Posts: 4
Joined: Tue May 13, 2014 8:23 am

Re: Fama-MacBeth regression

Postby quachhao » Tue May 13, 2014 9:01 am

Hi Rebecca,

Thank you. But even if I exclude the first two rows, the add-in still shows error message when running. Please could you help check?
Just to make sure: when we enter the data to the list of portfolio/asset returns, we simply list them like this: p1 p2 p3 p4...p9 and the same with list of factors i.e. rf mk f1 f2 f3?

Cheers,
QH

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

Re: Fama-MacBeth regression

Postby EViews Rebecca » Tue May 13, 2014 9:07 am

Works for me.

By the way, you can also enter the series as "p*" and " rf mk f*" (without the quotes).

quachhao
Posts: 4
Joined: Tue May 13, 2014 8:23 am

Re: Fama-MacBeth regression

Postby quachhao » Tue May 13, 2014 9:21 am

He Rebecca,

Sorry for disturbing again but I cannot do it. Attached is what I did - correct me if I am wrong anywhere.
Do I need to change the coding or simply download the add-in from the site using Eviews's "Download add-ins" ?

Thanks,
QH
Last edited by quachhao on Thu May 15, 2014 4:42 am, edited 1 time in total.

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

Re: Fama-MacBeth regression

Postby EViews Rebecca » Tue May 13, 2014 9:36 am

The Excel file you posted has 43 observations (including the NAs) but your example shows 50 observations. Where are your extra observations coming from?

Also, this isn't necessary to solve your problem, but I noticed you've dropped the date information going from Excel to EViews. Keeping this might help you organize your data.

MeikeK
Posts: 5
Joined: Mon May 12, 2014 1:14 am

Re: Fama-MacBeth regression

Postby MeikeK » Sun May 18, 2014 10:59 am

Dear all,

I am trying to estimate the risk premium for various estimates of stock illiquidity. I have generated 10 illiquidity portfolios and want to obtain the risk prima for both the market return and 3 estimates of illiquidity. I am trying to use the Fama-MacBeth add in to generate the respective (iliquidity) betas and gammas. I am having trouble with defining the input for the risk factors. I understand that for the market factor, I need to use the market return, but how do I include the three illiquidity betas? I defined the betas as following:

β^1i= (cov(r_t^i,r_t^M- E_(t-1) (r_t^M )))/(var(r_t^M- E_(t-1) (r_t^M )-{c_t^M-E_(t-1) (c_t^M )}))
β^2i=(cov(c_t^i-E_(t-1) (c_t^i ),c_t^M- E_(t-1) (c_t^M )))/(var(r_t^M- E_(t-1) (r_t^M )-{c_t^M-E_(t-1) (c_t^M )}))
β^3i=(cov(r_t^i,c_t^M- E_(t-1) (c_t^M )))/(var(r_t^M- E_(t-1) (r_t^M )-{c_t^M-E_(t-1) (c_t^M )}))
β^4i=(cov(c_t^i-E_(t-1) (c_t^i ),r_t^M- E_(t-1) (r_t^M )))/(var(r_t^M- E_(t-1) (r_t^M )-{c_t^M-E_(t-1) (c_t^M )}))

Where beta1 is the market beta, and 2,3 and 4 are the illiquidity betas.

I hope someone can help me, I cannot figure out a way to do it.

Kind regards,
MeikeK

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

Re: Fama-MacBeth regression

Postby EViews Rebecca » Mon May 19, 2014 10:49 am

I don't understand what you're asking. The add-in will calculate the betas for you from your risk factors.

MeikeK
Posts: 5
Joined: Mon May 12, 2014 1:14 am

Re: Fama-MacBeth regression

Postby MeikeK » Tue May 20, 2014 7:26 am

Dear Rebecca,

What I mean is that I am not sure how to create the risk factors that are used as independent variable. The risk factors as I am using them are namely the comovements of stock returns and illiquidity with the market return and illiquidity. I am not sure how I should construct a risk factor from these. Could you possibly help me?

Kind regards,

MeikeK

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

Re: Fama-MacBeth regression

Postby EViews Rebecca » Tue May 20, 2014 8:20 am

I can't help you with that. There are many possible risk factors and how you determine them is up to you.

MeikeK
Posts: 5
Joined: Mon May 12, 2014 1:14 am

Re: Fama-MacBeth regression

Postby MeikeK » Tue May 20, 2014 9:42 am

Thank you for your quick reply.

One more question: all risk factors that are used as independent variables in the Fama-MacBeth add in should be in the form of returns right? Or can they be other types of variables (such as market illiquidity)?

Kind regards,
MeikeK

metrix
Posts: 57
Joined: Sun Dec 08, 2013 9:15 am

Re: Fama-MacBeth regression

Postby metrix » Sat Jun 14, 2014 1:47 am

Dear Rebecca,
this Add-in can do Fama French (1992) approach like Fama and MacBeth (1973) it is based on a time series cross sections model, but Fama French (1993) use a factor based model in the context of a time series regression witch is run separately on each portofolio 'i'.
it would be kind of you if you add the method of the Fama French (1993) regression based in the context of a time series regression witch is run separately on each portofolio 'i' in this Add-in (improve this Add-in with additional method).
thank you for all your efforts, I'm really enjoy using this Add-in :D .

Kind regards. metrix

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

Re: Fama-MacBeth regression

Postby EViews Rebecca » Mon Jun 16, 2014 10:55 am

Thanks for your feedback, but I have no immediate plans to enhance the add-in. To get what you want you could extract the piece of the program that does the first step (the time series regressions) and then modify this to get your time series output.

metrix
Posts: 57
Joined: Sun Dec 08, 2013 9:15 am

Re: Fama-MacBeth regression

Postby metrix » Tue Jun 17, 2014 9:46 am

Dear Rebecca,
I'm not very expert in programming in eviews :oops: ,thank you for your response, but would you like to take this in consideration for Fama French (1993) to add it in the future.

Kind Regards metrix.


Return to “Add-in Support”

Who is online

Users browsing this forum: No registered users and 15 guests