FamaMacBeth regression
Moderators: EViews Gareth, EViews Moderator, EViews Esther

 EViews Developer
 Posts: 98
 Joined: Thu Apr 18, 2013 8:37 am
Re: FamaMacBeth regression
You will need to make some minor code changes. Change the size of "subbhat" to hold the additional variable, and add it before the crosssectional 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.
Re: FamaMacBeth regression
Hello,
I am new to this. I have tried to run the FamaMacbeth addin 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
I am new to this. I have tried to run the FamaMacbeth addin 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 Developer
 Posts: 98
 Joined: Thu Apr 18, 2013 8:37 am
Re: FamaMacBeth regression
If you look at your data you will see that series "p5" has NAs. The addin will not work with NAs in series. One solution is to change the sample to exclude them.
Re: FamaMacBeth regression
Hi Rebecca,
Thank you. But even if I exclude the first two rows, the addin 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
Thank you. But even if I exclude the first two rows, the addin 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 Developer
 Posts: 98
 Joined: Thu Apr 18, 2013 8:37 am
Re: FamaMacBeth regression
Works for me.
By the way, you can also enter the series as "p*" and " rf mk f*" (without the quotes).
By the way, you can also enter the series as "p*" and " rf mk f*" (without the quotes).
Re: FamaMacBeth regression
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 addin from the site using Eviews's "Download addins" ?
Thanks,
QH
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 addin from the site using Eviews's "Download addins" ?
Thanks,
QH
Last edited by quachhao on Thu May 15, 2014 4:42 am, edited 1 time in total.

 EViews Developer
 Posts: 98
 Joined: Thu Apr 18, 2013 8:37 am
Re: FamaMacBeth regression
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.
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.
Re: FamaMacBeth regression
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 FamaMacBeth 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_(t1) (r_t^M )))/(var(r_t^M E_(t1) (r_t^M ){c_t^ME_(t1) (c_t^M )}))
β^2i=(cov(c_t^iE_(t1) (c_t^i ),c_t^M E_(t1) (c_t^M )))/(var(r_t^M E_(t1) (r_t^M ){c_t^ME_(t1) (c_t^M )}))
β^3i=(cov(r_t^i,c_t^M E_(t1) (c_t^M )))/(var(r_t^M E_(t1) (r_t^M ){c_t^ME_(t1) (c_t^M )}))
β^4i=(cov(c_t^iE_(t1) (c_t^i ),r_t^M E_(t1) (r_t^M )))/(var(r_t^M E_(t1) (r_t^M ){c_t^ME_(t1) (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
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 FamaMacBeth 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_(t1) (r_t^M )))/(var(r_t^M E_(t1) (r_t^M ){c_t^ME_(t1) (c_t^M )}))
β^2i=(cov(c_t^iE_(t1) (c_t^i ),c_t^M E_(t1) (c_t^M )))/(var(r_t^M E_(t1) (r_t^M ){c_t^ME_(t1) (c_t^M )}))
β^3i=(cov(r_t^i,c_t^M E_(t1) (c_t^M )))/(var(r_t^M E_(t1) (r_t^M ){c_t^ME_(t1) (c_t^M )}))
β^4i=(cov(c_t^iE_(t1) (c_t^i ),r_t^M E_(t1) (r_t^M )))/(var(r_t^M E_(t1) (r_t^M ){c_t^ME_(t1) (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 Developer
 Posts: 98
 Joined: Thu Apr 18, 2013 8:37 am
Re: FamaMacBeth regression
I don't understand what you're asking. The addin will calculate the betas for you from your risk factors.
Re: FamaMacBeth regression
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
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 Developer
 Posts: 98
 Joined: Thu Apr 18, 2013 8:37 am
Re: FamaMacBeth regression
I can't help you with that. There are many possible risk factors and how you determine them is up to you.
Re: FamaMacBeth regression
Thank you for your quick reply.
One more question: all risk factors that are used as independent variables in the FamaMacBeth 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
One more question: all risk factors that are used as independent variables in the FamaMacBeth 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
Re: FamaMacBeth regression
Dear Rebecca,
this Addin 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 Addin (improve this Addin with additional method).
thank you for all your efforts, I'm really enjoy using this Addin .
Kind regards. metrix
this Addin 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 Addin (improve this Addin with additional method).
thank you for all your efforts, I'm really enjoy using this Addin .
Kind regards. metrix

 EViews Developer
 Posts: 98
 Joined: Thu Apr 18, 2013 8:37 am
Re: FamaMacBeth regression
Thanks for your feedback, but I have no immediate plans to enhance the addin. 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.
Re: FamaMacBeth regression
Dear Rebecca,
I'm not very expert in programming in eviews ,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.
I'm not very expert in programming in eviews ,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.
Who is online
Users browsing this forum: No registered users and 1 guest