Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Billy Schwartz <wkschwartz@gmail.com> |
To | statalist@hsphsun2.harvard.edu |
Subject | st: Understanding the mechanics of the sum() function |
Date | Sun, 13 Nov 2011 17:14:08 -0500 |
Is there a difference between . generate y = `a' + `b' * sum(`exp') and . generate y = . . replace y = `a' + `b' * (`exp' + cond(missing(y[_n-1]), 0, y[_n-1])) where `a', `b', and `exp' are arbitrary Stata expressions? If they're not the same, is there a way of modifying the second to make it the same as the first? (If they're the same in effect, is one faster than the other?) * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/