Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: macro for all arguments after the first


From   Jacob Wegelin <[email protected]>
To   [email protected]
Subject   st: macro for all arguments after the first
Date   Fri, 9 Jan 2009 19:06:09 -0500 (EST)


Inside a program, I would like to differentiate between the first argument and all the other arguments--just as the regression functions do.  Just as with regression functions, I would like to pass an arbitrary number of arguments (mininum 2) to this program. Thus, is there a straightforward macro for "all subsequent arguments after the first"?  I mean code sort of like the following:

program mine
   /* Some kind of introductory material: an appropriate - syntax -  command? */
   regress `1' `all_subsequent_arguments'
   /* More code */
end

Thanks for any tips. This must be well-known and obvious and the answer probably lies in plain sight in [P] syntax or in the nc151 lecture notes, but I have not found it yet in those references.

Jake Wegelin

P.S. I do know that `0' means all arguments (confirmed below); I just don't know how to get all arguments *but* the first.

capture program drop callROCtab
program define callROCtab
   di "Response is `1'"
   di "First predictor is `2' "
   di "All arguments are `0'"
end





© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index