Hi
Du anyone know how to get the survey SDs (1.221283 og 1.405879) in the output below into eg a matrix:
Sample code are below.
Both after svy:mean and estat the same set of values are saved in e(V), but they aren't similar to anything in the output.
Kind regards nhb
Du anyone know how to get the survey SDs (1.221283 og 1.405879) in the output below into eg a matrix:
Over Mean Std. Dev.
value
F 2.276053 1.221283
M 2.47721 1.405879
value
F 2.276053 1.221283
M 2.47721 1.405879
Both after svy:mean and estat the same set of values are saved in e(V), but they aren't similar to anything in the output.
Kind regards nhb
Code:
clear * Generate data set obs 50 set seed 12345 generate sex = int(2 * runiform()) label define sex 0 F 1 M label values sex sex generate strata = int(3 * runiform()) label define strata 0 S1 1 S2 2 S3 label values strata strata generate value = sex * strata * runiform() + 4 * runiform() * Generate population totals and weights generate N = 8000*(strata == 0) + 4000*(strata == 1) + 11000*(strata == 2) bysort strata : generate w = N / sum((N < .)) bysort strata : replace w = w[_N] * Setting up svy svyset [pweight=w], strata(w) svy:mean value, over(sex) matlist e(V) estat sd matlist e(V)
Comment