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

From |
"Nick Cox" <n.j.cox@durham.ac.uk> |

To |
<statalist@hsphsun2.harvard.edu> |

Subject |
RE: st: SUM question |

Date |
Thu, 15 May 2008 14:57:42 +0100 |

-viewsource _growtotal.ado- shows that treating missings as 0 is exactly what -egen, rowtotal()- does. Nick n.j.cox@durham.ac.uk David Bell You have surmised that -egen newvar = rowtotal(var1 var2)- treats missing values as zero. I do not believe this is strictly correct. The command just sums the values that it has (thus not using a variable in a sum is the same as treating it as zero). This is why I always use -rowmean- instead of -rowtotal-. Thus when there is a missing value, you get the mean of the remaining values (they are not treated as zeros). On May 15, 2008, at 12:31 AM, Yamamoto, Satomi wrote: > I think egen newvar = rowtotal(var1 var2) is equivalent to > replacing missing values with 0(zero). * * 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/

**References**:**st: SUM question***From:*"Yamamoto, Satomi" <syamamot@ad.uiuc.edu>

**Re: st: SUM question***From:*Richard Williams <Richard.A.Williams.5@ND.edu>

**RE: st: SUM question***From:*"Yamamoto, Satomi" <syamamot@ad.uiuc.edu>

**Re: st: SUM question***From:*David Bell <dcbell@iupui.edu>

- Prev by Date:
**st: Re: Re: GMM or 2SLS with cluster adjustment or others** - Next by Date:
**RE: st: SUM question** - Previous by thread:
**Re: st: SUM question** - Next by thread:
**RE: st: SUM question** - Index(es):

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