多重代入法の書き方 公開用

56
1 臨床疫学研究における報告の質 向上のための統計学の研究会 -多重代入法の書き方- 沖縄県立中部病院ER 宜保光一郎 2014/3/15 @東京医科歯科大学

Upload: koichiro-gibo

Post on 15-Jun-2015

2.595 views

Category:

Documents


11 download

TRANSCRIPT

Page 1: 多重代入法の書き方 公開用

1

臨床疫学研究における報告の質向上のための統計学の研究会

-多重代入法の書き方-

沖縄県立中部病院ER宜保光一郎

2014/3/15 @東京医科歯科大学

Page 2: 多重代入法の書き方 公開用

2

まずはじめに

• 多重代入法は、現代の統計学の技術の粋を結集している方法で、非常に難解です。

• 私は専門家ではありません。

• ここに書いていることは、ほぼ全て文献からもってきたものですが、宜保の解釈が部分的に間違っている可能性もあります。

• 顔写真はカットしました

Page 3: 多重代入法の書き方 公開用

3

なぜ多重代入法?

• ①欠測に対するバイアスの無い推定値・標準誤差を提供する

• ②あらゆるデータや分析で行うことができる

http://statistics.fas.harvard.edu/people/donald-b-rubinhttp://www.census.gov/newsroom/releases/archives/miscellaneous/cb10-cn65.html

Page 4: 多重代入法の書き方 公開用

4

欠測のパターン(復習)

• Ignorable–MCAR (missing completely at random)–MAR (missing at random)

• Non-ignorable–MNAR (missing not at random)

• Ad hocな方法(complete case studyなど)ではMCAR以外の欠測パターンではバイアスが生じる

Page 5: 多重代入法の書き方 公開用

5

欠測のパターン(復習)

• MCAR:–欠測メカニズムが完全にランダム

• MAR:–欠測のメカニズムが観察されている変数に依存する。しかし、その欠測した変数自身には依存しない

• MNAR:–欠測メカニズムが、その欠測自体に依存している

Page 6: 多重代入法の書き方 公開用

6

MARsBP(mmHg)

Age

150 90

124 45149 75138 79165 58142 66NA 34NA 22156 68165 83NA 23160 55NA 28

sBP(mmHg)

Age

150 90

165 83138 79149 75156 68142 66165 58160 55124 45NA 34NA 28NA 23NA 22

Ageでソート

実際問題として、MARなのかMNARなのか見極めは非常に難しい。

Page 7: 多重代入法の書き方 公開用

7

多重代入法の流れ(I Step, P step)欠測を含まない完全データの平均ベクトル、分散共分散行列

欠測を補った完全データ

Stochasticregresion etc.

欠測を補完した完全データの平均ベクトルと分散共分散行列(事後分布ができる)

完全データの事後分布からランダムサンプリングして、更新したデータが誕生

・・・・・・・・

m個のデータセット

収束

MCMCData Augmentation

同時分布として多変量正規分布を考える

Page 8: 多重代入法の書き方 公開用

8

多重代入法の流れ(統合フェーズ)

推定値1 と標準誤差 1

推定値2 と標準誤差 2

推定値3 と標準誤差 3

推定値4 と標準誤差 4

推定値 5と標準誤差 5

目的とする分析(

回帰分析、

ANOVA,et c.)

m個のデータセット

統合

推定値と標準誤差

Page 9: 多重代入法の書き方 公開用

9

多重代入法の報告ポイント(Sterne2009, van Buuren2012を改変)

• ①欠測の数と分布(Tableでの記載)• ②完全データのコホートと欠測を持つコホートとの比較

• ③I stepの過程で使用した変数の記載

• ④非正規分布の連続変数及びカテゴリー変数の扱い

• ⑤代入のモデルと代入したデータセットの数(m)の記載

• ⑥使用ソフトウェアの記載

• ⑦MARの仮定

• ⑧コンプリートケース研究との差異

• ⑨データの統合に用いた方法(Rubinの方法など)

BMJ 2009;338:b2393

Page 10: 多重代入法の書き方 公開用

10

