Learn R Programming

DMAR (version 1.0.0)

ss_aipe_crd: Find Target Sample Sizes for the Accuracy in Unstandardized Conditions Means Estimation in CRD

Description

Find target sample sizes (the number of clusters, cluster size, or both) for the accuracy in unstandardized conditions means estimation in CRD. If users wish to seek for both types of sample sizes simultaneously, an additional constraint is required, such as a desired width or a desired budget.

Usage

ss_aipe_crd_n_clusters_fixed_width(
  width,
  n_individuals,
  pr_treat,
  tau_Y = NULL,
  sigma2_Y = NULL,
  total_var = NULL,
  icc_Y = NULL,
  R2_between = 0,
  R2_within = 0,
  num_predictors = 0,
  assurance = NULL,
  conf_level = 0.95,
  clus_cost = NULL,
  indiv_cost = NULL,
  diff_size = NULL
)

ss_aipe_crd_n_individuals_fixed_width( width, n_clusters, pr_treat, tau_Y = NULL, sigma2_Y = NULL, total_var = NULL, icc_Y = NULL, R2_between = 0, R2_within = 0, num_predictors = 0, assurance = NULL, conf_level = 0.95, clus_cost = NULL, indiv_cost = NULL, diff_size = NULL )

ss_aipe_crd_n_clusters_fixed_budget( budget, n_individuals, clus_cost = 0, indiv_cost = 1, pr_treat = NULL, tau_Y = NULL, sigma2_Y = NULL, total_var = NULL, icc_Y = NULL, R2_between = 0, R2_within = 0, num_predictors = 0, assurance = NULL, conf_level = 0.95, diff_size = NULL )

ss_aipe_crd_n_individuals_fixed_budget( budget, n_clusters, clus_cost = 0, indiv_cost = 1, pr_treat = NULL, tau_Y = NULL, sigma2_Y = NULL, total_var = NULL, icc_Y = NULL, R2_between = 0, R2_within = 0, num_predictors = 0, assurance = NULL, conf_level = 0.95, diff_size = NULL )

ss_aipe_crd_both_fixed_budget( budget, clus_cost = 0, indiv_cost = 1, pr_treat, tau_Y = NULL, sigma2_Y = NULL, total_var = NULL, icc_Y = NULL, R2_between = 0, R2_within = 0, num_predictors = 0, assurance = NULL, conf_level = 0.95, diff_size = NULL )

ss_aipe_crd_both_fixed_width( width, clus_cost = 0, indiv_cost = 1, pr_treat, tau_Y = NULL, sigma2_Y = NULL, total_var = NULL, icc_Y = NULL, R2_between = 0, R2_within = 0, num_predictors = 0, assurance = NULL, conf_level = 0.95, diff_size = NULL )

Value

The ss_aipe_crd_n_clusters_fixed_width and ss_aipe_crd_n_clusters_fixed_budget functions provide the number of clusters. The ss_aipe_crd_n_individuals_fixed_width and ss_aipe_crd_n_individuals_fixed_budget functions provide the cluster size. The ss_aipe_crd_both_fixed_budget and ss_aipe_crd_both_fixed_width provide the number of clusters and the cluster size, respectively.

Arguments

width

The desired width of the confidence interval of the unstandardized means difference

n_individuals

The number of individuals in each cluster (cluster size)

pr_treat

The proportion of treatment clusters

tau_Y

The residual variance in the between level before accounting for the covariate

sigma2_Y

The residual variance in the within level before accounting for the covariate

total_var

The total residual variance before accounting for the covariate

icc_Y

The intraclass correlation of the dependent variable

R2_between

The proportion of variance explained in the between level (used when covariate = TRUE)

R2_within

The proportion of variance explained in the within level (used when covariate = TRUE)

num_predictors

The number of predictors used in the between level

assurance

The degree of assurance, which is the value with which confidence can be placed that describes the likelihood of obtaining a confidence interval less than the value specified (e.g., .80, .90, .95)

conf_level

The desired level of confidence for the confidence interval

clus_cost

The cost of collecting a new cluster regardless of the number of individuals collected in each cluster

indiv_cost

