View source: R/syntheticPool.R
syntheticPool | R Documentation |
This function pools estimates and variances which have been obtained by analysing multiple synthetic imputations (e.g. created used gFormulaImpute) using the method developed by Raghunathan et al 2003.
syntheticPool(fits)
fits |
Collection of model fits produced by a call of the form
|
The only argument to syntheticPool
is a set of model fits obtained by running
an analysis on an imputed dataset collection of class mids
, as created
for example using the mice
function in the mice
package.
The function returns a table containing the overall parameter estimates, the within, between and total imputation variances, 95% confidence intervals, and p-values testing the null hypothesis that the corresponding parameters equal zero.
It is possible for the variance estimator developed by Raghunathan et al 2003 to
be negative. In this case syntheticPool
stops and informs you to re-impute
using a larger number of imputations M
and/or nSim
.
The development of the gFormulaMI
package was supported by a grant from the UK
Medical Research Council (MR/T023953/1).
A matrix containing the pooled results.
Jonathan Bartlett jonathan.bartlett1@lshtm.ac.uk
Raghunathan TE, Reiter JP, Rubin DB. 2003. Multiple imputation for statistical disclosure limitation. Journal of Official Statistics, 19(1), p.1-16.
set.seed(7626)
#impute synthetic datasets under two regimes of interest using gFormulaImpute
imps <- gFormulaImpute(data=simDataFullyObs,M=10,
trtVars=c("a0","a1","a2"),
trtRegimes=list(c(0,0,0),c(1,1,1)))
#fit linear model to final outcome with regime as covariate
fits <- with(imps, lm(y~factor(regime)))
#pool results using Raghunathan et al 2003 rules
syntheticPool(fits)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.