①欠測の数と分布の記載

• 欠測の数

• 欠測の分布→次ページ

JAMA. 2008;300(12):1423-1431

Page 11: 多重代入法の書き方 公開用

11Journal of InternalMedicine 268; 586.593

Non-monotonicpattern

Page 12: 多重代入法の書き方 公開用

12

①欠測の数と分布の記載

• 経験則1:欠測率が25%までが正確にパラメータを推定できる上限 (Dermirtas,2008)

• 経験則2:サンプルサイズが100以下の場合、パラメータの推定が正確でなくなり、ばらつきが大きくなる (Graham&Schafer,1999)

Enders “Applied Missing Data Analysis”Guilford 2010 P262

Page 13: 多重代入法の書き方 公開用

13

多重代入法の報告ポイント(Sterne2009, van Buuren2012を改変)

• ①欠測の数と分布(Tableでの記載)• ②完全データのコホートと欠測を持つコホートとの比較

• ③I stepの過程で使用した変数の記載

• ④非正規分布の連続変数及びカテゴリー変数の扱い

• ⑤代入のモデルと代入したデータセットの数(m)の記載

• ⑥使用ソフトウェアの記載

• ⑦MARの仮定

• ⑧コンプリートケース研究との差異

• ⑨データの統合に用いた方法(Rubinの方法など)

BMJ 2009;338:b2393

Page 14: 多重代入法の書き方 公開用

14Pediatrics 2007;119;e348

Page 15: 多重代入法の書き方 公開用

15

多重代入法の報告ポイント(Sterne2009, van Buuren2012を改変)

• ①欠測の数と分布(Tableでの記載)• ②完全データのコホートと欠測を持つコホートとの比較

• ③I stepの過程で使用した変数の記載

• ④非正規分布の連続変数及びカテゴリー変数の扱い

• ⑤代入のモデルと代入したデータセットの数(m)の記載

• ⑥使用ソフトウェアの記載

• ⑦MARの仮定

• ⑧コンプリートケース研究との差異

• ⑨データの統合に用いた方法(Rubinの方法など)

BMJ 2009;338:b2393

Page 16: 多重代入法の書き方 公開用

16

③I Stepで使用した変数の記載

• 非常に重要である(MARの仮定にも繋がる)

• 従属(結果)変数もモデルに入れるべきか?→Yes

• 少なくとも後で解析に使う変数はすべてモデルにいれるべき

• 補助変数(解析には興味ないが、不完全さに関連する変数)もいれるべき

Circ Cardiovasc Qual Outcomes. 2010;3:98-105.

Page 17: 多重代入法の書き方 公開用

17

欠測パターンに応じた戦略

• MCAR→ ad hocなやり方でO.K.• MAR→ multiple imputation (MI)

• MNAR→

–①できるだけ欠測パターンを説明する変数をimputationに組み込む →MARにしてMIを行う

–②MARの仮定で出発し、感度分析を行う

Page 18: 多重代入法の書き方 公開用

18

補助変数をどうやって見つけるか?

• ①臨床的な視点(subject knowledge)より

• ②欠測のある変数と相関係数が0.4以上の変数を補助変数とする(Collins,2001)

Psychological Methods, Vol 6(4), Dec 2001, 330-351.

Page 19: 多重代入法の書き方 公開用

19

補助変数をどうやって見つけるか?

Enders “Applied Missing Data Analysis”Guilford 2010 P131

Relati vepowe r

Auxiliary Variable Correlation

0.4

Page 20: 多重代入法の書き方 公開用

20

Stef. van Buuren(1999)の推奨

• 1. MI後の解析に使用する変数は全て含めるべき

• 2.欠測に関連する変数も含めるべき(補助変数)。これらは、変数のmissing indicator とあるレベル以上相関があることで見つけられる。

• 3.ばらつきに関連する変数も含めるべき

• 4.変数が多くなりすぎた場合、除去することも考える。典型的には15 - 25個の変数が妥当

Statist.Med.18, 681–694 (1999)

Page 21: 多重代入法の書き方 公開用

21

③:事例

