I want to run the keep
command in a do-file in Stata 12:
keep a1 a2 a3 a4 a5 b1 b2 b3 b4 b5 c1 c2 c3 c4
What I want is to do the following:
keep {a1 a2 a3 a4 a5
b1 b2 b3 b4 b5
c1 c2 c3 c4}
I know the {} brackets don't do the trick but I'm looking for the command that does it. Using #delimiter ;
does not work either.
I want to do this because subgroups of variables have a relation among themselves (which I intended to signal above by using a
, b
and c
) and I want to have that clear in my code. I permanently add and delete variables. Note that I don't want to use the drop
command (in which case the solution is trivial).