Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Re: command option in ado programming


From   "Michael Blasnik" <[email protected]>
To   <[email protected]>
Subject   st: Re: command option in ado programming
Date   Mon, 17 Nov 2003 15:14:32 -0500

You can handle this with the following syntax trick

syntax varlist [if] [in], [translog(string) TRanslog2]

If someone type translog with no parentheses, then translog2 is set to
"translog2" and translog is blank.  If someone types translog(string) then
translog equals that string and translog2 is blank.  You need to make both
optional so that this works.  You could add some checking to see that they
selected at least one if you want.  You can then deal with the two options
as you like

Michael Blasnik
[email protected]

----- Original Message ----- 
From: "Eddy" <[email protected]>
To: <[email protected]>
Sent: Monday, November 17, 2003 2:24 PM
Subject: st: command option in ado programming


> Dear listers,
>
> I want to write an estimation command called "mymodel" for which I
> want all of the following syntax permissible:
>
>  (1) mymodel y x1 x2, translog
>  (2) mymodel y x1 x2, translog()
>  (3) mymodel y x1 x2, translog(homogeneous)
>
> where (1) and (2) estimate the same model, and (3) estimates a
> different model.
>
> I know how to make (2) and (3) work:
>
>    syntax varlist [if] [in], TRANSLOG(string)
>
> , but I don't know how to make (1) work side-by-side with (2) and
> (3). Any suggestion will be appreciated!
>
> Eddy
>


*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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