Hello,

I have a panel dataset (2013-2018) in which I want to delete all observation of which I do not have all the observations needed to perform my regression. However, I regress the independent variables of last year on the dependent variable, which means that I have to set 3 different conditions to keep observations:
- for 2013: drop observations for which not all independent variables are available
- for 2014-2017: drop observations for which not all independent variables and the dependent variable is not available
- for 2018: drop only if the dependent variable is not available

I have tried several possibilities by creating conditions within the keep command or by using command egen. However, I do not seem to succeed. Do you have any recommendations? Please let me know if you need any additional information.

Thank you very much.

Kind regards,
Timea