• Statistical Methods–We used multiple imputation to handle missing data.To impute the missing data we constructed multipleregression models including variables potentiallyrelated to the fact that the data were missing and alsovariables correlated with that outcome. We used Stata(StataCorp, College Station, Texas, USA)18 andPROC MI in SAS (SAS Institute, Cary, NC, USA) toobtain similar answers, and only the former arepresented.

BMJ, doi:10.1136/bmj.38441.620417.BF (published 23 May 2005)

Page 22: 多重代入法の書き方 公開用

22

③:事例

• Methods–The imputation proedure uses all the known covariatesthought to be associated with the missingnessmechanism and cost, together with theinterrelationships between the cost components, tohelp predict the values for the missing data.Theincomplete response variables were ~. The observedcovariates were ~.

–Ex. of ~) sex (dichotomous), Age (continuous),hospital cost (continuous; log transformed)

Clinical Trials 2007; 4:154-161

Page 23: 多重代入法の書き方 公開用

23

多重代入法の報告ポイント(Sterne2009, van Buuren2012を改変)

• ①欠測の数と分布(Tableでの記載)• ②完全データのコホートと欠測を持つコホートとの比較

• ③I stepの過程で使用した変数の記載

• ④非正規分布の連続変数及びカテゴリー変数の扱い

• ⑤代入のモデルと代入したデータセットの数(m)の記載

• ⑥使用ソフトウェアの記載

• ⑦MARの仮定

• ⑧コンプリートケース研究との差異

• ⑨データの統合に用いた方法(Rubinの方法など)

BMJ 2009;338:b2393

Page 24: 多重代入法の書き方 公開用

24

④非正規分布の連続変数及びカテゴリー変数の扱い

• 基本的にMIでは多変量正規分布を仮定してimputationを行うので、正規分布でない変数をどう取り扱ったか明記する必要がある

• Ex.)歪度が大きい場合→log transformation→P-phaseで back-transformation

• しかし、正規性の仮定が崩れていても大きな問題はないとする報告も多い(Graham,1999Demirtas,2008)

Page 25: 多重代入法の書き方 公開用

25

④非正規分布の連続変数及びカテゴリー変数の扱い

• Methods–The MI data augmentation procedure used hereassumes that the data have a multivariate normaldistribution. Suitable transformations were necessaryfor this assumption to hold. (中略) The continuousvariables for the non-zero values for the hospice cost,non-QE cost and the GP cost components were highlyskewed. A scales logit transformation, as suggested inScafer’s Norm Program, was chosen to give normallydistribited and plausible values.

Clinical Trials 2007; 4:154-161

Page 26: 多重代入法の書き方 公開用

26

④-1 To round or not to round?

• カテゴリーなどの変数はimputationをすると、連続変数で表現される

Enders “Applied Missing Data Analysis”Guilford 2010 P263

Page 27: 多重代入法の書き方 公開用

27

④-1 To round or not to round?

• 特に2値変数である場合は、まるめる必要はないとされる。まるめることでパラメータ推定にバイアスが生じる。(Alison,2005 etc.)

Page 28: 多重代入法の書き方 公開用

28

④-2交互作用が知りたいとき

• Imputation後の解析で、交互作用に注目したい場合、imputationの際に目的の交互作用を含めて行う必要がある

• 交互作用を含めないと、結果が薄まり、検出力が低下してしまうため

Enders “Applied Missing Data Analysis”Guilford 2010 P265

Page 29: 多重代入法の書き方 公開用

29

多重代入法の報告ポイント(Sterne2009, van Buuren2012を改変)

• ①欠測の数と分布(Tableでの記載)• ②完全データのコホートと欠測を持つコホートとの比較

• ③I stepの過程で使用した変数の記載

• ④非正規分布の連続変数及びカテゴリー変数の扱い

• ⑤代入のモデルと代入したデータセットの数(m)の記載

• ⑥使用ソフトウェアの記載

• ⑦MARの仮定

• ⑧コンプリートケース研究との差異

• ⑨データの統合に用いた方法(Rubinの方法など)

BMJ 2009;338:b2393

