Explore your design
get_estimates(design, data = NULL, start = 1, end = length(design))draw_data(design)
draw_estimands(...)
draw_estimates(...)
# S3 method for design
print(x, verbose = TRUE, ...)
# S3 method for design
summary(object, verbose = TRUE, ...)
A design object, typically created using the + operator
A data.frame object with sufficient information to run estimators.
(Defaults to 1) a scalar indicating which step in the design to begin getting estimates from. By default all estimators are calculated, from step 1 to the last step of the design.
(Defaults to length(design)
) a scalar indicating which step in the design to finish getting estimates from.
optional arguments to be sent to summary function
a design object, typically created using the + operator
an indicator for printing a long summary of the design, defaults to TRUE
a design object created using the + operator
# NOT RUN {
design <-
declare_population(N = 500, noise = rnorm(N)) +
declare_potential_outcomes(Y ~ noise + Z * rnorm(N, 2, 2)) +
declare_sampling(n = 250) +
declare_estimand(ATE = mean(Y_Z_1 - Y_Z_0)) +
declare_step(dplyr::mutate, noise_sq = noise^2) +
declare_assignment(m = 25) +
declare_reveal() +
declare_estimator(Y ~ Z, estimand = "my_estimand")
design
df <- draw_data(design)
estimates <- draw_estimates(design)
estimands <- draw_estimands(design)
my_population <- declare_population(N = 500, noise = rnorm(N))
my_potential_outcomes <- declare_potential_outcomes(
Y_Z_0 = noise, Y_Z_1 = noise +
rnorm(N, mean = 2, sd = 2))
my_sampling <- declare_sampling(n = 250)
my_assignment <- declare_assignment(m = 25)
my_estimand <- declare_estimand(ATE = mean(Y_Z_1 - Y_Z_0))
my_estimator <- declare_estimator(Y ~ Z, estimand = my_estimand)
my_mutate <- declare_step(dplyr::mutate, noise_sq = noise ^ 2)
my_reveal <- declare_reveal()
design <- my_population +
my_potential_outcomes +
my_sampling +
my_estimand +
my_mutate +
my_assignment +
my_reveal +
my_estimator
summary(design)
# }
Run the code above in your browser using DataLab