Dear all,
suppose an unbalanced panel data set reaching from 2010 to 2019 with around 390k observations (long format) and only three variables: "Person ID" (PID), "Income" and "year of survey" (syear). I wish to subset the data in a way that only the oversvations of individuals who gave an answer in 2010 and 2011 are kept in the dataframe.
I tried out different approaches, for example using inlist() combined with the unqiue PID's of 2010 and 2011 but ended up with several errors.
If anyone can come up with an easy solution I would be highly thankful!
Best regards,
Neil
suppose an unbalanced panel data set reaching from 2010 to 2019 with around 390k observations (long format) and only three variables: "Person ID" (PID), "Income" and "year of survey" (syear). I wish to subset the data in a way that only the oversvations of individuals who gave an answer in 2010 and 2011 are kept in the dataframe.
I tried out different approaches, for example using inlist() combined with the unqiue PID's of 2010 and 2011 but ended up with several errors.
If anyone can come up with an easy solution I would be highly thankful!
Best regards,
Neil
Comment