Page 30: 多重代入法の書き方 公開用

30

⑤代入のモデルと代入したデータセットの数(m)の記載

• 歴史的には 2-5セットが推奨

• しかし、コンピュータの計算能力が上がるにつれて、5 - 20セットが推奨されてきている。

• セットが多いほど、推定の精度が上昇するため

• 代入のモデルについては⑥にて

ØEfficiency of MIØγ = rate of missinginformation

http://sites.stat.psu.edu/~jls/mifaq.html

Page 31: 多重代入法の書き方 公開用

31

⑤:事例

• Method–We used an extended hot deck multiple imputationtechnique that modifies the predictive mean matchingmethod to impute item-level missing data. Rates ofitem-level missing data were less than 2% for allvariables discussed in this article. The results across 5imputed data sets were combined by averaging, andSEs were adjusted to reflect both within-imputationvariability and between-imputation variability.

JAMA. 2002;288:2836-2845

Page 32: 多重代入法の書き方 公開用

32

多重代入法の報告ポイント(Sterne2009, van Buuren2012を改変)

• ①欠測の数と分布(Tableでの記載)• ②完全データのコホートと欠測を持つコホートとの比較

• ③I stepの過程で使用した変数の記載

• ④非正規分布の連続変数及びカテゴリー変数の扱い

• ⑤代入のモデルと代入したデータセットの数(m)の記載

• ⑥使用ソフトウェアの記載

• ⑦MARの仮定

• ⑧コンプリートケース研究との差異

• ⑨データの統合に用いた方法(Rubinの方法など)

BMJ 2009;338:b2393

Page 33: 多重代入法の書き方 公開用

33

⑥使用ソフトウェアの記載

• 代表的なRパッケージ

• “norm”• “Hmisc”• “mi”• “mice”• “Amelia”• “PAN”

Page 34: 多重代入法の書き方 公開用

34

Joint modeling

• Rubinにより提唱された元来の方法(先に示した概念図)

• MCMC(マルコフ連鎖モンテカルロ法)に理論的基盤がある。

• もし真の同時分布が多変量正規分布で近似できれば、分析は妥当になると保証できる。

• Package: “norm”

Page 35: 多重代入法の書き方 公開用

35

Multivariate imputation by chainedequations (MICE)

• 多変量欠測データのimputationを変数ごとに回帰モデルを作成して、各々の変数ごとに繰り返す。

• Ex.) binary→ logistic model• 利点は、データに適切な多変量同時分布が無くてもimputationが可能という点

• Package: “mice”http://www.stefvanbuuren.nl/

Page 36: 多重代入法の書き方 公開用

36

Expectation-Maximization withBootstrapping (King,2010)

• EMアルゴリズム +ブートストラップ

• アルゴリズムの流れ:ブートストラップ法で完全データをM個作成→EMアルゴリズムで事後分布を推定→統合する

• 利点:data augmentationをしないので、とにかく速い

• Package: “AmeliaⅡ”

American Journal of PoliticalScience,Vol.54,No.2, April2010,Pp.561–581

Page 37: 多重代入法の書き方 公開用

37http://arxiv.org/pdf/1401.5747.pdf

Page 38: 多重代入法の書き方 公開用

38

あるベンチマークテスト

• N=100万、変数の数5個の大規模データにおいて、MARパターンの欠測を約12万つくり、下記のプログラムで計算

http://www.jfssa.jp/taikai/2013/table/pdf_02/10053s.pdf

Page 39: 多重代入法の書き方 公開用

39

⑥-1マルチレベルモデリング

• Gibbs samplerの考え方で、MIを行う(Schaferand Yucel,2002)

• (イメージ) まずはLevel-2 residual(randomeffects)の条件付き分布からMCMCを行う→Level-1,及びLevel-2の分散共分散行列ができる→Level-1の平均ベクトルができる

• Package “PAN”• 詳細は難しくてよくわからないです

Enders “Applied Missing Data Analysis”Guilford 2010 P276

Page 40: 多重代入法の書き方 公開用

40

多重代入法の報告ポイント(Sterne2009, van Buuren2012を改変)

