combine_models: Combine synthesis and masking models

combine.modelsR Documentation

Combine synthesis and masking models

Description

Combines and checks the synthesis and masking models to be included in the synthesis.

Usage

combine.models(..., data)

Arguments

...

one or more models of class robosynth.synthesis.model as returned by synthesis.model or robosynth.masking.model as returned by masking.model.

data

data frame: the original data, for which synthetic data should be generated.

Details

This function combines one or more synthesis and masking models into a combined model that can be passed to synthesize to generate the synthetic data. In addition, the function will perform checks and attempt to compute the values for the masking and proposal parameters in the masking and synthesis models from the data, if they were not specified by the user (throwing an error if this fails).

Value

An object of class robosynth.model.list, containing the combined specification of the synthesis and masking models.

Author(s)

Simon Grund

See Also

synthesis.model, masking.model, synthesize

Examples

# create of masked copies
sociosexuality <- within(sociosexuality, {
  m_sex <- mask.categorical(sex, probability = .80)
  m_sexpref <- mask.categorical(sexpref, probability = .60)
  m_age <- mask.continuous(age, reliability = .90)
})

# combine synthesis and masking models
combine.models(

  synthesis.model(sex ~ 1, type = "binary"),
  synthesis.model(sexpref ~ 1 + sex, type = "categorical"),
  synthesis.model(age ~ 1 + sex + sexpref, type = "continuous"),

  masking.model(m_sex ~ sex, type = "binary"),
  masking.model(m_sexpref ~ sexpref, type = "categorical"),
  masking.model(m_age ~ age, type = "continuous"),

  data = sociosexuality

)

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