井出草平の研究ノート

有病率の計算[Stata]

疫学調査で有病率を出す方法である。専門用語では母比率の推定という。日本語で母比率と言うとピンとこないが、英語だとpopulation rateなので、こちらの方が直感的に理解できるはずである。

Stataで有病率を推定する

Stataではcii propコマンドを使用する。

データは内閣府のひきこもり調査のものを利用しよう。

生活状況に関する調査 https://www8.cao.go.jp/youth/kenkyu/life/h30/pdf/kekka_gaiyo.pdf

この調査の結果は下記であった。

  • 有効回答者数 3248人
  • ひきこもり者数 47人
. cii prop 3248 47 , level(95)

                                                         -- Binomial Exact --
    Variable |        Obs  Proportion    Std. Err.       [95% Conf. Interval]
-------------+---------------------------------------------------------------
             |      3,248    .0144704    .0020954        .0106512    .0191966

日本の満40歳から満64歳までの人口は4235万人である。それぞれの値を人口に掛けると推定値と95%信頼区間が出てくる。

Proportion: 42350000 * .0144704 = 612821.4
95% CI Upper: 42350000 * .0106512 = 451078.3
95% CI Lower: 42350000 * .0191966 = 812976

よって推定値61.3万人、95%信頼区間45.1~81.3万人となる。

その他の推定方法

母比率の推定にはいくつか方法がある。

コマンド 説明
exact calculate exact confidence intervals; the default
wald calculate Wald confidence intervals
wilson wilson calculate Wilson confidence intervals
agresti calculate Agresti–Coull confidence intervals
jeffreys calculate Jeffreys confidence intervals

clopper-pearson正確法

デフォルトの設定で有病率である。F分布を使用する。 スクリプトは上段で示したものである。

f:id:iDES:20191030163802p:plain

wald法

本やウェブに掲載されているのはだいたいこの推定方法である。
wald法は正規分布を使用する。Stataでは wald法はデフォルトではないので、注意が必要かもしれない。

f:id:iDES:20191030163823p:plain

. cii prop 3248 47, wald

                                                         -- Binomial Wald ---
    Variable |        Obs  Proportion    Std. Err.       [95% Conf. Interval]
-------------+---------------------------------------------------------------
             |      3,248    .0144704    .0020954        .0103635    .0185774

wilsonのスコア法

f:id:iDES:20191030163844p:plain

. cii prop 3248 47, wilson

                                                         ------ Wilson ------
    Variable |        Obs  Proportion    Std. Err.       [95% Conf. Interval]
-------------+---------------------------------------------------------------
             |      3,248    .0144704    .0020954        .0108996    .0191884

agresti-coull法

f:id:iDES:20191030163903p:plain

. cii prop 3248 47, agresti

                                                         -- Agresti-Coull ---
    Variable |        Obs  Proportion    Std. Err.       [95% Conf. Interval]
-------------+---------------------------------------------------------------
             |      3,248    .0144704    .0020954        .0108602    .0192278

元論文
https://amstat.tandfonline.com/doi/abs/10.1080/00031305.1998.10480550#.Xbk-muj7Shc

本文(PDF)
http://www.uvm.edu/~rsingle/stat380/F04/possible/Agresti+Coull-Amstat-1998_ApproxVsExactCIfoP.pdf

jeffrey's法

JeffreyとはRichard Jeffreyのことでベイズ的な方法とされる。

f:id:iDES:20191030164454p:plain

定義式を見るとclopper-pearson法の改良版と位置付けてもよさそうだ。

. cii prop 3248 47, jeffreys

                                                         ----- Jeffreys -----
    Variable |        Obs  Proportion    Std. Err.       [95% Conf. Interval]
-------------+---------------------------------------------------------------
             |      3,248    .0144704    .0020954        .0107835    .0190214

考察

これらの方法は95%信頼区間の計算方法なので、比率(Stataの結果Proportionのところ、wald法の中央値)には影響を与えない。

例題のように一般人口を対象にしたサンプルサイズが十分に大きい調査で、有病率を計算する場合、agresti-coull法がreasonableであろう。

母比率の計算は様々なケースで行うので、当然、分布も様々なものが想定される。その際には正規分布よりF分布の方が適切という場合もあるだろうから、どんな場合でもagresti-coull法がよいというわけではない。その場合はF分布のclopper-pearson正確法かjeffrey's法を検討することになるだろう。ただ、だいたいのケースではagresti-coull法が最適なのではないかと思う。