Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: variable mean and r(mean), why do they differ?


From   "Raoul C Reulen" <r.c.reulen@bham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: variable mean and r(mean), why do they differ?
Date   Fri, 25 Nov 2005 08:42:51 -0000

Dear Statalisters,

 

If I want to save the mean of a variable into a new variable, I would first:

 

.sum var1

.gen var2, r(mean)

 

But if I subtract var1-var2, the outcome is almost, but not exactly "0". How can make sure that both means are equal? I have tried .round, .int. , but that doesn't work. Do I have to change the storage type? Thanks for the advice.

 

Raoul

 


*
*   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/



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