*! version 1.0.0 03Aug2022

Title

power onesens -- Power and sample-size analysis for sensitivity of a one-sample diagnostic test

Syntax

Compute sample size

power onesens sens0 sens1
[, power(numlist) alpha(numlist) prev(numlist) onesided graph[(graphopts)] ]

Compute power

power onesens sens0 sens1
[, n(numlist) alpha(numlist) prev(numlist) onesided graph[(graphopts)] ]

where sens0 is the null (hypothesized) sensitivity, and
sens1 is the alternative (target) sensitivity.
sens0 and sens1 may each be specified either as one
number or as a list of values in parentheses (see numlist).

* alpha(numlist) significance level; default is alpha(0.05)

* power(numlist) power; default is power(0.80)

* n(numlist) total sample size; required to compute power

* prev(numlist) prevalence rate of disease in the population under study; default is prev(0.50)

onesided one-sided test; default is two sided

graph[(graphopts)] graph results; see [PSS-2] power, graph

* Specifying a list of values in at least two starred options, or
two command arguments, or at least one starred option and one argument
results in computations for all possible combinations of the values; see
numlist.

Description

power onesens computes sample size or power for one-sample sensitivity of a diagnostic test,
accounting for the prevalence of the disease in the clinical population. Sensitivity is the ability
of a test to correctly detect the disease when it is present.

power onesens implements the naive
prevalence inflation method introduced by Obuchowski and Zhou (2002). Li and Fine (2004)
found this method (which they refer to as "Method 0") to be a useful approximation to exact sample-size
calculations based on unconditional power, which are more computationally intensive.

Options

alpha(numlist) sets the significance level of the test. The
default is alpha(0.05).

power(numlist) specifies the desired power at which sample size is to be computed.
The default is power(0.80). If power() is specified in conjunction with n(),
then the actual power of the test is presented.

n(numlist) specifies the total number of subjects in the study to be used for determining power.

prev(numlist) specifies the conjectured prevalence of the disease in the clinical population. The default is prev(0.50).

onesided indicates a one-sided test. The default is two sided.

graph, graph(); see [PSS-2] power, graph.

Examples

Examples: Computing sample size

Compute the sample size required to detect a sensitivity of 0.90 given a
sensitivity of 0.70 under the null hypothesis using a two-sided test;
assume a 5% significance level, 80% power and a conjectured disease prevalence of 0.50 (the defaults)

. power onesens 0.70 0.90

Same as above, using a power of 90%, a one-sided test, and a prevalence of 0.10

. power onesens 0.70 0.90, power(0.90) prev(0.10) onesided

Computing sample size for a range of prevalence rates

. power onesens 0.70 0.90, power(0.90) prev(0.10(.10).90) onesided

Applying a range of sensitivity values under the alternative hypothesis
and setting alpha levels to 0.05 and 0.01 with a prevalence of 0.10. Here we graph the results

. power onesens (0.60(0.05).80) 0.90, power(0.90) onesided alpha(0.01 0.05) prev(0.10) graph

Examples: Computing power

For a total sample of 50 subjects, compute the power of a two-sided test to
detect a sensitivity of 0.90 given a null sensitivity of 0.70; assume a 5%
significance level and a prevalence of 0.50 (the default)

. power onesens 0.70 0.90, n(50)

Same as above, but change the prevalence to 0.20 and use a one-sided test

. power onesens 0.70 0.90, n(50) prev(0.20) onesided

Same as above, but apply a range prevalence rates

. power onesens 0.70 0.90, n(50) prev(0.20 0.50 0.70) onesided

Compute powers for a range of null sensitivities and total sample sizes,
graphing the results

. power onesens (0.60(.10)0.80) 0.90, n(5(5)80) onesided graph

Stored results

power onesens stores the following in r():

Scalars

r(alpha) significance level

r(power) power

r(beta) probability of a type II error

r(sens0) null sensitivity

r(sens1) alternative sensitivity

r(delta) effect size

r(prev) prevalence of disease

r(divider) 1 if divider is requested in the table, 0 otherwise

r(N) total sample size

r(N0) sample size of the non-diseased group

r(N1) sample size of the diseased group

r(onesided) 1 for a one-sided test, 0 otherwise

Macros

r(type) test

r(method) onesens

r(columns) displayed table columns

r(labels) table column labels

r(widths) table column widths

r(formats) table column formats

Matrices

r(pss_table) table of results

References

Li, J. and J. Fine. 2004. On sample size for sensitivity and specificity in prospective diagnostic accuracy studies. Statistics in Medicine 23:2537-2550.

Obuchowski, N.A. and X. H. Zhou. 2002. Prospective studies of diagnostic test accuracy when disease prevalence is low. Biostatistics 3:477-492.

Citation of power onesens

power onesens is not an official Stata command. It is a free contribution
to the research community, like a paper. Please cite it as such:

Linden, A. 2022. POWER ONESENS: Stata module to compute power and sample size for sensitivity of a one-sample diagnostic test

Authors

Ariel Linden

President, Linden Consulting Group, LLC

alinden@lindenconsulting.org

Also see

Online: estat classification, lsens, power, power onespec (if installed),
power twosens (if installed), power twospec (if installed), power pairsens (if installed),
power pairspec (if installed)