Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: sample size reduced significantly


From   "Yu Chen, PhD" <[email protected]>
To   [email protected]
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 <[email protected]> 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
> [email protected]
>
>
> On 11 April 2013 21:16, Yu Chen, PhD <[email protected]> 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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index