I am trying to run a Fama Macbeth analysis in R, where I am using the 'pmg' function with the following code:

Fpmg1 <- pmg(ret ~ HML_OBS + SMB + Mktrf + HML, Analysis4_Weighted, index = c("permno"))

I currently have 1,354,623 entries and 11 total columns. I get the below output where the estimates for my coefficients are NA.

Mean Groups model

pmg(formula = ret ~ HML_OBS + SMB + Mktrf + HML, data = Analysis4_Weighted, 
    index = c("date", "permno"))

Unbalanced Panel: n = 295, T = 3567-6287, N = 1349058

     Min.   1st Qu.    Median      Mean   3rd Qu.      Max. 
-1.065356 -0.077703 -0.008573  0.000000  0.060437 19.741368 

             Estimate Std. Error z-value Pr(>|z|)   
(Intercept) 0.0110395  0.0034105   3.237 0.001208 **
HML_OBS            NA         NA      NA       NA   
SMB                NA         NA      NA       NA   
Mktrf              NA         NA      NA       NA   
HML                NA         NA      NA       NA   
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Total Sum of Squares: 50764
Residual Sum of Squares: 45906
Multiple R-squared: 0.0957

I have sorted on the following before running the model:

Analysis4_Weighted <- 
  Analysis4_Weighted %>%

Analysis4_Weighted <- 
  Analysis4_Weighted %>%

Analysis4_Weighted <- 
  Analysis4_Weighted %>%
  group_by(date) %>%
  dplyr::filter(n() > 10)

Do you know why I do not get any coefficient estimates?

My data consists of various returns on different stocks in a long time period, and I trying to test the coefficients' ability to predict stock returns over the period across various stocks.

Thank you!

  • 1
    $\begingroup$ Hard to say without your data, could you make a reproducible example? $\endgroup$
    – Bob Jansen
    Commented Mar 10, 2021 at 19:16
  • $\begingroup$ I have exactly the same problem when running a Fama-MacBeth Regression (with 'pmg'). Did you find a solution? $\endgroup$ Commented Dec 22, 2021 at 10:27

1 Answer 1


I believe your regression is wrong. When I did Fama-French in R, my regression was not nearly as simple as yours. Check that you are regressing the right things and making the proper comparisons between variables. Look up "Modern Portfolio Theory" textbook for a better quant understanding.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.