Diagnose the Design

diagnose_design(..., diagnosands = NULL, sims = 500, bootstrap = TRUE,
  bootstrap_sims = 100, parallel = TRUE,
  parallel_cores = detectCores(logical = TRUE))



A design created by declare_design, or a set of designs. You can also provide a single list of designs, for example one created by quick_design.


A set of diagnosands created by declare_diagnosands. By default, these include bias, root mean-squared error, power, frequentist coverage, the mean and standard deviation of the estimate(s), the "type S" error rate (Gelman and Carlin 2014), and the mean of the estimand(s).


The number of simulations, defaulting to 500.


Option to bootstrap the diagnosands to obtain the standard errors of the diagnosands, defaulting to TRUE.


The number of bootstrap replicates of the diagnosands, defaulting to 100.


Logical indicating whether to run the diagnoses in parallel. Defaults to TRUE.


Number of CPU cores to use. Defaults to all available cores.


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_assignment <- declare_assignment() 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_estimand, my_assignment, reveal_outcomes, my_estimator)
# NOT RUN { # using built-in defaults: diagnosis <- diagnose_design(design) diagnosis # }
# using a user-defined diagnosand my_diagnosand <- declare_diagnosands(absolute_error = mean(abs(est - estimand)))
# NOT RUN { diagnosis <- diagnose_design(design, diagnosands = my_diagnosand) diagnosis get_diagnosands(diagnosis) get_simulations(diagnosis) # }