The Fama-McBeth (1973) regression is a two-step procedure . The first step involves estimation of N cross-sectional regressions and the second step involves T time-series averages of the coefficients of the N-cross-sectional regressions. The standard errors are adjusted for cross-sectional dependence. This is generally an acceptable solution when there is a large number of cross-sectional units and a relatively small time series for each cross-sectional unit. However, if both cross-sectional and time-series dependencies are suspected in the data set, then Newey-West consistent standard errors can be an acceptable solution.

## Estimation Procedure

The Fama-McBeth (FMB) can be easily estimated in Stata using asreg package.  Consider the following three steps for estimation of FMB regression in Stata.

1.  Arrange the data as panel data and use xtset command to tell Stata about it.

2.  Install asreg from ssc with this line of code:

`ssc install asreg`

3. Apply asreg command with fmb option

## An Example

We shall use the grunfeld dataset in our example. Let’s download it first:

`webuse grunfeld`

This data is already xtset, with the following command:

`xtset company year`

Assume that we want to estimate a FMB regression where the dependent variable is invest and independent variables are mvalue and kstock. Just like regress command, asreg uses the first variable as dependent variable and rest of the variables as independent variables. Using the grunfeld data, asreg command for FMB regression is given below:

`asreg invest mvalue kstock, fmb`
``` Fama-MacBeth (1973) Two-Step procedure Number of obs = 200  Num. time periods = 20
F( 2, 19)         = 195.04
Prob > F          = 0.0000
avg. R-squared    = 0.8369
------------------------------------------------------------------------------
|            Fama-MacBeth
invest | Coef.      Std. Err.     t         P>|t|   [95% Conf. Interval]
-------------+----------------------------------------------------------------
mvalue | .1306047      .0093422   13.98     0.000   .1110512   .1501581
kstock | .0729575      .0277398   2.63      0.016   .0148975   .1310176
_cons  | -14.75697     7.287669  -2.02      0.057   -30.01024   .496295
------------------------------------------------------------------------------```

## Newey-West standard errors

If Newey-West standard errors are required for the second stage regression, we can use the option newey(integer).  The integer value specifies the number of lags for estimation of Newey-West consistent standard errors. Please note that without using option newey, asreg estimates normal standard errors of OLS. This option accepts only integers, for example newey(1) or newey(4) are acceptable, but newey(1.5) or newey(2.3) are not. So if we were to use two lags with the Newey-West error for the above command, we shall type;

```asreg invest mvalue kstock, fmb newey(2)
Fama-MacBeth Two-Step procedure (Newey SE)            Number of obs     = 200
(Newey-West adj. Std. Err. using lags(2))             Num. time periods = 20
F( 2, 19)         = 39.73
Prob > F          = 0.0000
avg. R-squared    = 0.8369
---------------------------------------------------------------------------------
|            Newey-FMB
invest | Coef.      Std. Err. t       P>|t|     [95% Conf. Interval]
-------------+-------------------------------------------------------------------
mvalue | .1306047  .0150138   8.70    0.000    .0991804   .1620289
kstock | .0729575  .0375046   1.95    0.067    -.0055406   .1514557
_cons  | -14.75697  8.394982  -1.76   0.095    -32.32787   2.813928
---------------------------------------------------------------------------------

```

For some reasons, if we wish to display the first stage N – cross-sectional regressions of the FMB procedure, we can use the option first. And if we wish to save the first stage results to a file, we can use the option save(filename). Therefore, commands for these options will look like:

```asreg invest mvalue kstock, fmb newey(2) first

asreg invest mvalue kstock, fmb newey(2) first save(FirstStage)
```

First stage Fama-McBeth regression results _TimeVar _obs _R2 _b_mva~e _b_kstock _Cons 1935 10 .865262 .1024979 -.0019948 .3560334 1936 10 .6963937 .0837074 -.0536413 15.21895 1937 10 .6637627 .0765138 .2177224 -3.386471 1938 10 .7055773 .0680178 .2691146 -17.5819 1939 10 .8266015 .0655219 .1986646 -21.15423 1940 10 .8392551 .095399 .2022906 -27.04707 1941 10 .8562148 .1147638 .177465 -16.51949 1942 10 .857307 .1428251 .071024 -17.61828 1943 10 .842064 .1186095 .1054119 -22.7638 1944 10 .875515 .1181642 .0722072 -15.82815 1945 10 .9067973 .1084709 .0502208 -10.51968 1946 10 .8947517 .1379482 .0054134 -5.990657 1947 10 .8912394 .163927 -.0037072 -3.732489 1948 10 .7888235 .1786673 -.0425555 8.53881 1949 10 .8632568 .1615962 -.0369651 5.178286 1950 10 .8577138 .1762168 -.0220956 -12.17468 1951 10 .873773 .1831405 -.1120569 26.13816 1952 10 .8461224 .1989208 -.067495 7.29284 1953 10 .8892606 .1826739 .0987533 -50.15255 1954 10 .8984501 .1345116 .3313746 -133.3931

## More on FMB regression

FMB regression – what, how and where

FMB regressions with 25-portfolios – An example

Rolling window statistics with asrol