Hi, below is the first few lines of my data editor for my panel data showing the id and year variables. The panel is 5 years from 2013 to 2017, and each ID should have 5 observations for each 5 years, however some ids are not in the data 5 times, meaning the panel is unbalanced. Is there a command which I can use to remove all IDs (the whole line of data not just the ID) for any ids which are not in all 5 years of the dataset.
Thanks,
id year
22445 2013
22445 2014
22445 2015
22445 2016
22445 2017
29925 2014
29925 2015
29925 2016
Thanks,
id year
22445 2013
22445 2014
22445 2015
22445 2016
22445 2017
29925 2014
29925 2015
29925 2016

Comment