dat <- data.frame(
treated = rep(0:1, c(50, 30)),
age = c(rnorm(50, 5, 2), rnorm(30, 5, 1)),
weight = c(rnorm(50, 11, 2), rnorm(30, 10, 1)),
class = c(rbinom(50, 3, 0.6), rbinom(30, 3, 0.4))
)
energy_test(treated ~ age + weight + class, data=dat, R = 500)
Run the code above in your browser using DataLab