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

st: scalar troubles?


From   Edwin Leuven <e.leuven@uva.nl>
To   statalist@hsphsun2.harvard.edu
Subject   st: scalar troubles?
Date   Wed, 05 Nov 2003 14:51:31 +0100

dear all,

running one of my ado's i get the following table

-----------------------------------------------------------------
| Mean % reduct
Variable Sample | Treated Controls % bias |bias|
------------------------+----------------------------------------
Ltaal Unmatched | 0 -.547782 118.0
Matched |-.7002011 -.6988459 -0.3 99.8
-----------------------------------------------------------------

the unmatched mean among the treated should not be zero however

the piece of code that calculates it is simply

qui sum `v' if `treated'==1

which gives, when i remove the -qui-, the following

Variable | Obs Mean Std. Dev. Min Max
-------------+--------------------------------------------------------
Ltaal | 296 -.7002011 .4792868 -2.157421 .846165

then i do this

scalar m1 = r(mean)
scalar v1 = r(Var)

and adding this as a check:

di m1

gives

0

!!

if i change the name of the scalar to m1x, everything works fine, ie the 0 becomes -.7002011

i am baffled...

does anyone know what i am doing wrong?

thanks a lot, edwin

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