The only way I can see to jointly test whether a list of variables are all missing is to include each variable in a separate missing() function, which can be pretty verbose,
I know I could easily assess whether at least one variable is missing,
It is also easy to test whether zero variables are missing,
What I want to know is whether there is a more concise way to create the same effect as the first code block? As previous posts have pointed out, there is no way to create a user-defined function like missing() since it is part of the executable, but I was curious if someone has devised any other method to accomplish this task, ideally in a list-like fashion as in the second and third code block.
Code:
gen x = 1 if mi(var1) & mi(var2) & mi(var3) & mi(var4) & mi(var5) & mi(var6) & mi(var7)
Code:
gen x = 1 if mi(var1, var2, var3, var4, var5, var6, var7)
Code:
gen x = 1 if ~mi(var1, var2, var3, var4, var5, var6, var7)
Comment