Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

syn.bag

Synthesis with bagging


Description

Generates univariate synthetic data using bagging. It uses randomForest function from the randomForest package with number of sampled predictors equal to number of all predictors.

Usage

syn.bag(y, x, xp, smoothing = "", proper = FALSE, ntree = 10, ...)

Arguments

y

an original data vector of length n.

x

a matrix (n x p) of original covariates.

xp

a matrix (k x p) of synthesised covariates.

smoothing

smoothing method for continuous variables.

proper

...

ntree

number of trees to grow.

...

additional parameters passed to randomForest.

Details

...

Value

A list with two components:

res

a vector of length k with synthetic values of y.

fit

the model fitted to the observed data that was used to produce synthetic values.

References

...

See Also


synthpop

Generating Synthetic Versions of Sensitive Microdata for Statistical Disclosure Control

v1.6-0
GPL-2 | GPL-3
Authors
Beata Nowok [aut, cre], Gillian M Raab [aut], Chris Dibben [ctb], Joshua Snoke [ctb], Caspar van Lissa [ctb]
Initial release
2020-09-03

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.