Learn R Programming

carts (version 0.1.0)

sample_covar_parametric_model: Sample from an estimated parametric covariate model

Description

Sample from an estimated parametric covariate model

Usage

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

Value

data.table

Arguments

n

Sample size

model

lava::lvm object with estimated coefficients

model.path

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

Author

Benedikt Sommer

Examples

Run this code
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))

Run the code above in your browser using DataLab