mask.continuous | R Documentation |
Creates masked copies of continuous variables.
mask.continuous(x, reliability, .sd)
x |
a continuous variable. |
reliability |
(optional) numeric: reliability of the masked copy. Larger values correspond to weaker masking (see Details). |
.sd |
(optional) numeric: standard deviation of the noise added to the masked copy (see Details). |
This function creates masked copies of continuous variables. The masking model generates the masked copy by adding noise to the original values
x_i
where σ^2 is the noise variance.
Either reliability
or .sd
(but not both) must be specified.
If reliability
is specified, the masked copy is generated in such a way that it represents the original variable with the given reliability.
As an alternative, the .sd
argument can be used to specify the noise standard deviation (σ) directly.
A numeric variable with masked values.
Simon Grund
# using 'reliability' sociosexuality <- within(sociosexuality, { m_age <- mask.continuous(age, reliability = .90) }) # equivalent specification using '.sd' sociosexuality <- within(sociosexuality, { m_age <- mask.continuous(age, .sd = 0.9253846) })
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.