simulate.sp_synthesizer: Simulate several synthetic data sets

View source: R/synthesizer.R

simulate.sp_synthesizerR Documentation

Simulate several synthetic data sets

Description

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).

Usage

## 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, ...)

Arguments

object

A fitted sp_synthesizer or sp_ts_synthesizer.

nsim

Number of synthetic data sets.

seed

Optional random seed.

...

Passed to generate(), e.g. n.

Value

A list of nsim synthetic data sets.

References

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.

Examples

fit <- fit_synthesizer(mtcars)
sims <- simulate(fit, nsim = 3, seed = 1)
vapply(sims, function(d) mean(d$mpg), numeric(1))

SynthesizerPlus documentation built on Oct. 16, 2026, 5:10 p.m.