Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

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

RE: st: passing an equation list?

From   Sun Yutao <>
To   <>
Subject   RE: st: passing an equation list?
Date   Sun, 14 Oct 2012 13:08:37 +0200

Thanks Maarten,

I finally went into this string solution. Because I do not yet know how many equations there will be and I want to keep the program flexible.

Thank you!

Best regards,
Sun Yutao

-----Original Message-----
From: [] On Behalf Of Maarten Buis
Sent: Saturday, October 13, 2012 10:20 PM
Subject: Re: st: passing an equation list?

On Sat, Oct 13, 2012 at 9:31 PM, Sun Yutao <> wrote:
> Does anyone know how to pass an equation list : (fist: y=x) (second: x=z) .... into a stata "program"?

That depends on the program, the exact form of the functions, how general you want it to be, etc. etc. One possibility is to have it all in one string and start parsing on the brackets, you would need a way of distinguishing between brackets that are part of the equation and brackets that are deliminating different equations, but with some careful thought that can be done. Alternatively you can let each equation be an option. This can be especially attractive if there is a known (maximum) number of equations.

You can always take a look inside other programs that allow multiple equations, and see how they handle those: e.g. -heckman- could be an example where the different equations are handled through an option and a regular varlist or -sureg- is an example where the equations are deliminated with brackets. To look inside programs you can use -viewsource-.

Hope this helps,

Maarten L. Buis
Reichpietschufer 50
10785 Berlin
*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index