• ①欠測の数と分布(Tableでの記載)• ②完全データのコホートと欠測を持つコホートとの比較

• ③I stepの過程で使用した変数の記載

• ④非正規分布の連続変数及びカテゴリー変数の扱い

• ⑤代入のモデルと代入したデータセットの数(m)の記載

• ⑥使用ソフトウェアの記載

• ⑦MARの仮定

• ⑧コンプリートケース研究との差異

• ⑨データの統合に用いた方法(Rubinの方法など)

BMJ 2009;338:b2393

Page 41: 多重代入法の書き方 公開用

41

⑦MARの仮定

• MARの仮定が確からしいかについての記載が必要

• 研究分野の専門的な知識に基づいて、欠測パターンに他の変数が関わっていることが記述できれば良い

• MARの確認ができない場合、感度分析(例えば、全ての変数を投入してのMIなど)を独立して行い、結果の食い違いがないかをみる

BMJ 2009;338:b2393

Page 42: 多重代入法の書き方 公開用

42

⑦MARの仮定~感度分析の重要性~

• National Reseach Council 2010–Sensitivity analysis should be part of the primaryreporting of findings from clinical trials.Examinating sensitivity to the assumptions aboutmissing data mechanism should be a mandatorycomponent of reporting

• ↑と書いているにも関わらず、これをやっていいない研究が大多数(Sterne,2009)

Page 43: 多重代入法の書き方 公開用

43

感度分析の方法

• “...However, we know of no generallyavailable MI software package which can dothis” (Carpenter,2007)

• δ-adjustment (VanBuuren,1999)• Weighting approach (Carpenter,2007)

• 実務的には、異なるアルゴリズムで再計算して感度分析とするのが良いか?

Page 44: 多重代入法の書き方 公開用

44

⑦:事例

• Methods–We carried out some sensitivity analysis usingalternative modeling strategies. When using the SRMI,another modeling option is to treat income, education,and age as continuous to capture the underlying orderingof these variables. Their corresponding conditionalregression models are thus linear normal models. Afterrounding the continuous imputations to the nearestallowed integer values, the logistic regression analysisresults (not shown) are similar to those from the optiontreating all variables as categorical. We also applied thejoint modeling strategy using a general location model.

Circulation: Cardiovascular Quality and Outcomes.2010; 3: 98-105

Page 45: 多重代入法の書き方 公開用

45

多重代入法の報告ポイント(Sterne2009, van Buuren2012を改変)

• ①欠測の数と分布(Tableでの記載)• ②完全データのコホートと欠測を持つコホートとの比較

• ③I stepの過程で使用した変数の記載

• ④非正規分布の連続変数及びカテゴリー変数の扱い

• ⑤代入のモデルと代入したデータセットの数(m)の記載

• ⑥使用ソフトウェアの記載

• ⑦MARの仮定

• ⑧コンプリートケース研究との差異

• ⑨データの統合に用いた方法(Rubinの方法など)

BMJ 2009;338:b2393

Page 46: 多重代入法の書き方 公開用

46

⑧ Complete case analysisとの差異

• ⑦であげた感度分析が技術的に難しい場合でもCCAとの比較はやっておくべき

• CCA との結果が食い違う場合は、その理由を考察する

Page 47: 多重代入法の書き方 公開用

47

多重代入法の報告ポイント(Sterne2009, van Buuren2012を改変)

• ①欠測の数と分布(Tableでの記載)• ②完全データのコホートと欠測を持つコホートとの比較

• ③I stepの過程で使用した変数の記載

• ④非正規分布の連続変数及びカテゴリー変数の扱い

• ⑤代入のモデルと代入したデータセットの数(m)の記載

• ⑥使用ソフトウェアの記載

• ⑦MARの仮定

• ⑧コンプリートケース研究との差異

• ⑨データの統合に用いた方法(Rubinの方法など)

BMJ 2009;338:b2393

Page 48: 多重代入法の書き方 公開用

48

⑨データの統合に用いた方法

推定値1 と標準誤差 1

推定値2 と標準誤差 2

