data <- data.table::data.table(
y = as.factor(rbinom(1e3, size = 1, prob=0.1))
)
# infer distribution of y from column type
m.est <- estimate_covar_model_full_cond(data)
y <- sample_covar_parametric_model(1e4, m.est)$y |> as.integer() - 1
print(mean(y))
# specify distribution of y
m.est <- estimate_covar_model_full_cond(
data, cond.dist = list(y = binomial.lvm)
)
y <- sample_covar_parametric_model(1e4, m.est)$y |> as.integer() - 1
print(mean(y))
Run the code above in your browser using DataLab