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

syn.satcat

Synthesis from a saturated model based on all combinations of the predictor variables.


Description

Synthesises one variable (y) from all possible combinations of its precitors (x). A bootstrap sample is created from the original values of y within each unique combinations of of xp (the syntheisied values of the grouping variable).

Usage

syn.satcat(y, x, xp, proper = FALSE, ...)

Arguments

y

an original data vector of length n for the satcat variable.

x

a matrix (n x p) with the original predictor variables for y.

xp

a matrix (k x p) with synthetic values of x.

proper

if proper = TRUE x and y are replaced with a bootstrap sample before synthesis, thus effectively sampling from the posterior distribution of the model, given the data.

...

additional parameters.

Details

It is intended that the variables in x are categorical (factor) variables. If y is also a categorical variable syn.satcat will give the same results as fitting a saturated polychotomous regression model but will usually be much faster. syn.satcat will fail with an error message if previous syntheses have generated a combination of variables in xp that was not present in x. Use of the syn.catall method for grouped variables can overcome this.

Value

A list with two components:

res

a data frame of dimension k x p containing the synthesised data.

fit

the cross-tabulation of the original predictor variables.

Examples

ods <- SD2011[, c("region", "sex", "agegr", "placesize")]

s1 <- syn(ods, method = c("sample", "cart", "satcat", "cart"))

## Not run: 
### mostly fails because too many small categories
s2 <- syn(ods, method = c("sample", "cart", "cart", "satcat"))
## End(Not run)

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.