Description Usage Arguments Details Value Examples
View source: R/compare_diagnoses.R
Diagnose and compare designs.
1 2 | compare_diagnoses(design1, design2, sims = 500, bootstrap_sims = 100,
merge_by_estimator = TRUE, alpha = 0.05)
|
design1 |
A design or a diagnosis. |
design2 |
A design or a diagnosis. |
sims |
The number of simulations, defaulting to 1000. |
bootstrap_sims |
Number of bootstrap replicates for the diagnosands to obtain the standard errors of the diagnosands, defaulting to |
merge_by_estimator |
A logical. Whether to include |
alpha |
The significance level, 0.05 by default. |
The function compare_diagnoses
runs a many-to-many merge matching by estimand_label
and term
(if present). If merge_by_estimator
equals TRUE
, estimator_label
is also included in the merging condition. Any diagnosand that is not included in both designs will be dropped from the merge.
A list with a data.frame
of compared diagnoses and both diagnoses.
1 2 3 4 5 6 7 8 9 10 11 12 | design_a <- declare_population(N = 100, u = rnorm(N)) +
declare_potential_outcomes(
Y_Z_0 = u,
Y_Z_1 = u + rnorm(N, mean = 2, sd = 2)) +
declare_assignment(prob = 0.5) +
declare_estimand(ATE = mean(Y_Z_1 - Y_Z_0)) +
declare_reveal() +
declare_estimator(Y ~ Z, estimand = "ATE")
design_b <- replace_step(design_a, step = "assignment", declare_assignment(prob = 0.3) )
comparison <- compare_diagnoses(design_a, design_b, sims = 40)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.