Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Re: saving a sample after a regression


From   Christer Thrane <lineea@broadpark.no>
To   statalist@hsphsun2.harvard.edu
Subject   st: Re: saving a sample after a regression
Date   Mon, 12 Mar 2007 20:52:06 +0100

reg y x z
reg y x if e(sample)

Christer
----- Original Message ----- From: "william.miles" <william.miles@wichita.edu>
To: <statalist@hsphsun2.harvard.edu>
Sent: Monday, March 12, 2007 8:47 PM
Subject: st: saving a sample after a regression



Hi-
I am running regressions with several variables, and not all observations have
data on all variables. I run a regression of Y on X, and use say 1,000
observations. Then I run a regression of Y on X and Z, and because not all
observations have Z, I only get a sample of 800 observations. Is there any
way to save the sample from the latter regression, so I can then run the
original regression of Y on only X, but using only the 800 observations that
include Z, without having to go throught the data by hand?
Thanks,
Bill

*
* 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/
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index