Linked Questions

Popular Questions

Problems with plm, duplicate time id's error

Asked by At

I am running a fixed effects regression and am getting the following error:

fixed_effects <- plm(GNI ~ lag(GNI) + imposition + ExpImp + democ, 
data = sanctions_data6, index = c("country", "sanctions_period"), model =
"within", effect = "twoways")

duplicate couples (time-id)
Error in pdim.default(index[[1]], index[[2]]) : 

I am aware that it means that i have duplicate time periods for the same observations. However the whole observations are not duplicates of each other as they represent different types of sanctions imposed.

           country        sanctions_period     sanction_type
             (chr)            (chr)            (int)
1          Afghanistan        1995-2002          4
2          Afghanistan        1995-2002          7
3          Afghanistan        1995-2002          NA

How can i get around this problem and run a regression in order to see the results? Thanks!

Related Questions