我試着用plm包進行R中的一些差異估計。正如標題中所述,我不知道如何將POSIX日期(如「2002-10-01」)轉換爲由plm時間索引理解的值。我想這意味着使用整數值?將POSIX datefield轉換爲plm接受的時間索引的最佳方式是什麼?
這裏是我試過到目前爲止:
panel.fd <- plm(y~X,index=c("datefield","id"),model="fd",data=z)
# returns
Error in pdim.default(index[[1]], index[[2]]) :
# when I convert my datefield to a factor, I get the same error...
z$t_idx <-as.factor(z$datefield)
`index`應該是一個日期向量。目前你正在提供一個角色矢量。 – 2011-02-03 01:15:19