Good afternoon,
I am using survey data and because I need to account for the sampling & pweights, I'm using svy command for my analysis. I am wondering how to correctly obtain the median values. Currently, I am using epctile (sample code below), but the median value I am obtaining is outside of the 95% CI range I get within the weighted mean in the svy command, even though it allows me to apply the pweights. This seems odd, though one option I thought would be to report the 95% CI of both the mean and median separately. Any insights would be incredibly welcome!
. svy, subpop(if analytical_pop==1 & first_cancer==wave): mean percent_asset_change1
(running mean on estimation sample)
Survey: Mean estimation
Number of strata = 51 Number of obs = 15,736
Number of PSUs = 102 Population size = 71,582,508
Subpop. no. obs = 263
Subpop. size = 892,926
Design df = 51
-----------------------------------------------------------------------
| Linearized
| Mean Std. Err. [95% Conf. Interval]
----------------------+------------------------------------------------
percent_asset_change1 | .0203422 .5888416 -1.161807 1.202491
-----------------------------------------------------------------------
Note: 20 strata omitted because they contain no subpopulation members.
. epctile percent_asset_change1 if analytical_pop==1 & first_cancer==wave [pweight=pre_rwtresp], p(50)
Percentile estimation
------------------------------------------------------------------------------
percent_as~1 | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
p50 | -.0451306 .0387276 -1.17 0.244 -.1210354 .0307741
------------------------------------------------------------------------------
Related Posts with Finding Median for weighteds survey data
cluster on firm or two-way level?Hello all, If the model is y_it = x1_it + x2_it + x3_t + e_it, which means there is a time-serial v…
can we generate 0,1 and missing values simutaneously? Code: gen A = B==0 & C==1 replace A = . if B== .| C==. In other words, can we simplify the two …
Obtain new variable after 3 consecutive signals and generate new values after 6 and 8 periodsHi! With the variable buy_signal I've created buy signals. I have the following rule after which I w…
Bayesian regression analysis with sampling weightHi all Does anyone know if I could do Bayesian regression analysis with sampling weight? I have got …
r(1400) after meglmHi together, I tried to use meglm models according to this tutorial: https://stats.idre.ucla.edu/st…
Subscribe to:
Post Comments (Atom)
0 Response to Finding Median for weighteds survey data
Post a Comment