The Fama-MacBeth Method

The Fama-Macbeth regression method is a common empirical technique for estimating risk premiums in asset pricing models. It involves a two-step procedure that assumes a linear relation between the expected returns of assets and their exposures to (priced) risk factors. In the first stage, the returns of individual assets are regressed on their factor loadings or characteristics that proxy for factor exposure in each time period. In the second stage, the time-series averages of the regression coefficients are tested for statistical significance. In this study, I use individual stocks as test assets and examine the risk premiums associated with three characteristics: beta, log_mktcap, and B2M.

Loading required packages

library(tidyverse)
library(plm)
library(broom)
library(lmtest)
library(sandwich)

Individual assets return and charactrestics data

Tsedata = read.csv("main.csv")

fmdata = Tsedata %>% 
  select(tickerkey, persiandate, exreturn,beta, mktcap, B2M) %>% 
  drop_na() 

Step 1 : Cross-sectional Regression

Step 1 employs the exposures (characteristics) as independent variables in T cross-sectional regressions.

riskpremium  = fmdata %>% 
  nest(data = c(tickerkey, exreturn,beta, mktcap, B2M)) %>% 
  mutate(etimates = map(data,
                        ~tidy(lm(exreturn~ beta + mktcap + B2M , 
                                 data = .x)))) %>% 
  select(-data) %>% 
  unnest()

#output
head(riskpremium,4)

Step 2 : Time-Series Aggregation

In the second step, the estimates are aggregated across time to test if risk is priced

riskprice <- riskpremium %>%
  group_by(characteristics = term) %>%
  summarize(
    risk_premium = mean(estimate, na.rm = T) ,
    t_statistic = mean(estimate, na.rm =T) / sd(estimate,na.rm = T) * sqrt(n())
  )

print(riskprice)
## # A tibble: 4 × 3
##   characteristics risk_premium t_statistic
##   <chr>                  <dbl>       <dbl>
## 1 (Intercept)          0.129          3.47
## 2 B2M                  0.0439         2.26
## 3 beta                -0.00284       -1.35
## 4 mktcap              -0.00391       -3.19

Fama-Macbeth using pmg() in plm package

The Fama-Macbeth regression outcome can be obtained by applying the standard Mean Groups estimator. The pmg output shows that the results are consistent with Fama-Macbeth step2.

fm = pmg(exreturn ~ beta + mktcap + B2M, data = fmdata,
         index=c("persiandate","tickerkey"),model = "mg")

coeftest(fm)
## 
## t test of coefficients:
## 
##               Estimate Std. Error t value  Pr(>|t|)    
## (Intercept)  0.1285133  0.0370232  3.4712 0.0005188 ***
## beta        -0.0028393  0.0020978 -1.3535 0.1759126    
## mktcap      -0.0039093  0.0012266 -3.1871 0.0014383 ** 
## B2M          0.0438530  0.0194027  2.2602 0.0238172 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Result interpretation

The results can be interpreted as follows. There is a positive relation between book-to-market ratios and expected future returns, which confirms the value premium. The log market capitalization coefficient is negative, indicating the size premium for smaller stocks. No evidence of a beta premium is found.

sources: tidy-finance.org,r-bloggers.com