r - Panel data models: Duplicate couples error when there are no duplicate couples -
i have panel data set individual (dyad_id), integer, , time (year_month) date variable. try running following code:
df.fe <- plm(deaths_civilians ~ deaths_a_lag + deaths_b_lag, data = rebel, index = c("dyad_id", "year_month"), model = "within", effect = "individual")
but keep getting following error message:
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 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) 3: in is.pbalanced.default(index[[1]], index[[2]]) : duplicate couples (id-time)
all previous answers question because have more 1 observation same id same time period, have checked , not case. have tried transforming both id , year_month different types of variables (factors, integers etc) nothing works.
i cannot provide reproducible data diagnose problem because final dataset result of merging 6 separate datasets, , 300 lines of code. however, able suggest potential reason problem , remedies?
Comments
Post a Comment