Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

re: st: Taking averages, etc.


From   David Airey <david.airey@vanderbilt.edu>
To   statalist@hsphsun2.harvard.edu
Subject   re: st: Taking averages, etc.
Date   Tue, 16 Dec 2003 17:19:22 -0600

Stata ignores missing observations when calculating the mean:

. list, mean

+---------+
| average |
|---------|
1. | 4 |
2. | . |
3. | 4 |
4. | 4 |
|---------|
Mean | 4 |
+---------+

Sometimes, you do have to be careful to use "if e(sample)". For example, if you wanted to compute model yhats on just those observations used in the model.

-Dave



Hello, everyone!

Can anyone tell me if it's possible to tell Stata to ignore missing
observations when computing averages, etc.? I think that if there is a
missing value in the observations considered, the average computed would
be then missing too... and I need it to intelligently choose how many
observations to use depending on whether observations are available,
etc.

Thanks!
Adrian
*
*   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