全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
814 0
2020-06-03
我是cross-sectional survey, survey里面的weight是probability weight.我试了一下代码,要么只能给我反馈出加权的频数,要么只能给加权的百分比,怎么可以output两者都包括进去啊。谢谢大神指点!

. svy:tab GEO_PRV,count percent format(%14.3gc)
(running tabulate on estimation sample)

Number of strata   =         1                 Number of obs     =     109,659
Number of PSUs     =   109,659                 Population size   =  30,590,780
                                               Design df         =     109,658

----------------------
Province  |
of        |
residence |
of        |
responden |
t         |      count
----------+-----------
NEWFOUND |    459,002
PRINCE E |    126,033
NOVA SCO |    813,406
NEW BRUN |    644,816
   QUEBEC |  7,078,749
  ONTARIO | 11,890,774
MANITOBA |  1,034,697
SASKATCH |    900,823
  ALBERTA |  3,510,293
  BRITISH |  4,037,462
    YUKON |     31,789
NORTHWES |     35,142
  NUNAVUT |     27,794
          |
    Total | 30,590,780
----------------------
  Key:  count     =  weighted count



. svy:tab GEO_PRV,obs percent format(%14.3gc)
(running tabulate on estimation sample)

Number of strata   =         1                 Number of obs     =     109,659
Number of PSUs     =   109,659                 Population size   =  30,590,780
                                               Design df         =     109,658

----------------------------------
Province  |
of        |
residence |
of        |
responden |
t         | percentage         obs
----------+-----------------------
NEWFOUND |        1.5       3,233
PRINCE E |       .412       1,821
NOVA SCO |       2.66       4,775
NEW BRUN |       2.11       3,350
   QUEBEC |       23.1      23,151
  ONTARIO |       38.9      32,928
MANITOBA |       3.38       5,443
SASKATCH |       2.94       4,646
  ALBERTA |       11.5      13,085
  BRITISH |       13.2      14,367
    YUKON |       .104         973
NORTHWES |       .115       1,008
  NUNAVUT |      .0909         879
          |
    Total |        100     109,659
----------------------------------
  Key:  percentage  =  cell percentage
        obs         =  number of observations

(第二个的count是没有加权过的)
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群