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]

st: macro `if' in nonlinear least squares

From   Francesca Colantuoni <>
Subject   st: macro `if' in nonlinear least squares
Date   Thu, 2 May 2013 11:27:29 -0400

I am programming a nonlinear least square regression, and I am trying
to find the best way to do it based on variuos examples that I found

In the following code, I have trouble understanding what stata does
with the macro `if' at the end of the generate command. Would anybody
clarify that for me? I could not find an explanation for this use of
"if" in either [P] or [U] manual (or Google).

// Some temporary variables
    tempvar kterm lterm
    generate double `kterm' = `delta'*`capital'^(-1*`rho') `if'
    generate double `lterm' = (1-`delta')*`labor'^(-1*`rho') `if'

    // Now fill in dependent variable
    replace `logout' = `b0' - 1/`rho'*ln(`kterm'+`lterm') `if'

Best Regards,
*   For searches and help try:

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