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 #> -3.31 -0.03 -0.04 3.41 1.03 0 500 #> #> Step 2 (potential outcomes): my_potential_outcomes ----------------------------- #> #> Added variable: Y_Z_0 #> min median mean max sd N_missing N_unique #> -3.31 -0.03 -0.04 3.41 1.03 0 500 #> #> Added variable: Y_Z_1 #> min median mean max sd N_missing N_unique #> -6.06 1.82 1.90 9.55 2.17 0 500 #> #> Step 3 (sampling): my_sampling ------------------------------------------------- #> #> N = 250 (250 subtracted) #> #> Added variable: S_inclusion_prob #> 0.5 #> Frequency 250 #> Proportion 1.00 #> #> Altered variable: ID #> Before: #> N_missing N_unique #> 0 500 #> #> After: #> N_missing N_unique #> 0 250 #> #> Altered variable: noise #> Before: #> min median mean max sd N_missing N_unique #> -3.31 -0.03 -0.04 3.41 1.03 0 500 #> #> After: #> min median mean max sd N_missing N_unique #> -2.45 -0.10 -0.06 2.74 1.02 0 250 #> #> Altered variable: Y_Z_0 #> Before: #> min median mean max sd N_missing N_unique #> -3.31 -0.03 -0.04 3.41 1.03 0 500 #> #> After: #> min median mean max sd N_missing N_unique #> -2.45 -0.10 -0.06 2.74 1.02 0 250 #> #> Altered variable: Y_Z_1 #> Before: #> min median mean max sd N_missing N_unique #> -6.06 1.82 1.90 9.55 2.17 0 500 #> #> After: #> min median mean max sd N_missing N_unique #> -6.06 1.95 1.87 9.55 2.13 0 250 #> #> Step 4 (estimand): my_estimand ------------------------------------------------- #> #> A single draw of the estimand: #> estimand_label estimand #> ATE 1.9 #> #> Step 5 (declare step): dplyr::mutate(noise_sq = noise^2) ----------------------- #> #> Added variable: noise_sq #> min median mean max sd N_missing N_unique #> 0.00 0.53 1.03 7.53 1.35 0 250 #> #> Step 6 (assignment): my_assignment --------------------------------------------- #> #> 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 #> -3.17 0.03 0.05 6.89 1.25 0 250 #> #> Step 8 (estimator): my_estimator ----------------------------------------------- #> #> Formula: Y ~ Z #> #> A single draw of the estimator: #> estimator_label coefficient_name est se p ci_lower ci_upper #> my_estimator Z 1.4 0.44 0.0043 0.48 2.3 #> estimand_label #> ATE #>
df <- draw_data(design) estimates <- get_estimates(design) estimands <- get_estimands(design)