推定値3 と標準誤差 3

推定値4 と標準誤差 4

推定値 5と標準誤差 5

目的とする分析(

回帰分析、

ANOVA,et c.)

m個のデータセット

統合

推定値と標準誤差

Page 49: 多重代入法の書き方 公開用

49

⑨データの統合に用いた方法

• 多くはRubin(1987)の方法に帰する

• 点推定:

• Within-imputation variance:

• Between-imputation variance:

Uj = standard errorcorresponding to Q^j

Q^j = estimate obtained from data setj(j=1,2,,m)

http://sites.stat.psu.edu/~jls/mifaq.html

Page 50: 多重代入法の書き方 公開用

50

⑨データの統合に用いた方法

• Total variance:

• 95%信頼区間:

• 自由度:

• BMCMedical Research Methodology 2009, 9:57に詳しい

(Q- ± 1.96 *√T)

http://sites.stat.psu.edu/~jls/mifaq.html

Page 51: 多重代入法の書き方 公開用

51

The minimum essentials

1.欠測の数

2.欠測の理由

3.方法(complete case analysis, MI)4.ソフトウェア

5.代入したデータセットの数(m)6.Complete case analysis

Stef vanBuuren “Flexible Imputation of Missing Data” CRC Press 2012 P252-253

Page 52: 多重代入法の書き方 公開用

52

テンプレート

• “The percentage of missing values across the ninevariables varied between 0 and 34%. In total 1601 outof 3801 records (42%) were incomplete. Many girlshad no score because the nurse felt that themeasurment was “unnecessary”, or because the girldid not give permission. Older girls had many moremising data.We used multiple imputation (Rubin,1987a) to create and analyze 40 multiply imputeddatasets. Methodologist currently regard multipleimputation as a state-of-the-art technique because itimproves accuracy and statical power relative to otermissing data techniques. (→ continued)

Page 53: 多重代入法の書き方 公開用

53

テンプレート

• → ...Incomplete variables were imputed under fullyconditional specification (Van Buuren et al., 2006).Calculation were done in R 2.13.1 using the defaultstrings of the mice 2.12 package were estimated withmultiple regression applied to each imputed datasetseparately. These estimates and their standard errorswere combined using Rubin’s rules. For comparison,we also performed the analysis on the subset ofcomplete cases.”

Stef van Buuren “Flexible imputation of missing data” CRC Press 2012 P254

Page 54: 多重代入法の書き方 公開用

54

参考書籍

• Enders, “Applied Missing Data Analysis”Guilford; 2010

• Stef van Buuren, “Flexible Imputation ofMissing Data” CRC Press; 2012

http://www.stefvanbuuren.nl/

http://www.appliedmissingdata.com/

Page 55: 多重代入法の書き方 公開用

55

参考文献

• A Burton et al. “Cost-effectiveness in clinical trials: usingmultiple imputation to deal with incomplete cost data” Clin.Trials 2007;4:154-161

• J Sterne et al. ”Multiple imputation for missing data inepidemiological and clinical research: potential and pitfalls”BMJ 2009;338:b2393

• A Mackinnon “The use and reporting of multiple imputationin medical research - a review” J Intern Med 2010;268:586–593.

• JL Schafer, JW Graham “Missing Data: Our View of theState of the Art” Psychological Methods 2002,Vol.7,No. 2,147–177

Page 56: 多重代入法の書き方 公開用

56

参考文献

• A Marshall et al. “Combining estimates of interest inprognostic modelling studies after multiple imputation:current practice and guidelines” BMC Medical ResearchMethodology 2009, 9:57

• L Collins “A comparison of inclusive and restrictivestrategies in modern missing data procedures”PsychologicalMethods, Vol 6(4), Dec 2001, 330-351.

• Y He “Missing Data Analysis Using Multiple Imputation:Getting to the Heart of the Matter” Circ Cardiovasc QualOutcomes. 2010;3:98-105

• S. van Buuren et al. “Multiple Imputation of Missing BloodPressure Covariates in Survival Analysis” Statist. Med. 18,681-694 (1999)