Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: re: excluding some cases for regression analysis


From   Kit Baum <[email protected]>
To   [email protected]
Subject   st: re: excluding some cases for regression analysis
Date   Mon, 25 Jul 2005 08:33:37 -0400

Alice said

I have an unbalanced panel of more than 3000 firms. The firms have been
assigned id from 1 to 3256.
I was wonderting if i could exclude some firms (say id 45 to 560) when I run
any regression. How could I do so?

g want = ~ inrange(_n,45,560)
regress .... if want

Note that the ~ is NOT, so this is "I want those not in range 45, 560".
If you had more than one such range, define the dummies in terms of those you do NOT want, add up those dummies, and NOT the result.

g nowant1 = inrange(45,90)
g nowant2 = inrange(101,120)
g nowant3 = inrange(131,500)
g want = ~ (nowant1+nowant2+nowant3)

Kit Baum, Boston College Economics
http://ideas.repec.org/e/pba1.html

*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index