sdc_model {sdcLog} | R Documentation |
Disclosure control for models
Description
Checks if your model complies to RDC rules. Checks for overall number of entities and number of entities for each level of dummy variables.
Usage
sdc_model(data, model, id_var = getOption("sdc.id_var"), fill_id_var = FALSE)
Arguments
data |
data.frame which was used to build the model. |
model |
The estimated model object. Can be a model type like lm, glm
and various others (anything which can be handled by |
id_var |
character The name of the id variable. Defaults to |
fill_id_var |
logical Only for very specific use cases. For example:
If Defaults to |
Value
A list of class sdc_model
with detailed information about
options, settings, and compliance with the distinct entities criterion.
Examples
# Check simple models
model_1 <- lm(y ~ x_1 + x_2, data = sdc_model_DT)
sdc_model(data = sdc_model_DT, model = model_1, id_var = "id")
model_2 <- lm(y ~ x_1 + x_2 + x_3, data = sdc_model_DT)
sdc_model(data = sdc_model_DT, model = model_2, id_var = "id")
model_3 <- lm(y ~ x_1 + x_2 + dummy_3, data = sdc_model_DT)
sdc_model(data = sdc_model_DT, model = model_3, id_var = "id")