|
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: sum of missing values returned as zero
The following code
clear
set obs 4
gen Finished=.
list
summarize Finished
return list
returns a value of zero for the sum of Finished, as is seen below. I do not understand. I would think that the sum of a list of numbers, at least one of which is missing, would be missing, not zero. Can someone explain?
. set obs 4
obs was 0, now 4
. gen Finished=.
(4 missing values generated)
. list
+----------+
| Finished |
|----------|
1. | . |
2. | . |
3. | . |
4. | . |
+----------+
. summarize Finished
Variable | Obs Mean Std. Dev. Min Max
-------------+--------------------------------------------------------
Finished | 0
. return list
scalars:
r(N) = 0
r(sum_w) = 0
r(sum) = 0
Thanks
Jacob A. Wegelin
[email protected]
Assistant Professor
Department of Biostatistics
Virginia Commonwealth University
730 East Broad Street Room 3006
P. O. Box 980032
Richmond VA 23298-0032
U.S.A.
http://www.people.vcu.edu/~jwegelin
*
* 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/