Explore your design

draw_data(design)

get_estimates(design)

get_estimands(design)

Arguments

design

A design created by declare_design.

Examples

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) design <- declare_design(my_population, my_potential_outcomes, my_sampling, my_estimand, dplyr::mutate(noise_sq = noise^2), my_assignment, reveal_outcomes, my_estimator) design
#> #> Design Summary #> #> Step 1 (population): my_population --------------------------------------------- #> #> N = 500 #> #> Added variable: ID #> N_missing N_unique #> 0 500 #> #> Added variable: noise #> min median mean max sd N_missing N_unique #> -2.91 0.01 0.03 2.79 1.04 0 500 #> #> Step 2 (potential outcomes): my_potential_outcomes ----------------------------- #> #> Added variable: Y_Z_0 #> min median mean max sd N_missing N_unique #> -2.91 0.01 0.03 2.79 1.04 0 500 #> #> Added variable: Y_Z_1 #> min median mean max sd N_missing N_unique #> -3.90 2.15 2.02 9.94 2.18 0 500 #> #> Step 3 (sampling): my_sampling ------------------------------------------------- #> #> N = 250 (250 subtracted) #> #> Random sampling procedure: Complete random sampling #> Number of units: 500 #> The inclusion probabilities are constant across units. #> #> Added variable: S_inclusion_prob #> 0.5 #> Frequency 250 #> Proportion 1.00 #> #> Step 4 (estimand): my_estimand ------------------------------------------------- #> #> A single draw of the estimand: #> estimand_label estimand #> ATE 2.066349 #> #> Step 5 (custom data modification): dplyr::mutate(noise_sq = noise^2) ----------- #> #> Added variable: noise_sq #> min median mean max sd N_missing N_unique #> 0.00 0.57 1.04 8.45 1.34 0 250 #> #> Step 6 (assignment): my_assignment --------------------------------------------- #> #> Random assignment procedure: Complete random assignment #> Number of units: 250 #> Number of treatment arms: 2 #> The possible treatment categories are 0 and 1. #> The probabilities of assignment are constant across units. #> #> Added variable: Z #> 0 1 #> Frequency 225 25 #> Proportion 0.90 0.10 #> #> Added variable: Z_cond_prob #> 0.1 0.9 #> Frequency 25 225 #> Proportion 0.10 0.90 #> #> Step 7 (reveal outcomes): reveal_outcomes -------------------------------------- #> #> Added variable: Y #> min median mean max sd N_missing N_unique #> -2.91 0.24 0.38 6.17 1.39 0 250 #> #> Step 8 (estimator): my_estimator ----------------------------------------------- #> #> Formula: Y ~ Z #> #> A single draw of the estimator: #> estimator_label est se p ci_lower ci_upper df #> my_estimator 2.618961 0.3877942 1.018979e-10 1.855171 3.382751 248 #> estimand_label #> ATE #>
df <- draw_data(design) estimates <- get_estimates(design) estimands <- get_estimands(design)