*! version 1.0.0 22May2023

Title

power loa -- power and sample size analysis for limits of agreement (LOA)

Syntax

power loa
mu
delta
, sd(numlist)
[
gamma(numlist)
alpha(numlist)
power(numlist)
n(numlist)
max(#)
onesided ]

mu is the mean difference between the two measurement methods and delta
is the maximum allowable mean difference between the two measurement methods; delta
must be a value outside of the LOA. mu and delta may each be specified either
as one number or as a list of values in parentheses (see numlist).

* sd(numlist) specify the expected standard deviation of the sample differences; sd() is required

* gamma(numlist) alpha level of Bland-Altman LOA; default is gamma(0.05)

* alpha(numlist) alpha level of the LOA confidence intervals; default is alpha(0.05)

* power(numlist) power; required to compute sample size. Default is power(.80)

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

max(#) maximum number of iterations; default is max(100000)

* 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 loa computes sample size at a specified power, and power at a specified sample size, for Bland and Altman's (1986) limits of agreement (LOA) analysis,
according to the method developed by Lu et al. (2016). Briefly, upper and lower confidence limits are computed for both upper and lower LOAs. If the maximum allowable
mean difference (delta) falls between the upper confidence limit of the upper LOA and the lower confidence limit of the lower LOA, the two measurements are considered
to be in agreement. Otherwise, they are considered not to be in agreement.

The results produced by loasampsi are identical to those produced by the
PASS Sample Size Software
and the R package blandPower.

Options

sd(#) specifies the expecteded stardard deviation
of the sample differences; sd() is required.

gamma(numlist) sets the significance level for computing the
LOAs. The default is alpha(0.05).

alpha(numlist) sets the significance level for computing the
confidence interval of the LOAs. The default is alpha(0.05).

power(numlist) specifies the desired power at which sample size is to be computed. The actual power
derived from the analysis is reported in the output when n() is specified.

n(numlist) specifies the desired sample size at which the power is to be computed.

max(#) specifies the maximum number of iterations for the algorithm to run so as to prevent endless looping when a solution cannot be found.
The default is max(100000).

Examples

1) Computing sample size

Based on pilot study data, we find that the mean difference between two lab methods is 2.12, and the standard deviation is 38.77.
We set our maximimum allowable difference between the methods at 100. We use the default settings for power (80%), gamma (0.05)
and alpha (0.05)

. power loa 2.12 100, sd(38.77)

Same as above, but we assess sample size at powers of 80% and 90%

. power loa 2.12 100, sd(38.77) power(.80 .90)

Same as above, but we now specify levels of delta ranging from 80 to 100

. power loa 2.12 (80(1)100), sd(38.77) power(0.80 0.90)

Same as above, but we now graph the results

. power loa 2.12 (80(1)100), sd(38.77) power(0.80 0.90) graph(x(delta))

2) Computing power

Using results from our first example, we specify the sample size as 86, so we can compute the exact power

. power loa 2.12 100, sd(38.77) n(86)

We now specify a range of sample sizes

. power loa 2.12 100, sd(38.77) n(60(2)120)

We now specify a range of sample sizes

. power loa 2.12 100, sd(38.77) n(60(2)120)

Same as above, but we now graph the results

. power loa 2.12 100, sd(38.77) n(60(2)120) graph

Stored results

power loa stores the following in r():

Scalars

r(mu) mean of differences

r(delta) maximum allowable difference

r(sd) standard deviation of the difference

r(gamma) alpha level for LOA

r(alpha) alpha level for LOA confidence intervals

r(power) power for the computed sample size

r(N) computed sample size

r(lloa) lower LOA

r(uloa) upper LOA

r(uloaLCL) lower confidence limit of upper LOA

r(uloaUCL) upper confidence limit of upper LOA

r(lloaLCL) lower confidence limit of lower LOA

r(lloaUCL) upper confidence limit of lower LOA

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

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

Macros

r(type) test

r(method) loa

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

Bland, J. M., and D. G. Altman. 1986. Statistical methods for assessing agreement between two methods of clinical measurement. Lancet I: 307-310.

Lu, M. J.,Zhong, W. H., Liu, Y. X., Miao, H. Z., Li, Y. C. and M. H. Ji. 2016. Sample Size for assessing agreement
between two methods of measurement by Bland-Altman method. The International Journal of Biostatistics
Article 20150039. (Published online).

Citation of power loa

power loa 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. (2023). POWER LOA: Stata module to compute power and sample size for limits of agreement (LOA) analysis

Authors

Ariel Linden

President, Linden Consulting Group, LLC

alinden@lindenconsulting.org

Also see

Online: rmloa (if installed)