trial <- Trial$new(
covariates = function(n) data.frame(a = rbinom(n, 1, 0.5)),
outcome = function(data) rnorm(nrow(data), data$a * -1)
)
res <- trial$run(n = 100, R = 10, estimators = est_glm())
print(res)
# assuming previous estimates have been saved to disk.
# load estimates object and repeat simulation with more Monte-Carlo runs
res2 <- do.call(
res$model$run,
c(list(R = 20, estimators = res$estimators), res$sim.args)
)
print(res2)
Run the code above in your browser using DataLab