[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

From |
Tim <lists@timbp.com> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: sum() returns different results every time, why? |

Date |
Sun, 02 Aug 2009 10:30:58 +1000 |

Tim Badgery-Parker lists@timbp.com Johanna Jiménez wrote:

Hi everyone, I have a question for you....I have executed this code using the same data, with 9940 observations, several times: sort decil rincome gen double rinc_exp= rincome * facexp egen double totrinc_exp = total (rinc_exp) gen double parting_exp= rinc_exp / totrinc_exp gen double acumparting_exp= sum(parting_exp) The problem is the last command. Each time I execute it, “acumparting_exp” changes, this means that the running sum of “parting_exp” varies for each observation each time I run my do-file. I don´t know why sum() is different every time. I have tried to change storage type of variables, drop some observations, but always occurs the same. Could someone help me, please? Probably, my question is a little silly, but I don’t understand what it’s happening and also, this has an effect on other commands and a bootstrap program I wrote. Besides, I executed these commands with other variables as expenditures and I didn’t have the problem I mentioned. Just with incomes, commands return something different every time. (Note: rincome and facexp are double (storage type of variables); and database is always the same.) I appreciate your help. Kind regards, Johanna J.

* * 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() returns different results every time, why?***From:*Johanna Jiménez <johannajimenezstata@gmail.com>

**References**:**st: sum() returns different results every time, why?***From:*Johanna Jiménez <johannajimenezstata@gmail.com>

- Prev by Date:
**st: sum() returns different results every time, why?** - Next by Date:
**Re: st: StataMP will not utilize multiple processors (Windows XP)** - Previous by thread:
**st: sum() returns different results every time, why?** - Next by thread:
**Re: st: sum() returns different results every time, why?** - Index(es):

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