Synthesis by predictive mean matching
syn.pmm.Rd
Generates univariate synthetic data using predictive mean matching.
Arguments
- y
an original data vector of length
n
.- x
a matrix (
n
xp
) of original covariates.- xp
a matrix (
k
xp
) of synthesised covariates.- proper
a logical value specifying whether proper synthesis should be conducted. See details.
- smoothing
smoothing method. See documentation for
syn.smooth
.- ...
additional parameters.
Details
Synthesis of y
by predictive mean matching. The procedure
is as follows:
Fit a linear regression to the original data.
Compute predicted values
y.hat
andysyn.hat
for the originalx
and synthesisedxp
covariates respectively.For each predicted value
ysyn.hat
find donor observations with the closest predicted valuesy.hat
(ties are broken by random selection), randomly sample one of them and take its observed valuey
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 ofy
.- fit
a data frame with regression coefficients and error estimates.