備忘録

ただの覚え書き

Stataで分位点

任意の分位点を求めるコマンド.

 

centile data

オプションを何もつけない場合,中央値が返る.

例えば

centile data, c(25(25)75)

とすると,

25パーセンタイル,中央値,75パーセンタイルが返る.

return list

で格納されている内容が見れる.

centile data, c(25(25)75)
                                                       -- Binom. Interp. --
    Variable |     Obs    Percentile    Centile        [95% Conf. Interval]
-------------+-------------------------------------------------------------------------
         data |    91,745       25        5.138777        5.129932    5.149796
             |                          50        5.801822        5.795021    5.806955
             |                           75       6.383159        6.375229    6.390499
 
return list
scalars:
             r(n_cent) =  3
                  r(N) =  91745
               r(ub_3) =  6.390498560950016
               r(lb_3) =  6.375229346860805
                r(c_3) =  6.383158922195435
               r(ub_2) =  5.806954774003484
               r(lb_2) =  5.795020611195657
                r(c_2) =  5.801821708679199
               r(ub_1) =  5.149796162166735
               r(lb_1) =  5.129932119581634
                r(c_1) =  5.138776779174805
macros:
           r(centiles) : "25 50 75"