I am creating a flag to identify a subset of the sample that has non-missing data for several variables
This is my code:
This code runs well but if I have more variables, is there a more efficient way to write the code so that I don't have to keep writing "var!=. & var2!=. & var3!=." ?
Im doing this to keep my analytic sample consistent when comparing models
Thanks in advance!
This is my code:
Code:
gen flag=1 if sex!=. & age!=. & marstat!=. & ownership
Im doing this to keep my analytic sample consistent when comparing models
Thanks in advance!
Comment