mean of single variable and multiple variables

6 views
Skip to first unread message

Seungmin Lee

unread,
Jun 10, 2013, 3:41:19 PM6/10/13
to income-dynam...@googlegroups.com
I try to find mean values of a few different variables at the same time,

The problem is, STATA gives different mean values when I type commands differently.



For example, I try to find mean values of v8, v10, v12 of deck 2, hh82

If I type "mean v8", it gives 240.9 from 2381 observations

If I type "mean v12", it gives 329.0 from 3869 observations,

However, if I type "mean v8 v12", it gives 240.1, 363.9 from 2380 observations, which are different from previous two mean values.




Why does it happen? How should I handle this?






Jia De Gedeon Lim

unread,
Jun 10, 2013, 5:15:39 PM6/10/13
to income-dynam...@googlegroups.com
Hi Seungmin,

So that's your answer. Stata ignores missing values when computing means. The command "mean v8 v12" tells Stata to evaluate the mean of variable v8 & v12 individually over the observations for which BOTH v8 and v12 are non-missing. So mean v8 v12 is working on a subset of 2380 observations for which both v8 and v12 are non-missing.
Reply all
Reply to author
Forward
0 new messages