- x.amelia.full <- df[,.(N, m, Bxy, Bxy.est.true, Bxy.ci.lower.amelia.full, Bxy.ci.upper.amelia.full, Bxy.est.amelia.full)]
-
- x.amelia.full <- x.amelia.full[,':='(true.in.ci = (Bxy.est.true >= Bxy.ci.lower.amelia.full) & (Bxy.est.true <= Bxy.ci.upper.amelia.full),
- zero.in.ci = (0 >= Bxy.ci.lower.amelia.full) & (0 <= Bxy.ci.upper.amelia.full),
- bias = Bxy.est.true - Bxy.est.amelia.full,
- sign.correct = sign(Bxy.est.true) == sign(Bxy.est.amelia.full))]
-
- x.amelia.full.plot <- x.amelia.full[,.(p.true.in.ci = mean(as.integer(true.in.ci)),
- mean.bias = mean(bias),
- p.sign.correct = mean(as.integer(sign.correct & (! zero.in.ci))),
- mean.est = mean(Bxy.est.amelia.full),
- var.est = var(Bxy.est.amelia.full),
- N.sims = .N,
- variable='x',
- method='Multiple imputation'
- ),
- by=c('N','m')]
-
-
- g.amelia.full <- df[,.(N, m, Bgy.est.true, Bgy.est.amelia.full, Bgy.ci.lower.amelia.full, Bgy.ci.upper.amelia.full)]
- g.amelia.full <- g.amelia.full[,':='(true.in.ci = (Bgy.est.true >= Bgy.ci.lower.amelia.full) & (Bgy.est.true <= Bgy.ci.upper.amelia.full),
- zero.in.ci = (0 >= Bgy.ci.lower.amelia.full) & (0 <= Bgy.ci.upper.amelia.full),
- bias = Bgy.est.amelia.full - Bgy.est.true,
- sign.correct = sign(Bgy.est.true) == sign(Bgy.est.amelia.full))]
-
- g.amelia.full.plot <- g.amelia.full[,.(p.true.in.ci = mean(as.integer(true.in.ci)),
- mean.bias = mean(bias),
- p.sign.correct = mean(as.integer(sign.correct & (! zero.in.ci))),
- mean.est = mean(Bgy.est.amelia.full),
- var.est = var(Bgy.est.amelia.full),
- N.sims = .N,
- variable='g',
- method='Multiple imputation'
- ),
- by=c('N','m')]
-
- x.mle <- df[,.(N,m, Bxy.est.true, Bxy.est.mle, Bxy.ci.lower.mle, Bxy.ci.upper.mle)]
-
- x.mle <- x.mle[,':='(true.in.ci = (Bxy.est.true >= Bxy.ci.lower.mle) & (Bxy.est.true <= Bxy.ci.upper.mle),
- zero.in.ci = (0 >= Bxy.ci.lower.mle) & (0 <= Bxy.ci.upper.mle),
- bias = Bxy.est.mle - Bxy.est.true,
- sign.correct = sign(Bxy.est.true) == sign(Bxy.est.mle))]
-
- x.mle.plot <- x.mle[,.(p.true.in.ci = mean(as.integer(true.in.ci)),
- mean.bias = mean(bias),
- p.sign.correct = mean(as.integer(sign.correct & (! zero.in.ci))),
- mean.est = mean(Bxy.est.mle),
- var.est = var(Bxy.est.mle),
- N.sims = .N,
- variable='x',
- method='Maximum Likelihood'
- ),
- by=c('N','m')]
-
-
-
- g.mle <- df[,.(N,m, Bgy.est.true, Bgy.est.mle, Bgy.ci.lower.mle, Bgy.ci.upper.mle)]
-
- g.mle <- g.mle[,':='(true.in.ci = (Bgy.est.true >= Bgy.ci.lower.mle) & (Bgy.est.true <= Bgy.ci.upper.mle),
- zero.in.ci = (0 >= Bgy.ci.lower.mle) & (0 <= Bgy.ci.upper.mle),
- bias = Bgy.est.mle - Bgy.est.true,
- sign.correct = sign(Bgy.est.true) == sign(Bgy.est.mle))]
-
- g.mle.plot <- g.mle[,.(p.true.in.ci = mean(as.integer(true.in.ci)),
- mean.bias = mean(bias),
- p.sign.correct = mean(as.integer(sign.correct & (! zero.in.ci))),
- mean.est = mean(Bgy.est.mle),
- var.est = var(Bgy.est.mle),
- N.sims = .N,
- variable='g',
- method='Maximum Likelihood'
- ),
- by=c('N','m')]
-
-
-
-
- x.pseudo <- df[,.(N,m, Bxy.est.true, Bxy.est.pseudo, Bxy.ci.lower.pseudo, Bxy.ci.upper.pseudo)]
-
- x.pseudo <- x.pseudo[,':='(true.in.ci = (Bxy.est.true >= Bxy.ci.lower.pseudo) & (Bxy.est.true <= Bxy.ci.upper.pseudo),
- zero.in.ci = (0 >= Bxy.ci.lower.pseudo) & (0 <= Bxy.ci.upper.pseudo),
- bias = Bxy.est.pseudo - Bxy.est.true,
- sign.correct = sign(Bxy.est.true) == sign(Bxy.est.pseudo))]
-
- x.pseudo.plot <- x.pseudo[,.(p.true.in.ci = mean(as.integer(true.in.ci)),
- mean.bias = mean(bias),
- p.sign.correct = mean(as.integer(sign.correct & (! zero.in.ci))),
- mean.est = mean(Bxy.est.pseudo),
- var.est = var(Bxy.est.pseudo),
- N.sims = .N,
- variable='x',
- method='Pseudo Likelihood'
- ),
- by=c('N','m')]
-
-
-
- g.pseudo <- df[,.(N,m, Bgy.est.true, Bgy.est.pseudo, Bgy.ci.lower.pseudo, Bgy.ci.upper.pseudo)]
-
- g.pseudo <- g.pseudo[,':='(true.in.ci = (Bgy.est.true >= Bgy.ci.lower.pseudo) & (Bgy.est.true <= Bgy.ci.upper.pseudo),
- zero.in.ci = (0 >= Bgy.ci.lower.pseudo) & (0 <= Bgy.ci.upper.pseudo),
- bias = Bgy.est.pseudo - Bgy.est.true,
- sign.correct = sign(Bgy.est.true) == sign(Bgy.est.pseudo))]
-
- g.pseudo.plot <- g.pseudo[,.(p.true.in.ci = mean(as.integer(true.in.ci)),
- mean.bias = mean(bias),
- p.sign.correct = mean(as.integer(sign.correct & (! zero.in.ci))),
- mean.est = mean(Bgy.est.pseudo),
- var.est = var(Bgy.est.pseudo),
- N.sims = .N,
- variable='g',
- method='Pseudo Likelihood'
- ),
- by=c('N','m')]