The cost of collecting a new individual

diff_size

Difference cluster size specification. The differences in cluster sizes can be specified in two ways, and the specified vector is recycled across the clusters. First, users may specify differences as integers, which can be negative or positive; the resulting cluster sizes add the specified values to the estimated cluster size. For example, if the cluster size is 25, the number of clusters is 10, and diff_size = c(-1, 0, 1), the cluster sizes will be 24, 25, 26, 24, 25, 26, 24, 25, 26, and 24. Second, users may specify multipliers of the cluster size as positive decimals; at least one value must be non-integer, which is what selects the multiplicative form. The resulting cluster sizes multiply the estimated cluster size by the specified values and round to the nearest integer. For example, if the cluster size is 25, the number of clusters is 10, and diff_size = c(0.8, 1, 1.2), the cluster sizes will be 20, 25, 30, 20, 25, 30, 20, 25, 30, and 20. In either form a resulting cluster size below 1 is set to 1. If NULL, the cluster size is equal across clusters

n_clusters

The desired number of clusters

budget

The desired amount of budget

Author

Ken Kelley [email protected]

Details

Here are the functions' descriptions:

ss_aipe_crd_n_clusters_fixed_width

Find the number of clusters given a specified width of the confidence interval and the cluster size

ss_aipe_crd_n_individuals_fixed_width

Find the cluster size given a specified width of the confidence interval and the number of clusters

ss_aipe_crd_n_clusters_fixed_budget

Find the number of clusters given a budget and the cluster size

ss_aipe_crd_n_individuals_fixed_budget

Find the cluster size given a budget and the number of clusters

ss_aipe_crd_both_fixed_budget

Find the sample size combinations (the number of clusters and that cluster size) providing the narrowest confidence interval given the fixed budget

ss_aipe_crd_both_fixed_width

Find the sample size combinations (the number of clusters and that cluster size) providing the lowest cost given the specified width of the confidence interval

References

Pornprasertmanit, S., & Schneider, W. J. (2014). Accuracy in parameter estimation in cluster randomized designs. Psychological Methods, 19(3), 356--379. tools:::Rd_expr_doi("10.1037/a0037036")

See Also

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.

Examples

Run this code
# Examples for each function
ss_aipe_crd_n_clusters_fixed_width(width = 0.3, n_individuals = 30,
  pr_treat = 0.5, tau_Y = 0.25, sigma2_Y = 0.75)

ss_aipe_crd_n_individuals_fixed_width(width = 0.3, n_clusters = 250,
  pr_treat = 0.5, tau_Y = 0.25, sigma2_Y = 0.75)

ss_aipe_crd_n_clusters_fixed_budget(budget = 10000, n_individuals = 20,
  clus_cost = 20, indiv_cost = 1)

ss_aipe_crd_n_individuals_fixed_budget(budget = 10000, n_clusters = 30,
  clus_cost = 20, indiv_cost = 1,
  pr_treat = 0.5, tau_Y = 0.05, sigma2_Y = 0.95, assurance = 0.8)

ss_aipe_crd_both_fixed_budget(budget = 10000, clus_cost = 30, indiv_cost = 1,
  pr_treat = 0.5, tau_Y = 0.25, sigma2_Y = 0.75)

ss_aipe_crd_both_fixed_width(width = 0.3, clus_cost = 0, indiv_cost = 1,
  pr_treat = 0.5, tau_Y = 0.25, sigma2_Y = 0.75)

# Examples for different cluster size
set.seed(113)
ss_aipe_crd_n_clusters_fixed_width(width = 0.3, n_individuals = 30,
  pr_treat = 0.5, tau_Y = 0.25, sigma2_Y = 0.75,
  diff_size = c(-2, 1, 0, 2, -1, 3, -3, 0, 0))

# Examples for different number of clusters
ss_aipe_crd_n_individuals_fixed_width(width = 0.3, n_clusters = 250,
  pr_treat = 0.5, tau_Y = 0.25, sigma2_Y = 0.75,
  diff_size = c(0.6, 1.2, 0.8, 1.4, 1, 1, 1.1, 0.9))

Run the code above in your browser using DataLab