Greetings. Don't know how to better name this query ...
The help entry gives us some indication of how to address variables, including list of variables as in myvar1-myvar6. Now it does note there, that that only "probably" expands to myvar1, myvar2, ..., myvar6.
Here's the query. When having a humongous list of variables that one wants to e.g.
that don't work, promting a type mismatch r(109) error; but
does (so commands such as egen aren't completely agnostic in respect to naming conventions/possibilities).
So I wouldn't be very fond of having to write out all those variables ... Anyone out there that knows one of "those" secret workarounds? Doing it per foreach would just be too simple ;-)
Cheers!
The help entry gives us some indication of how to address variables, including list of variables as in myvar1-myvar6. Now it does note there, that that only "probably" expands to myvar1, myvar2, ..., myvar6.
Here's the query. When having a humongous list of variables that one wants to e.g.
Code:
egen _grandtotal = rowtotal(myvar1-myvar323 myvar4039 myvar5000-5032)
Code:
egen _grandtotal = rowtotal(myvar*)
So I wouldn't be very fond of having to write out all those variables ... Anyone out there that knows one of "those" secret workarounds? Doing it per foreach would just be too simple ;-)
Cheers!
Comment