test_pe {pooling} | R Documentation |
Test for Underestimated Processing Error Variance in Pooling Studies
Description
In studies where a biomarker is measured in combined samples from multiple subjects rather than for each individual, design parameters (e.g. optimal pool size, sample size for 80% power) are very sensitive to the magnitude of processing errors. This function provides a test that can be used midway through data collection to test whether the processing error variance is larger than initially assumed, in which case the pool size may need to be adjusted.
Usage
test_pe(xtilde, g, sigsq, sigsq_m = 0, multiplicative = FALSE,
mu = NULL, alpha = 0.05, boots = 1000, seed = NULL)
Arguments
xtilde |
Numeric vector of pooled measurements. |
g |
Numeric value specifying the pool size. |
sigsq |
Numeric value specifying the variance of observations. |
sigsq_m |
Numeric value specifying the variance of measurement errors. |
multiplicative |
Logical value for whether to assume multiplicative rather than additive errors. |
mu |
Numeric value specifying the mean of observations. Only used if
|
alpha |
Numeric value specifying significance level for bootstrap confidence interval. |
boots |
Numeric value specifying the number of bootstrap samples to take. |
seed |
Numeric value specifying the random number seed, in case it is important to be able to reproduce the lower bound. |
Details
The method is fully described in a manuscript currently under review.
Briefly, the test of interest is H0: sigsq_p <= c
, where
sigsq_p
is the processing error variance and c
is the value
assumed during study design. Under additive errors, a point estimate for
sigsq_p
is given by:
sigsq_p.hat = s2 - sigsq / g - sigsq_m
where s2
is the sample variance of poolwise measurements, g
is
the pool size, and sigsq_m
is the measurement error variance which may
be 0 if the assay is known to be precise.
Under multiplicative errors, the estimator is:
sigsq_p.hat = [(s2 - sigsq / g) / (mu^2 + sigsq / g) - sigsq_m] /
(1 + sigsq_m)
.
In either case, bootstrapping can be used to obtain a lower bound for a
one-sided confidence interval. If the lower bound is greater than c
,
H0
is rejected.
Value
List containing point estimate and lower bound of confidence interval.
Examples
# Generate data for hypothetical study designed assuming sigsq_p = 0.1, but
# truly sigsq_p = 0.25. Have data collected for 40 pools of size 5, and wish
# to test H0: sigsq_p <= 0.1. In this instance, a false negative occurs.
set.seed(123)
xtilde <- replicate(n = 40, expr = mean(rnorm(5)) + rnorm(n = 1, sd = sqrt(0.25)))
(fit <- test_pe(xtilde = xtilde, g = 5, sigsq = 1, sigsq_m = 0))