Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | "G. Anderson" <ga274@cam.ac.uk> |
To | statalist@hsphsun2.harvard.edu |
Subject | Re: st: Rolling regression without "clear" |
Date | 13 Jun 2013 14:54:05 +0100 |
Works well. Thank you! On Jun 13 2013, Nick Cox wrote:
There is no difference in principle. Even if you have a stored scalar, say scalar foo = 42 you can supply its value like this ... , window(`=foo') so that what happens is 1. Stata sees the expression to be evaluated `=foo' -- goes then into a corner -- and comes back with the result of that evaluation, here 42 2. -rolling- itself sees -window(42)- and moves on. If your name could be confused with a variable name, then ..., window(`=scalar(foo)') disambiguates. Documentation starts at -help macro-, but you have to dig a bit deep to see it from documentation. For a local macro, ..., window(`foo') would work, but for a scalar, a beast of a different kind, syntax is slightly different. Nick njcoxstata@gmail.com On 13 June 2013 11:33, G. Anderson <ga274@cam.ac.uk> wrote:Great. Thanks Nick.Do you know whether it's possible to set the window size based on a stored scalar, rather than typing in the number?Thanks, Gareth On Jun 13 2013, G. Anderson wrote:Hi, I am using the "rolling" command in Stata 12 to do rolling regressions.However when I use rolling , window(150):regress depvar indvar I get the error message "no; data in memory would be lost" The only way I can get around this is by adding in the "clear" command, but this deletes all of my dataset, which is not ideal. Is there a way around this? Thanks, Gareth * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/faqs/resources/statalist-faq/ * http://www.ats.ucla.edu/stat/stata/* * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/faqs/resources/statalist-faq/ * http://www.ats.ucla.edu/stat/stata/* * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/faqs/resources/statalist-faq/ * http://www.ats.ucla.edu/stat/stata/
* * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/faqs/resources/statalist-faq/ * http://www.ats.ucla.edu/stat/stata/