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

syn.pmm

Synthesis by predictive mean matching


Description

Generates univariate synthetic data using predictive mean matching.

Usage

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

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.

proper

a logical value specifying whether proper synthesis should be conducted. See details.

...

additional parameters.

Details

Synthesis of y by predictive mean matching. The procedure is as follows:

  1. Fit a linear regression to the original data.

  2. Compute predicted values y.hat and ysyn.hat for the original x and synthesised xp covariates respectively.

  3. For each predicted value ysyn.hat find donor observations with the closest predicted values y.hat (ties are broken by random selection), randomly sample one of them and take its observed value y as the synthetic value.

The Bayesian version (for proper synthesis) includes additional step before computing predicted values:

  • Draw coefficients from normal distribution with mean and variance estimated in step 1 and use them to calculate predicted values for the synthesised covariates.

Value

A list with two components:

res

a vector of length k with synthetic values of y.

fit

a data frame with regression coefficients and error estimates.

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.