| simulate.sp_synthesizer | R Documentation |
Draws nsim independent synthetic data sets from a fitted model, for
example to account for synthesis uncertainty with multiple synthetic data
sets (Raghunathan, Reiter and Rubin, 2003).
## S3 method for class 'sp_synthesizer'
simulate(object, nsim = 1, seed = NULL, ...)
## S3 method for class 'sp_ts_synthesizer'
simulate(object, nsim = 1, seed = NULL, ...)
object |
A fitted |
nsim |
Number of synthetic data sets. |
seed |
Optional random seed. |
... |
Passed to |
A list of nsim synthetic data sets.
Raghunathan, T. E., Reiter, J. P. and Rubin, D. B. (2003). Multiple imputation for statistical disclosure limitation. Journal of Official Statistics, 19(1), 1–16.
fit <- fit_synthesizer(mtcars)
sims <- simulate(fit, nsim = 3, seed = 1)
vapply(sims, function(d) mean(d$mpg), numeric(1))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.