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" <[email protected]>
To   <[email protected]>
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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index