【发布时间】:2018-05-11 15:09:24
【问题描述】:
我有以下类型的面板数据集。
> head(fund_panel)
month months fund_name return ex_mkt_ret id
1 1 01-1998 27four Shari'ah Active Eq. Prescient A1 NA -0.21268 1
2 2 02-1998 27four Shari'ah Active Eq. Prescient A1 NA 0.06325 1
3 3 03-1998 27four Shari'ah Active Eq. Prescient A1 NA -0.04369 1
4 4 04-1998 27four Shari'ah Active Eq. Prescient A1 NA -0.02485 1
5 5 05-1998 27four Shari'ah Active Eq. Prescient A1 NA -0.11840 1
6 6 06-1998 27four Shari'ah Active Eq. Prescient A1 NA -0.34746 1
R 使用包 plm 及其函数 pmg 显示以下 Fama-Macbeth 回归错误:
> fpmg <- pmg(return ~ ex_mkt_ret, fund_panel, index=c("month", "id")) ##Fama-MacBeth
Error in pdim.default(index[[1]], index[[2]]) :
duplicate couples (id-time)
In addition: Warning messages:
1: In pdata.frame(data, index) :
duplicate couples (id-time) in resulting pdata.frame
to find out which, use e.g. table(index(your_pdataframe), useNA = "ifany")
2: In is.pbalanced.default(index[[1]], index[[2]]) :
duplicate couples (id-time)
我通过互联网来解决这个问题,但我无法弄清楚。请,您的建议。
【问题讨论】:
标签: r panel-data plm