I have a dataset with several variables. I want to create a subsample which only includes the observations which have data for all variables, so no missing data in any of the variable.
I know about the dropmiss command in Stata but that does not apply here because I do not want to drop variables, but I want to drop the observations.
I found a question similar to mine in Stack Overflow, but the statistical program used there is SAS and I am using Stata. (SAS - Keeping only observations with all variables).
An example (the "." is a missing data):
ID year pension age gender
1 2006 300 54 F
2 2007 250 40 M
3 2006 . 45 M
4 2005 . . F
So in this case I only want to keep ID 1 and 2, and drop 3 and 4 from the sample since it contains missing data for some of the variables.