可以试一下以下例子,试着找找看是否有重复
dat <- data.frame(y= rnorm(7), x = rnorm(7), stno = rep(1:2, c(3, 4)),
year = c(2001:2003, 2001, 2001:2003))
pdat <- plm.data(dat, c("stno", "year"))
plm(y ~ x, data = pdat)
To find out which IDhas duplicated times, you can do something like:
with(pdat, levels(stno)[tapply(year, stno,
function(x) any(table(x) > 1))])
根据你的数据参考:http://stackoverflow.com/questions/15960129/r-plm-year-fixed-effects-year-and-quarter-data