How black-box use of imputation can cause bias
Nicole Erler
Erasmus Medical Center, Rotterdam
Nicole Erler, FGME 2019, Kiel 1
How black-box use of imputation can cause bias Nicole Erler Erasmus - - PowerPoint PPT Presentation
How black-box use of imputation can cause bias Nicole Erler Erasmus Medical Center, Rotterdam Nicole Erler, FGME 2019, Kiel 1 Handling Missing Values is Easy! Functions automatically exclude missing values: ## [...] ## Residual standard
How black-box use of imputation can cause bias
Nicole Erler
Erasmus Medical Center, Rotterdam
Nicole Erler, FGME 2019, Kiel 1
Handling Missing Values is Easy!
Functions automatically exclude missing values: ## [...] ## Residual standard error: 2.305 on 69 degrees of freedom ## (25 observations deleted due to missingness) ## Multiple R-squared: 0.09255, Adjusted R-squared: 0.02679 ## F-statistic: 1.407 on 5 and 69 DF, p-value: 0.2325
Nicole Erler, FGME 2019, Kiel 2
Handling Missing Values is Easy!
Functions automatically exclude missing values: ## [...] ## Residual standard error: 2.305 on 69 degrees of freedom ## (25 observations deleted due to missingness) ## Multiple R-squared: 0.09255, Adjusted R-squared: 0.02679 ## F-statistic: 1.407 on 5 and 69 DF, p-value: 0.2325 Imputation is super easy: library("mice") imp <- mice(mydata) However ...
Nicole Erler, FGME 2019, Kiel 2
Handling Missing Values Correctly is Not So Easy!
(Imputation) methods makes certain assumptions, e.g.: missingness is M(C)AR
Nicole Erler, FGME 2019, Kiel 3
Handling Missing Values Correctly is Not So Easy!
(Imputation) methods makes certain assumptions, e.g.: missingness is M(C)AR the incomplete variable has a certain conditional distribution (e.g. normal)
Nicole Erler, FGME 2019, Kiel 3
Handling Missing Values Correctly is Not So Easy!
(Imputation) methods makes certain assumptions, e.g.: missingness is M(C)AR the incomplete variable has a certain conditional distribution (e.g. normal) all associations are linear
no interactions no non-linear effects no transformations
Nicole Erler, FGME 2019, Kiel 3
Handling Missing Values Correctly is Not So Easy!
(Imputation) methods makes certain assumptions, e.g.: missingness is M(C)AR the incomplete variable has a certain conditional distribution (e.g. normal) all associations are linear
no interactions no non-linear effects no transformations
compatibility of the imputation models congeniality (compatibility between analysis and imputation models)
Nicole Erler, FGME 2019, Kiel 3
Handling Missing Values Correctly is Not So Easy!
(Imputation) methods makes certain assumptions, e.g.: missingness is M(C)AR the incomplete variable has a certain conditional distribution (e.g. normal) all associations are linear
no interactions no non-linear effects no transformations
compatibility of the imputation models congeniality (compatibility between analysis and imputation models)
Nicole Erler, FGME 2019, Kiel 3
Literature: mis-specification in Multiple Imputation
Several authors have investigated robustness to mis-specification (of distribution)
in MI using FCS / MICE in joint model MI
and/or proposed to use
Tukey’s gh distribution Fleishman polynomials GAMs (in FCS) Doubly-robust weighted estimating equations (instead of MI)
Nicole Erler, FGME 2019, Kiel 4
Fully Bayesian Analysis & Imputation
Joint distribution p(y | X, b, θ)
model p(X | θ)
part p(b | θ)
effects p(θ)
Nicole Erler, FGME 2019, Kiel 5
Fully Bayesian Analysis & Imputation
Joint distribution p(y | X, b, θ)
model p(X | θ)
part p(b | θ)
effects p(θ)
Imputation part p(
X
= p(x1 | Xcompl., θ) p(x2 | Xcompl., x1, θ) p(x3 | Xcompl., x1, x2, θ) . . .
Nicole Erler, FGME 2019, Kiel 5
Fully Bayesian Analysis & Imputation
Joint distribution p(y | X, b, θ)
model p(X | θ)
part p(b | θ)
effects p(θ)
Imputation part p(
X
= p(x1 | Xcompl., θ) p(x2 | Xcompl., x1, θ) p(x3 | Xcompl., x1, x2, θ) . . . Software Implemented in the R package JointAI
Nicole Erler, FGME 2019, Kiel 5
MICE vs JointAI
Imputation in MICE p(x1 | y, Xcompl., x2, x3, x4, . . . , θ) p(x2 | y, Xcompl., x1, x3, x4, . . . , θ) p(x3 | y, Xcompl., x1, x2, x4, . . . , θ) . . . Imputation in JointAI p(y | Xcompl., x1, x2, x3, . . . , θ) p(x1 | Xcompl., θ) p(x2 | Xcompl., x1, θ) p(x3 | Xcompl., x1, x2, θ) . . .
Nicole Erler, FGME 2019, Kiel 6
MICE vs JointAI
Imputation in MICE p(x1 | y, Xcompl., x2, x3, x4, . . . , θ) p(x2 | y, Xcompl., x1, x3, x4, . . . , θ) p(x3 | y, Xcompl., x1, x2, x4, . . . , θ) . . . Imputation in JointAI p(y | Xcompl., x1, x2, x3, . . . , θ) p(x1 | Xcompl., θ) p(x2 | Xcompl., x1, θ) p(x3 | Xcompl., x1, x2, θ) . . . No issues with complex outcomes, e.g.:
multi-level survival
congeniality compatibility
Nicole Erler, FGME 2019, Kiel 6
MICE vs JointAI
Imputation in MICE p(x1 | y, Xcompl., x2, x3, x4, . . . , θ) p(x2 | y, Xcompl., x1, x3, x4, . . . , θ) p(x3 | y, Xcompl., x1, x2, x4, . . . , θ) . . .
Imputation in JointAI p(y | Xcompl., x1, x2, x3, . . . , θ) p(x1 | Xcompl., θ) p(x2 | Xcompl., x1, θ) p(x3 | Xcompl., x1, x2, θ) . . .
Potential mis-specification of association structure conditional distribution M(C)AR
Nicole Erler, FGME 2019, Kiel 7
Simulation Study: Quadratic Effect
Analysis model: y ∼ β0 + β1x1 + β2x2 + . . . Quadratic association between covariates: x1 ∼ α0 + α1x2 +❍❍
❍
α2x2
2 + . . . −2 2 −2 2 −2 2
−10 10 20 30
x2(complete covariate) x1(incomplete covariate)
Nicole Erler, FGME 2019, Kiel 8
Simulation Study: Quadratic Effect
Analysis model: y ∼ β0 + β1x1 + β2x2 + . . . Quadratic association between covariates: x1 ∼ α0 + α1x2 +❍❍
❍
α2x2
2 + . . . −2 2 −2 2 −2 2
−10 10 20 30
x2(complete covariate) x1(incomplete covariate) mice JointAI mice JointAI mice JointAI
0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0
relative bias
10% NA 30% NA 50% NA Nicole Erler, FGME 2019, Kiel 8
Simulation Study: Logarithmic Effect
Analysis model: y ∼ β0 + β1x1 + β2x2 + . . . Log-association between covariates: x1 ∼ α0 + α1❩
❩
log(x2) + . . .
0.4 0.8 1.2 0.4 0.8 1.2 0.4 0.8 1.2
−12 −8 −4 4
x2(complete covariate) x1(incomplete covariate) mice JointAI mice JointAI mice JointAI
0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8
relative bias
10% NA 30% NA 50% NA Nicole Erler, FGME 2019, Kiel 9
Simulation Study: Gamma distribution
Analysis model: y ∼ β0 + β1x1 + β2x2 + . . . Gamma-distributed covariate: x1 | x2, x3, . . . ∼ Ga()
2 4 6 2 4 6 2 4 6
0.0 0.5 1.0 1.5 2.0
x1(incomplete covariate) conditional distribution mice JointAI mice JointAI mice JointAI
0.8 1.0 1.2 1.4 1.6 1.8 2.0
relative bias
10% NA 30% NA 50% NA Nicole Erler, FGME 2019, Kiel 10
Flexible Bayesian Models
We need more flexible imputation models! Ideally: models that fit (almost) any distribution / association structure.
Nicole Erler, FGME 2019, Kiel 11
Flexible Bayesian Models
We need more flexible imputation models! Ideally: models that fit (almost) any distribution / association structure. Ideas: flexible association structure: penalized splines flexible residual distribution: mixture of Polya-Trees
Nicole Erler, FGME 2019, Kiel 11
Bayesian P-Splines
Instead of β1x2 we use
d
βℓBℓ(x2):
x1
Nicole Erler, FGME 2019, Kiel 12
Bayesian P-Splines
Instead of β1x2 we use
d
βℓBℓ(x2):
x1
Nicole Erler, FGME 2019, Kiel 12
Bayesian P-Splines
Instead of β1x2 we use
d
βℓBℓ(x2):
x1
Nicole Erler, FGME 2019, Kiel 12
Simulation: Bayesian P-Splines
Analysis model: y ∼ β0 + β1x1 + β2x2 + . . . Quadratic association between covariates: x1 ∼ α0 + α1x2 +❍❍
❍
α2x2
2 + . . . −2 2 −2 2 −2 2
−10 10 20 30
x2(complete covariate) x1(incomplete covariate)
Nicole Erler, FGME 2019, Kiel 13
Simulation: Bayesian P-Splines
Analysis model: y ∼ β0 + β1x1 + β2x2 + . . . Quadratic association between covariates: x1 ∼ α0 + α1x2 +❍❍
❍
α2x2
2 + . . . −2 2 −2 2 −2 2
−10 10 20 30
x2(complete covariate) x1(incomplete covariate) JointAI default JointAI p−spline JointAI default JointAI p−spline JointAI default JointAI p−spline
1.00 1.25 1.50
relative bias
Nicole Erler, FGME 2019, Kiel 13
Simulation: Bayesian P-Splines
Potential Issue: covariate incomplete covariate
missing
Nicole Erler, FGME 2019, Kiel 14
Simulation: Bayesian P-Splines
Potential Issue: covariate incomplete covariate
missing
Nicole Erler, FGME 2019, Kiel 14
Mixture of Polya Trees
0.0 0.5 1.0 1.5
density Beta(a0, a0)
Nicole Erler, FGME 2019, Kiel 15
Mixture of Polya Trees
0.0 0.5 1.0 1.5
density Beta(a0, a0) Beta(a1, a1) Beta(a1, a1)
Nicole Erler, FGME 2019, Kiel 15
Mixture of Polya Trees
0.0 0.5 1.0 1.5
density Beta(a0, a0) Beta(a1, a1) Beta(a1, a1) Beta(a2, a2) Beta(a2, a2) Beta(a2, a2) Beta(a2, a2)
Nicole Erler, FGME 2019, Kiel 15
Mixture of Polya Trees
0.0 0.5 1.0 1.5
density Beta(a0, a0) Beta(a1, a1) Beta(a1, a1) Beta(a2, a2) Beta(a2, a2) Beta(a2, a2) Beta(a2, a2) Beta(a3, a3) Beta(a3, a3) Beta(a3, a3) Beta(a3, a3)
Nicole Erler, FGME 2019, Kiel 15
Mixture of Polya Trees
0.0 0.5 1.0 1.5
density Beta(a0, a0) Beta(a1, a1) Beta(a1, a1) Beta(a2, a2) Beta(a2, a2) Beta(a2, a2) Beta(a2, a2) Beta(a3, a3) Beta(a3, a3) Beta(a3, a3) Beta(a3, a3)
Nicole Erler, FGME 2019, Kiel 15
Mixture of Polya Trees
0.0 0.5 1.0 1.5
density Beta(a0, a0) Beta(a1, a1) Beta(a1, a1) Beta(a2, a2) Beta(a2, a2) Beta(a2, a2) Beta(a2, a2) Beta(a3, a3) Beta(a3, a3) Beta(a3, a3) Beta(a3, a3)
Nicole Erler, FGME 2019, Kiel 15
Mixture of Polya Trees
0.0 0.5 1.0 1.5
density Beta(a0, a0) Beta(a1, a1) Beta(a1, a1) Beta(a2, a2) Beta(a2, a2) Beta(a2, a2) Beta(a2, a2) Beta(a3, a3) Beta(a3, a3) Beta(a3, a3) Beta(a3, a3)
Nicole Erler, FGME 2019, Kiel 15
Practical Issues & Ideas
Potential / probable issues for practice: flexible fit needs observed data everywhere computational time
Nicole Erler, FGME 2019, Kiel 16
Practical Issues & Ideas
Potential / probable issues for practice: flexible fit needs observed data everywhere computational time Ideas: check first if simple model fits, e.g. posterior predictive checks
χ2 type of tests Kolmogorov-Smirnoff test? discordance tests?
Nicole Erler, FGME 2019, Kiel 16
Practical Issues & Ideas
Potential / probable issues for practice: flexible fit needs observed data everywhere computational time Ideas: check first if simple model fits, e.g. posterior predictive checks
χ2 type of tests Kolmogorov-Smirnoff test? discordance tests?
feasibility checks before running the complex model
Nicole Erler, FGME 2019, Kiel 16
Take home message
assumptions of imputation models can easily be violated ➡ bias more flexible imputation models are needed semi- / non-parametric (Bayesian) methods can offer a solution more flexibility ➡ more complexity ➡ need for guidance tools
Nicole Erler, FGME 2019, Kiel 17
Simulation Study: Beta Distribution
Analysis model: y ∼ β0 + β1x1 + β2 + . . . Beta-distributed covariate: x1 | x2, x3, . . . ∼ Be()
0.00 0.25 0.50 0.75 1.00 0.00 0.25 0.50 0.75 1.00 0.00 0.25 0.50 0.75 1.00
1 2 3 4
x1(incomplete covariate) conditional distribution mice JointAI mice JointAI mice JointAI
0.6 0.8 1.0 1.2 1.4
relative bias
Nicole Erler, FGME 2019, Kiel 19
Simulation Study: Reverting the sequence
Analysis model: y ∼ β0 + β1x1 + β2x2 + . . . Exclusion of important predictor: x1 ∼ α0 + α1x2 +❳❳
❳
α2x3 + . . .
−5 5 −5 5 −5 5
0.0 0.2 0.4 0.6
x1(incomplete covariate) conditional distribution mice JointAI mice JointAI mice JointAI
0.6 0.8 1.0 1.2 1.4 1.6
relative bias
10% NA 30% NA 50% NA Nicole Erler, FGME 2019, Kiel 20
Simulation Study: Ignoring an Interaction
Analysis model: y ∼ β0 + β1x1 + β2x2 + . . . Interaction between covariates: x1 ∼ α0 + α1x2 + α2x3 +❳❳❳
❳
α3x2x3 + . . .
−2 −1 1 2 −2 −1 1 2 −2 −1 1 2
−5.0 −2.5 0.0 2.5 5.0
x2(complete covariate) x1(incomplete covariate) mice JointAI mice JointAI mice JointAI
0.6 0.8 1.0 1.2 1.4 1.6 1.8
relative bias
10% NA 30% NA 50% NA Nicole Erler, FGME 2019, Kiel 21