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

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

Re: Fama-MacBeth regression

Postby metrix » Mon Jul 28, 2014 9:33 am

I thought that this line

Code: Select all

equation {%subcsavg}.ls(cov=hac) avgrets c betag
I have change it by this code (Ref: EViews 8 command ref pp 382 Panel LS Options)

Code: Select all

equation {%subcsavg}.ls(wgt=cxsur) avgrets c betag
but an error message appear.
I don't know what to say :| thanks for the help.
Attachments
figur111.png
figur111.png (45.84 KiB) Viewed 22197 times

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13586
Joined: Tue Sep 16, 2008 5:38 pm

Re: Fama-MacBeth regression

Postby EViews Gareth » Mon Jul 28, 2014 10:01 am

You don't have a panel.

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

Re: Fama-MacBeth regression

Postby metrix » Mon Jul 28, 2014 10:19 am

no idea :oops: , can you help me.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13586
Joined: Tue Sep 16, 2008 5:38 pm

Re: Fama-MacBeth regression

Postby EViews Gareth » Mon Jul 28, 2014 10:31 am

Looks like the subroutine FMB is the part that does the calculations. The line:

Code: Select all

rowplace(g, @transpose(@inverse(@transpose(design) * design) * @transpose(design) * retvec), j)
is the one that performs OLS and puts the row of coefficients into the matrix g. Just change that line to do whatever calculation you want, instead of OLS.

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

Re: Fama-MacBeth regression

Postby metrix » Fri Aug 01, 2014 2:14 pm

thanks for your help Mr Gareth.

mick1987
Posts: 5
Joined: Sat Aug 02, 2014 9:31 am

Re: Fama-MacBeth regression

Postby mick1987 » Sun Aug 03, 2014 12:01 pm

Hi, I would like some tips on how to modify the fama-macbeth code such that I also get the R squared of the regression. Thanks in advance!

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13586
Joined: Tue Sep 16, 2008 5:38 pm

Re: Fama-MacBeth regression

Postby EViews Gareth » Sun Aug 03, 2014 2:18 pm

Which regression?

mick1987
Posts: 5
Joined: Sat Aug 02, 2014 9:31 am

Re: Fama-MacBeth regression

Postby mick1987 » Mon Aug 04, 2014 12:35 am

The second regression where the cross-sectional regression is done.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13586
Joined: Tue Sep 16, 2008 5:38 pm

Re: Fama-MacBeth regression

Postby EViews Gareth » Mon Aug 04, 2014 4:23 am

It isn't currently covered by the add-in. As mentioned a few posts above, there is a single subroutine that currently performs the least squares regression (and does so using matrix objects rather than the built-in estimation routines). You would have to modify that subroutine to also calculate, and store, the R-squared.

mick1987
Posts: 5
Joined: Sat Aug 02, 2014 9:31 am

Re: Fama-MacBeth regression

Postby mick1987 » Mon Aug 04, 2014 5:42 am

Thanks. I have tried to understand how the rolling add-in function in eviews works and also tried to implement it. Do you think I can apply the same method as in the roll code for the add-in?

mick1987
Posts: 5
Joined: Sat Aug 02, 2014 9:31 am

Re: Fama-MacBeth regression

Postby mick1987 » Mon Aug 04, 2014 5:53 am

Sorry for the diffusing question.. what I'm asking about is that the roll add-in function reports the r squares.. can I use their way to get the r square incorporated into the fama-macbeth add-in??

mick1987
Posts: 5
Joined: Sat Aug 02, 2014 9:31 am

Re: Fama-MacBeth regression

Postby mick1987 » Mon Aug 04, 2014 5:57 am

Also I have a question regarding the second table output from the add-in function, are the betas reported in table 2 average betas from the first regression?

Maverick
Posts: 8
Joined: Sun Aug 03, 2014 12:09 pm

Re: Fama-MacBeth regression

Postby Maverick » Mon Aug 04, 2014 8:53 am

Hi, I also need to incorporate r square into the code. I understand the first part of the fmb subprogram, but not the following part of the operation in the program:

@transpose(@inverse(@transpose(design) * design) _
* @transpose(design) * retvec)

If someone can help me understand this part it would be really appreciated! Thanks in advance! Also I would like to know if this sign: _ has a meaning in the code?

Maverick
Posts: 8
Joined: Sun Aug 03, 2014 12:09 pm

Re: Fama-MacBeth regression

Postby Maverick » Mon Aug 04, 2014 8:58 am

Also it would be nice to understand the purpose of design=1 in the below code?

matrix(n_p, n_f + 1) design = 1

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

Re: Fama-MacBeth regression

Postby EViews Rebecca » Mon Aug 04, 2014 9:30 am

Also I have a question regarding the second table output from the add-in function, are the betas reported in table 2 average betas from the first regression?
They are betas from a second regression that use the betas from the first timeseries regression as regressors. See equation 4 in the documentation for more details.


Return to “Add-in Support”

Who is online

Users browsing this forum: No registered users and 2 guests