*! version 1.0.0 03July2023

Title

power icc -- Power analysis for one-way random-effects intraclass correlation

Syntax

Compute sample size

power icc icc0 icc1
[, power(numlist) alpha(numlist) nr(numlist) onesided graph[(graphopts)] ]

Compute power

power icc icc0 icc1
[, n(numlist) alpha(numlist) nr(numlist) onesided graph[(graphopts)] ]

where icc0 is the null (hypothesized) intraclass correlation (ICC) and
icc1 is the alternative (target) ICC. icc0 and icc1 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

* nr(numlist) number of raters/ratings; default is nr(2)

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 icc computes sample size or power for a one-way random-effects intraclass correlation, according to Equation 7 of Zou (2012), which is equivalent
to that given by Walter et al. (1998) who derived the formulas from a hypothesis testing perspective.

power icc is useful for computing power/sample size under three diffferent scenarios; (1) when "n" subjects are each rated by the same "k" raters
(inter-rater reliability), (2) a single subject is assessed repeatedly on each of several occasions (test-retest reliability), or (3) when replicates consisting
of different occasions are taken on different subjects by a single rater (Shoukri et al 2004).

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.
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.

nr(numlist) specifies the number of ratings or raters. The default is nr(2).

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 an ICC of 0.90 given an
ICC of 0.50 under the null hypothesis using a two-sided test and assuming
2 ratings per subject, a 5% significance level and 80% power (the defaults)

. power icc 0.50 0.90

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

. power icc 0.50 0.90, power(0.90) onesided

Same as above, but testing power at both 80% and 90% and alpha at the 0.01 and 0.05 level

. power icc 0.50 0.90, alpha(0.01 0.05) power(0.80 0.90) onesided

Same as above, but applying a range of ICC values under the alternative hypothesis
and setting alpha levels to 0.05 and 0.01; and graphing the results

. power icc 0.50 (0.60(0.05).95), power(0.90) onesided alpha(0.01 0.05) graph

Examples: Computing power

For a total sample of 60 subjects, compute the power of a two-sided test to
detect an ICC of 0.90 given a null ICC of 0.80 assuming 2 ratings per subject
at a 5% significance level (the default)

. power icc 0.80 0.90, n(60)

Compute the power of a one-sided test to detect an ICC of 0.90 given a null ICC of 0.80
where each of 40 subjects is rated by 4 raters

. power icc 0.80 0.90, n(40) nr(4) onesided

Compute powers for a range of sample sizes and number of ratings per subject,
graphing the results

. power icc 0.80 0.90, n(20(5)70) nr(2(1)5) graph

Stored results

power icc stores the following in r():

Scalars

r(alpha) significance level

r(icc0) null ICC

r(icc1) alternative ICC

r(beta) probability of a type II error

r(delta) effect size

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

r(nr) number of raters/ratings

r(N) total sample size

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

r(power) power

Macros

r(type) test

r(method) icc

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

Shoukri, M. M., Asyali, M. H., & A. Donner. 2004. Sample size requirements for the design of reliability study: review and new results.
Statistical Methods in Medical Research. 13: 251-271.

Walter, S. D. Eliasziw, M., & A. Donner. 1998. Sample size and optimal designs for reliability studies. Statistics in Medicine 17: 101-110.

Zou, G. Y. 2012. Sample size formulas for estimating intraclass correlation coefficients with precision and assurance. Statistics in Medicine 31: 3972-3981.

Citation of power icc

power icc 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 ICC: Stata module to compute power and sample size for one-way random-effects intraclass correlation

Authors

Ariel Linden

President, Linden Consulting Group, LLC

alinden@lindenconsulting.org

Also see

Online: icc, power, sampicc (if installed)