Description Usage Arguments Value Examples
View source: R/poolcushion_t.R
Useful for choosing a sample size such that power will be adequate even if the processing errors are larger than anticipated.
1 2 3 4  | 
g | 
 Numeric value specifying the pool size.  | 
n | 
 Numeric value specifying the number of assays per group. If
unspecified, function figures out   | 
d | 
 Numeric value specifying true difference in group means.  | 
mu1, mu2 | 
 Numeric value specifying group means. Required if
  | 
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   | 
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
  | 
labels | 
 Logical value.  | 
Plot generated by ggplot.
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
)
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.