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

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

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

Subject |
RE: st: SUM question |

Date |
Fri, 16 May 2008 07:37:30 -0700 |

-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/ _____________________________________________________________________ Mensaje analizado y protegido por Telefonica Empresas * * 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/ Privileged, confidential or patient identifiable information may be contained in this message. This information is meant only for the use of the intended recipients. If you are not the intended recipient, or if the message has been addressed to you in error, do not read, disclose, reproduce, distribute, disseminate or otherwise use this transmission. Instead, please notify the sender by reply e-mail, and then destroy all copies of the message and any attachments. * * 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: Adding cumulatively** - Next by Date:
**st: RE: Stata and R** - Previous by thread:
**RE: st: SUM question** - Next by thread:
**Re: st: SUM question** - Index(es):

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