Bookmark and Share

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


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

st: Substituting an expression into an -IF- conditional statement


From   Jason Park <loooooo.j8311@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: Substituting an expression into an -IF- conditional statement
Date   Fri, 6 Dec 2013 22:41:18 +0800

Hi,

I'd like to split the data sample into (1) date <= 10, (2) date > 10 &
date <= 20, and (3) date > 20, and for each case, I need to run a VAR
command.
Of course, it can be run by submitting the following three lines separately:
var a b c if date <= 10, lags(1/2)
var a b c if date > 10 & date <= 20, lags(1/2)
var a b c if date > 20, lags(1/2)

But instead, I'd like to loop through them. Can I?

Thanks in advance,
J
*
*   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/


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