View source: R/functions.syn.r
syn.sample | R Documentation |
Generates a random sample from the observed data.
syn.sample(y, xp, smoothing = "", cont.na = NA, proper = FALSE, ...)
y |
an original data vector of length |
xp |
a target length |
smoothing |
smoothing method for numeric variable. See documentation
for |
cont.na |
a vector of codes for missing values for continuous variables that should be excluded from smoothing. |
proper |
if |
... |
additional parameters passed to |
A simple random sample with replacement is taken from the
observed values in y
and used as synthetic values.
A Guassian kernel smoothing can be applied to continuous variables
by setting smoothing parameter to "density"
. It is recommended
as a tool to decrease the disclosure risk.
A list with two components:
res |
a vector of length |
fit |
a name of the method used for synthesis ( |
syn
, syn.smooth
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.