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

From |
Jacob Wegelin <jwegelin@vcu.edu> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
st: sum of missing values returned as zero |

Date |
Fri, 3 Oct 2008 18:44:51 -0400 (EDT) |

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

jwegelin@vcu.edu 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/

**Follow-Ups**:**Re: st: sum of missing values returned as zero***From:*Maarten buis <maartenbuis@yahoo.co.uk>

**st: Re: sum of missing values returned as zero***From:*"Martin Weiss" <martin.weiss1@gmx.de>

- Prev by Date:
**st: RE: RE: Some Basic STATA Questions** - Next by Date:
**st: Re: sum of missing values returned as zero** - Previous by thread:
**Re: st: Problem with ultraedit and comments** - Next by thread:
**st: Re: sum of missing values returned as zero** - Index(es):

© Copyright 1996–2016 StataCorp LP | Terms of use | Privacy | Contact us | What's new | Site index |