mask_continuous: Create masked copies of continuous variables

mask.continuousR Documentation

Create masked copies of continuous variables

Description

Creates masked copies of continuous variables.

Usage

mask.continuous(x, reliability, .sd)

Arguments

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).

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.

Value

A numeric variable with masked values.

Author(s)

Simon Grund

Examples

# 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)
})

simongrund1/robosynth documentation built on March 20, 2022, 6:15 p.m.