--- T.J. Volant wrote:
> I have a big data set and am trying to run regressions
> on various combinations of sections. Is there a way to
> do this w/out having to drop irrelevant observations
> every time?
> Example:
> A y1 x1
> A y2 x2
> B y3 x3
> B y4 x4
> C y5 x5
> C y6 x6
>
> Running y on x only for the A section without having
> to drop all B and C observations. Then regress y on x
> for AC, for AB, etc.
I am assuming that you have a variable called section,
which contains the strings A, B, or C.
to do the regression you requested you would type:
reg y x if section == "A"
reg y x if section == "A" | section == "C"
reg y x if section == "A" | section == "B"
For more info see: - help if- and -help operator-
hope this helps,
Maarten
-----------------------------------------
Maarten L. Buis
Department of Social Research Methodology
Vrije Universiteit Amsterdam
Boelelaan 1081
1081 HV Amsterdam
The Netherlands
visiting address:
Buitenveldertselaan 3 (Metropolitan), room Z434
+31 20 5986715
http://home.fsw.vu.nl/m.buis/
-----------------------------------------
*
* 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/