Skip to contents

Sample from an estimated parametric covariate model

Usage

sample_covar_parametric_model(n, model = NULL, model.path = NULL)

Arguments

n

Sample size

model

lava::lvm object with estimated coefficients

model.path

Path to dumped model object (RDS file) on disk (optional)

Value

data.table

Author

Benedikt Sommer

Examples

data <- data.table::data.table(
  x = rnorm(1e3), y = as.factor(rbinom(1e3, size = 1, prob=0.5))
)

m <- estimate_covar_model_full_cond(data)
samples <- sample_covar_parametric_model(n=10, model = m)
print(head(samples))
#>            x y
#> 1  0.5018601 1
#> 2  0.6231961 1
#> 3  1.1595774 1
#> 4 -0.2567582 1
#> 5  0.7674510 1
#> 6 -0.6650931 0