# Textbook scenario (Kelley, 2007). A researcher plans a study to estimate the
# coefficient of variation of reaction times with a 95% confidence interval no
# wider than .10. They guess from prior work that the population coefficient of
# variation is around .25 and apply ss_aipe_cv() to obtain a planned N.
# Question 1: how does the realized interval width behave when the planning
# value is correct (well-specified case)?
set.seed(113)
ss_aipe_cv_sensitivity(
true_cv = .25,
estimated_cv = .25,
width = .10,
assurance = NULL,
conf_level = .95,
G = 200,
print_iter = FALSE
)
# Question 2: what happens if the planning value is materially smaller than
# the true coefficient of variation (a common direction of misspecification,
# since planning values are often optimistic)? The intervals will be wider on
# average than the target and the pct_ci_less_w will fall.
set.seed(113)
ss_aipe_cv_sensitivity(
true_cv = .35,
estimated_cv = .25,
width = .10,
assurance = NULL,
conf_level = .95,
G = 200,
print_iter = FALSE
)
Run the code above in your browser using DataLab