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 at the end of May, and its replacement, statalist.org is already up and running.


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

st: RE: AW: Exclude some observations from a sample in a regression


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: AW: Exclude some observations from a sample in a regression
Date   Wed, 7 Apr 2010 10:29:28 +0100

But be careful. 

-if foreign- would also include any missings on -foreign-. 

-if foreign != 1- would do that too. 

Nick 
n.j.cox@durham.ac.uk 

Martin Weiss

In the case of a binary variable, you could use the shortcuts

sysuse auto, clear
regress price weight length if foreign
regress price weight length if !foreign

to include all foreign (first case) or domestic (second case) cars.

Claude Francoeur

Doing a regression, I would like to exclude a series of observations 
that are identified with a binary variable (=1). Could you let me know 
what the syntax would be, if it's doable?

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


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