Hi! I am in need of some help. When attempting to perform a Fama-MacBeth regression analysis on monthly excess stock returns in R with the pmg()-function retrieved from the plm-package I am getting the following error message:
"Error in pmg( : Insufficient number of time periods"
Below is the command I am trying to run:
fpmg <- pmg(R ~ LotteryDummy + mkt + smb + hml + Log_mktcap + bm + LaggedR,
ff.lottery_premiums, index = c("date", "permno"))
My dataset is balanced with 1 473 127 observations of American stocks, with variables such as date, permno (firm identifier), MthlyExcessReturn, MthlyMKT, MthlySMB, MthlyHML, IVOL, ISKEW, Log_MktCap, B/M and Lagged6MthlyReturn, LotteryPortfolioDummy and PortfolioSort (See enclosed photo!). I need to run the cross-sectional Fama-MacBeth to get the coefficient of the LotteryDummy over time (representation of lottery premiums)
I have tried to search the internet for any suggestions, but can't seem to find any meaninful explanation to what is causing this error message?
I have checked for NAs and ensured that there are no duplicate observations of "date-permno".
Any help would be greatly appreciated! Thank you in advance.