Sensitivity analysis for the sample size planning method with the goal to obtain sufficiently narrow confidence intervals for standardized ANCOVA complex contrasts.
ss_aipe_sc_ancova_sensitivity(
true_psi = NULL,
estimated_psi = NULL,
c_weights,
desired_width = NULL,
n_per_group = NULL,
mu_x = 0,
sigma_x = 1,
rho,
divisor = "s_ancova",
assurance = NULL,
conf_level = 0.95,
G = 10000,
print_iter = TRUE,
filename = NULL,
...
)A data.frame with columns term and value
summarizing the Monte Carlo sensitivity analysis across G
replications. The term entries are: mean_psi,
median_psi, sd_psi (summaries of the realized
standardized ANCOVA contrast); mean_ci_width,
median_ci_width, sd_ci_width (summaries of the full
interval widths); mean_ci_width_lower and
mean_ci_width_upper (mean one-sided widths, measured from the
observed contrast to each limit); pct_ci_less_w (proportion of
intervals at or below the target width); pct_ci_miss_low and
pct_ci_miss_high (tail-specific empirical non-coverage of
true_psi); total_type_I_error (overall empirical
non-coverage, the sum of the two tails); and the input echoes
n_per_group, total_N, true_psi,
estimated_psi (NA when n_per_group was supplied
instead), rho, width, conf_level, and
assurance (present only when an assurance was supplied). The
proportion and Type I error rows are proportions on the 0 to 1
scale, not percentages.
the population standardized ANCOVA contrast
the estimated standardized ANCOVA contrast
the contrast weights
the desired full width of the obtained confidence interval
selected sample size to use in order to determine distributional properties of a given value of sample size
the population mean for the covariate
the population standard deviation of the covariate
the population correlation coefficient between the response and the covariate
which error standard deviation to be used in standardizing the contrast; the value can be either "s_ancova" or "s_anova"
parameter to ensure that the obtained confidence interval width is narrower than the desired width with a specified degree of certainty (must be NULL or between zero and unity)
the desired confidence interval coverage, (i.e., 1 - Type I error rate)
number of generations (i.e., replications) of the simulation
to print the current value of the iterations
Optional path of a CSV file to receive the per-replication
results (the observed standardized contrast, the full and one-sided
interval widths, the tail and overall misses, and the confidence
limits), appended when the file already exists and created otherwise;
the default NULL writes nothing, and a throwaway run that wants
the file should point it at tempfile(fileext = ".csv").
allows one to potentially include parameter values for inner functions
Ken Kelley [email protected]
The sample size planning method this function is based on is developed in the context of simple (i.e., one-response-one-covariate) ANCOVA model and randomized design (i.e., same population covariate mean across groups).
An ANCOVA contrast can be standardized in at least two ways: (a) divided by the error standard deviation of the ANOVA model, (b) divided by the error standard deviation of the ANCOVA model. This function can be used to analyze both types of standardized ANCOVA contrasts.
The population mean and standard deviation of the covariate does not affect the sample size planning procedure; they can be specified as any values that are considered as reasonable by the user.
Kelley, K. (2007). Confidence intervals for standardized effect sizes: Theory, application, and implementation. Journal of Statistical Software, 20(8), 1--24. tools:::Rd_expr_doi("10.18637/jss.v020.i08")
Kelley, K., & Rausch, J. R. (2006). Sample size planning for the standardized mean difference: Accuracy in parameter estimation via narrow confidence intervals. Psychological Methods, 11(4), 363--385. tools:::Rd_expr_doi("10.1037/1082-989X.11.4.363")
Lai, K., & Kelley, K. (2012). Accuracy in parameter estimation for ANCOVA and ANOVA contrasts: Sample size planning via narrow confidence intervals. British Journal of Mathematical and Statistical Psychology, 65, 350--370. tools:::Rd_expr_doi("10.1111/j.2044-8317.2011.02029.x")
Maxwell, S. E., Delaney, H. D., & Kelley, K. (2027). Designing experiments and analyzing data: A model comparison perspective (4th ed.). Routledge. (See Chapter 9.)
Steiger, J. H., & Fouladi, R. T. (1997). Noncentrality interval estimation and the evaluation of statistical methods. In L. L. Harlow, S. A. Mulaik, & J. H. Steiger (Eds.), What if there were no significance tests? (pp. 221--257). Mahwah, NJ: Lawrence Erlbaum.
ss_aipe_sc_ancova, ss_aipe_sc_sensitivity
design_consequences for what a chosen design delivers:
power, the Type S (sign) and Type M (exaggeration) errors of the
significance filter, and the expected confidence interval width.
# Sensitivity analysis for a standardized ANCOVA contrast across
# three groups, contrast (-1, 0, 1), a covariate-outcome correlation
# of 0.4, and a planning target width of 0.5. G = 50 keeps the
# example quick; a reported sensitivity analysis deserves the default of
# G = 10000 replications.
set.seed(113)
ss_aipe_sc_ancova_sensitivity(
true_psi = 0.5, estimated_psi = 0.5,
c_weights = c(-1, 0, 1),
desired_width = 0.5, rho = 0.4,
conf_level = 0.95, G = 50, print_iter = FALSE
)
Run the code above in your browser using DataLab