# A population with a simple linear relationship
pop <- population(
x1 = predictor(rnorm, mean = 4, sd = 10),
x2 = predictor(runif, min = 0, max = 10),
y = response(0.7 + 2.2 * x1 - 0.2 * x2, error_scale = 1.0)
)
xs <- pop |>
sample_x(5)
xs
xs |>
sample_y()
Run the code above in your browser using DataLab