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]

Re: st: sample size reduced significantly


From   "Yu Chen, PhD" <profyuchen@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: sample size reduced significantly
Date   Fri, 12 Apr 2013 11:16:56 -0500

Thank you, Nick.


On Thu, Apr 11, 2013 at 6:36 PM, Nick Cox <njcoxstata@gmail.com> wrote:
>
> Values must be non-missing for all variables entered in a regression;
> otherwise observations will be excluded. After your regression
>
> . regress <whatever>
>
> You can identify the excluded values
>
> . gen excluded = !e(sample)
>
> and then look for missings in the excluded
>
> . egen nmissing = rowmiss(<whatever>) if excluded
> . tab nmissing
>
> Here <whatever> is whatever varlist you used for -regress-.
>
> Nick
> njcoxstata@gmail.com
>
>
> On 11 April 2013 21:16, Yu Chen, PhD <profyuchen@gmail.com> wrote:
>
> > I have several variables with each of them having at least 6000
> > observations (non-missing values). However, when I put them into OLS
> > regression, the number of observations reduced to only about 1000. I
> > cannot figure out what causes the problem. Could you please help me
> > find out the causes? What code can I use to analyze the problem?
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


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