Dear stata users,
I recently encountered a problem with quite a simple command. I wanted to calculate the means and standard deviations over a categorial variable. Additionally, I use weighted data, so I use svy.
My command looks like this:
svy: mean var1, over(var2)
estat sd
so far so good. however, I discovered that I am getting different SD values once I alter the command into the following:
svy: mean var1 if var2 == 0
estat sd
svy: mean var1 if var2 == 1
estat sd
It gives me the same means but more or less different SD values. However, this does not occur if I run the mean command without svy
Hence, I suspect the interaction of estat and svy may not run properly.
Of course, I'd like to know why this occurs. Further I would like to know which results may be more precise/ more reliable.
Thanks for your interest in this problem.
Jakob
I recently encountered a problem with quite a simple command. I wanted to calculate the means and standard deviations over a categorial variable. Additionally, I use weighted data, so I use svy.
My command looks like this:
svy: mean var1, over(var2)
estat sd
so far so good. however, I discovered that I am getting different SD values once I alter the command into the following:
svy: mean var1 if var2 == 0
estat sd
svy: mean var1 if var2 == 1
estat sd
It gives me the same means but more or less different SD values. However, this does not occur if I run the mean command without svy
Hence, I suspect the interaction of estat and svy may not run properly.
Of course, I'd like to know why this occurs. Further I would like to know which results may be more precise/ more reliable.
Thanks for your interest in this problem.
Jakob
Comment