Draw data, estimates, and inquiries from a design
draw_data(design, data = NULL, start = 1, end = length(design))
draw_estimand(...)
draw_estimands(...)
draw_estimates(...)
A design object, typically created using the + operator
A data.frame object with sufficient information to get the data, estimates, inquiries, an assignment vector, or a sample.
(Defaults to 1) a scalar indicating which step in the design to begin with. By default all data steps are drawn, from step 1 to the last step of the design.
(Defaults to length(design)
) a scalar indicating which step in the design to finish drawing data by.
A design or set of designs typically created using the + operator
design <-
declare_model(
N = 100,
U = rnorm(N),
potential_outcomes(Y ~ Z + U)
) +
declare_inquiry(ATE = mean(Y_Z_1 - Y_Z_0)) +
declare_sampling(S = complete_rs(N, n = 75)) +
declare_assignment(Z = complete_ra(N, m = 50)) +
declare_measurement(Y = reveal_outcomes(Y ~ Z)) +
declare_estimator(Y ~ Z, inquiry = "ATE")
dat <- draw_data(design)
dat_no_sampling <- draw_data(design, end = 3)
draw_estimands(design)
#> inquiry estimand
#> 1 ATE 1
draw_estimates(design)
#> estimator term estimate std.error statistic p.value conf.low conf.high
#> 1 estimator Z 1.259713 0.2323609 5.421365 7.296864e-07 0.7966188 1.722808
#> df outcome inquiry
#> 1 73 Y ATE