Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

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

Re: st: Please regress if years>1993 & years<2010? The IF-Regression

From   Jeph Herrin <>
Subject   Re: st: Please regress if years>1993 & years<2010? The IF-Regression
Date   Wed, 19 Dec 2012 10:51:33 -0500

If you are looking for a way to set this up as a loop, I would usually do something like this:

 local cond1 inrange(year,1998,2004)
 local cond2 inrange(year,1996,2006)
 local cond3 inrange(year,1993,2009)

 forv c=1/3 {
	reg yvar xvar if `cond`c''


Jeph (one of the crowd)

On 12/19/2012 9:50 AM, Nick Cox wrote:
Use -if inrange(year, 1998, 2004)- or -if tin(1998, 2004)-.


We're individuals, not a crowd!

On Wed, Dec 19, 2012 at 2:44 PM, Barbara Engels <> wrote:
Dear crowd,

I have a rather "simple" problem which I cannot solve, however.

I have panet data and want to run a bunch of regressions. One regression is supposed to entail data from the years 1998-2004, the other from 1996-2006, another one 1993 to 2009, and so on.
How can I run these "IF" regressions?
*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index