poolcushion_t: Visualize T-test Power for Pooling Design as Function of...

Description Usage Arguments Value Examples

View source: R/poolcushion_t.R

Description

Useful for choosing a sample size such that power will be adequate even if the processing errors are larger than anticipated.

Usage

1
2
3
4
poolcushion_t(g = NULL, n = NULL, d = NULL, mu1 = NULL,
  mu2 = NULL, sigsq = NULL, sigsq1 = sigsq, sigsq2 = sigsq,
  sigsq_p_predicted = 0, sigsq_p_range = NULL, sigsq_m = 0,
  multiplicative = FALSE, alpha = 0.05, beta = 0.2, labels = TRUE)

Arguments

g

Numeric value specifying the pool size.

n

Numeric value specifying the number of assays per group. If unspecified, function figures out n required for 100 (1 - beta)% power when sigsq_p = 0.

d

Numeric value specifying true difference in group means.

mu1, mu2

Numeric value specifying group means. Required if multiplicative = TRUE.

sigsq

Numeric value specifying the variance of observations.

sigsq1, sigsq2

Numeric value specifying the variance of observations for each group.

sigsq_p_predicted

Numeric value specifying predicted processing error variance. Used to calculate n if n is unspecified.

sigsq_p_range

Numeric vector specifying range of processing error variances to consider.

sigsq_m

Numeric value specifying the variance of measurement errors.

multiplicative

Logical value for whether to assume multiplicative rather than additive errors.

alpha

Numeric value specifying type-1 error rate.

beta

Numeric value specifying type-2 error rate. Only used if n = NULL.

labels

Logical value.

Value

Plot generated by ggplot.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Determine optimal pool size and number of assays to detect a difference in
# group means of 0.5, with a common variance of 1, processing errors with
# variance of 0.1, and measurement errors with variance of 0.2. Assume costs
# of $100 per assay and $10 per subject.
poolcost_t(
  g = 1: 10,
  d = 0.5,
  sigsq = 1,
  sigsq_p = 0.1,
  sigsq_m = 0.2,
  assay_cost = 100,
  other_costs = 10
)

# Visualize how power of the study will be affected if the true processing
# error variance is not exactly 0.1.
poolcushion_t(
  g = 7,
  n = 29,
  d = 0.5,
  sigsq = 1,
  sigsq_p_predicted = 0.1,
  sigsq_m = 0.2
)

pooling documentation built on Feb. 13, 2020, 9:07 a.m.