Skip to content
All library documents

Estimating Fama–MacBeth Risk Premia from Stock Betas

Article Quant Q&A · Author: dealo

Summary

The document describes a two-step Fama–MacBeth procedure for estimating risk premia. First, each stock’s return is regressed on a market index to estimate its market beta. The second step is a cross-sectional regression for each date, using the stock betas to explain that day’s returns and estimate a time-varying risk premium.

The question arises from trying to regress a matrix of daily returns on a vector of one beta per stock, which produces a length mismatch in R. The material clarifies the intended structure: the second-stage observations are stocks within each date, and the procedure is repeated across dates. It identifies the modeling issue but does not provide a complete R implementation or discuss inference, standard errors, or practical choices such as rolling versus full-sample beta estimation.

Key ideas

  • The first-stage time-series regression estimates one market beta for each stock.
  • The second-stage regression is cross-sectional across stocks and is repeated for each date.
  • A vector of stock-level betas does not directly align with a matrix of daily returns in a single R regression.
  • The procedure’s objective is to estimate a date-specific risk premium and stock-specific pricing errors.

Tags

Full text
# 25004


# Cross-sectional Regression: Using calculated coefficient of first regression for a second regression as dependent variable












Hello stackexchange community!

I am new to R and econometrics and and stuck in a step of the fama-macbeth (1973) regression, in which risk premia of stocks are estimated with a two-step regression procedure.

The first regression looks like the following:

Rit = αi + βiRmt + εit ......(1)

where i = 1,...,20 stocks and Rm is the return of the market index (often referred to as factor in regressions)

The β in here, of which I have 20 (one for each stock), is the coefficient I want to use in the second regression, which is a cross-sectional regression:

Rit = γt βˆi + αit .............(2)

where again i = 1,...,20 stocks. I am supposed to get one γt (risk premium) per day(4500) and 20 αit (pricing errors) per day.

Now to my issue: The first regression was no problem. I have one .xts object (stocks.returns) with 20 stocks in the columns and 4500 rows, which are daily returns of each stock. Then I have another .xts object (index.returns) with the same attributes, but just one column which is the market index. With this data I run the following codes in order to get the betas:

```
all.betas <- coef(lm(stocks.returns ~ index.returns))
all.betas <- all.betas[2,1:20]
```

now I have a numeric vector with all 20 betas (removed the intercept) per stock and I want to run the second (2) regression and am trying the code:

```
summary(lm(stocks.returns ~ all.betas))
```

However, R keeps giving me this error:

> Error in model.frame.default(formula = stocks.returns ~ all.betas, drop.unused.levels = TRUE) : variable lengths differ (found for 'all.betas')

I need to run a regression with all 20 stock returns against all 20 betas on each day (4500). I do not know how to structure this regression model/code.

I have been trying and searching for days now. Please help me. Any hints, errors I made, formulas I could try, literature, links, keywords etc. are highly appreciated!

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.