use "NPPR82FL.DTA"
* 8 implied decimals for hfs_mod and hfs_sev, but less 2 decimals to make it a percentage rather than a proportion - 6 zeros needed below
gen mod = hfs_mod/1000000
gen sev = hfs_sev/1000000
gen wgt = hv005/1000000 // 6 implied decimals for weight
* means
mean mod [iw=wgt] if hv102 == 1
mean sev [iw=wgt] if hv102 == 1
This gives the following results:
. mean mod [iw=wgt] if hv102 == 1
Mean estimation Number of obs = 54,144
--------------------------------------------------------------
| Mean Std. err. [95% conf. interval]
-------------+------------------------------------------------
mod | 12.48814 .1177041 12.25744 12.71884
--------------------------------------------------------------
. mean sev [iw=wgt] if hv102 == 1
Mean estimation Number of obs = 54,144
--------------------------------------------------------------
| Mean Std. err. [95% conf. interval]
-------------+------------------------------------------------
sev | 1.332236 .0349331 1.263767 1.400705
--------------------------------------------------------------
]]>