I have a time-series panel dataset which is structured in the following way:
df <- data.frame( year = c(2012L, 2013L, 2014L, 2012L, 2013L, 2014L, 20