*! version 1.1 2021-08-23

Title

power tworates_zhu -- Sample Size / Power for a two-sample test of rates (using negative binomial regression)

Syntax

Compute sample size

power tworates_zhu, r1(numlist) irr(numlist)
[power(numlist)
options]

Compute power

power tworates_zhu, r1(numlist) irr(numlist)
n(numlist)
[options]

where r1 is the rate (per unit of time) in the control (reference) group and irr is the
incidence rate ratio, i.e. r2/r1.
r1 and irr may each be
specified either as one number or as a list of values (see numlist).

options

Main
* alpha(numlist) two-sided significance level; default is
alpha(0.05)

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

* beta(numlist) probability of type II error; default is
beta(0.2)

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

* n1(numlist) sample size of the control group

* n2(numlist) sample size of the experimental group

* nratio(numlist) ratio of sample sizes, N2/N1; default is
nratio(1), meaning equal group sizes

* overdispersion(numlist) negative binomial overdispersion parameter (>0 for overdispersion); default is overdispersion(0)

* duration(numlist) average follow-up or exposure duration (in units of time); default is duration(1)

* varmethod(numlist) method 2 or 3 for variance under null hypothesis in Zhu and Lakkis (2014);
default is varmethod(3)

parallel treat number lists in starred options or in command
arguments as parallel when multiple values per option or argument are
specified (do not enumerate all possible combinations of values)

Table
table[(tablespec)] options to display results as a table; see
[PSS] power, table

* Specifying a list of values in at least two starred options
results in computations for all possible combinations of the values; see
numlist. Also see the parallel option.

where tablespec is

column[:label]
[column[:label] [...]] [, tableopts]

column is one of the columns defined below,
and label is a column label (may contain quotes and compound quotes).

column

alpha two-sided significance level

power power

beta type II error probability

N total number of subjects

N1 number of subjects in the control group

N2 number of subjects in the experimental group

nratio ratio of sample sizes, experimental to control

delta effect size, i.e. IRR

IRR Incidence Rate Ratio (IRR)

r1 control-group rate

r2 experimental-group rate

overdispersion negative binomial overdispersion parameter

duration average follow-up duration

varmethod method for variance under null hypothesis in Zhu and Lakkis (2014)

_all display all supported columns

Column beta is NOT shown in the default table in place of column
power if specified.

Columns nratio, varmethod and delta
are shown in the default table if specified.

Description

power tworates_zhu computes sample size or power
for a two-sample test of rates (using negative binomial regression)
using the equations in Zhu and Lakkis (2014).

By default, it computes sample size for the
given power and the values of the control-group rate and the ratio of the experimental-group rate
and the control-group rate (i.e. Incidence Rate Ratio or IRR).

Alternatively, it can compute power for given sample size and values of the
control-group rate and IRR.

To search for what effect size (IRR) can be detected for a given sample size with e.g. 80% power,
try doing a power calculation putting a list of values in irr(numlist) and
seeing what the power is for each value. See 4th Computing power example below.

Also see [PSS] power for a general introduction to the power
command using hypothesis tests. power tworates_zhu is a user-defined method.

Options

Main

alpha(), power(), beta(), n(), n1(),
n2(), nratio();
see [PSS] power.

overdispersion(numlist) specifies what Stata calls the negative binomial "overdispersion parameter",
alpha in [R] nbreg, but what Zhu and Lakkis (2014) call the "dispersion parameter", k.
For a group where there is equal follow-up or exposure per subject, and
#Events has Variance = r*(1 + k*r) where r is the expected number of events per subject.
The default is k=0, corresponding to the Poisson distribution.
Keene et al. (2007) estimated k=0.46 from raw data, while Zhu estimated k=0.8 from a different study's summary data.

duration(numlist) specifies the average follow-up duration or exposure (mu_t) in Zhu and Lakkis (2014).
The default is 1. To calculate the expected number of events per subject, multiply r1 (or r2 = r1*IRR) by duration.

varmethod(numlist) specifies the method for variance under null hypothesis in Zhu and Lakkis (2014).
The default is method 3. Method 2 is also available and will likely give very similar answers to method 3.
Method 1 is not available, as it appeared to be less accurate than the other methods.
Method 2 for calculating sample size corresponds to the method of Keene et al. (2007) when N1=N2.

parallel; see [PSS] power.

Table

table, table(); see
[PSS] power, table.

Also see the column table in
[PSS] power twomean for a list of symbols used by the graphs.

Remarks

By default, all computations assume a balanced- or equal-allocation design; see
[PSS] unbalanced designs for a description of how
to specify an unbalanced design.

Instead of specifying the total sample size n(), you can specify individual group
sizes in n1() and n2(), or specify one of the group sizes and optionally
nratio() when computing power. Also see
Two samples
in [PSS] unbalanced designs for more details.

For ideas on what value of overdispersion to assume, (i) use [R] nbreg on raw data, (ii) read the references.

"Because these methods are developed on the basis of the
asymptotic normality of the maximum likelihood estimate of the model parameters, they are better to
be used for maximum-likelihood-based tests such as Wald or likelihood ratio tests. When sample size is
small (e.g., less than 50 [per group]), these tests may not be appropriate for confirmatory trials, and more appropriate
tests should be considered. The uniformly most powerful unbiased test proposed by Wang et al. [15] is
an example, and it seems to maintain type I error rate better for small sample size under the assumption
that the common [over]dispersion parameter k is known. Before a sample size formula for such a test becomes
available, the sample size methods in this paper can be used to obtain a rough estimate of the sample
size, but simulation methods should be considered for obtaining more accurate sample size." Zhu and Lakkis (2014)

Examples

Examples: Computing sample size

Compute the sample size required to detect an IRR of 0.7 given a control-group rate of 3 per subject per year,
average follow-up of 1 year, a (two-sided) test with
5% significance level, 80% power, N1=N2, and zero overdispersion (i.e. Poisson variation)
(the defaults)

. power tworates_zhu, r1(3) irr(0.7)

Extending the above, by varying the amount of overdispersion

. power tworates_zhu, r1(3) irr(0.7) overdispersion(0 (0.4) 1.2)

Compute the sample size required to detect an IRR of 0.85 given a control-group rate of 0.8 per subject per year,
average follow-up of 0.75 years for scenario 1 (and 1.5 years for scenario 2),
5% significance level, 80% power, N1=N2, and overdispersion k=0.4

. power tworates_zhu, r1(0.8) irr(0.85) duration(0.75 1.5) overdispersion(0.4)

Compute sample sizes for a range of IRRs and powers, graphing the results

. power tworates_zhu, r1(0.8) irr(0.5 (0.05) 0.85) duration(0.75) overdispersion(0.4) power(0.8 0.9) graph(y(N) x(IRR)) table

Reproduce Zhu and Lakkis (2014) Table I (Methods 2 & 3).
(Note: sort order is different, but Ns are the same)

. power tworates_zhu, r1(0.8 1.0 1.2 1.4) irr(0.85 1.15) duration(0.75) overdispersion(0.4 0.7 1.0 1.5) power(0.8) varmethod(2 3) table(overdispersion IRR r1 N1 varmethod)

Examples: Computing power

Compute the power to detect an IRR of 0.7 given a control-group rate of 3 per subject per year, N1=N2=49,
average follow-up of 1 year, a two-sided test with
5% significance level and zero overdispersion (i.e. Poisson variation)
(the defaults)

. power tworates_zhu, r1(3) irr(0.7) n1(49)

Extending the above, by varying the amount of overdispersion

. power tworates_zhu, r1(3) irr(0.7) n1(49) overdispersion(0 (0.4) 1.2)

Compute the power required to detect an IRR of 0.85 given a control-group rate of 0.8 per subject per year,
average follow-up of 0.75 years for scenario 1 (and 1.5 years for scenario 2),
5% significance level, N1=N2=1311, and overdispersion k=0.4

. power tworates_zhu, r1(0.8) irr(0.85) n1(1311) duration(0.75 1.5) overdispersion(0.4)

Compute power for a range of IRRs, graphing and tabling the results

. power tworates_zhu, r1(0.8) irr(0.75 (0.05) 0.9) n1(1311) duration(0.75) overdispersion(0.4) graph(y(power) x(IRR) ylab(0 (0.1) 1)) table

Stored results

power tworates_zhu stores the following in r():

Scalars

r(alpha) significance level

r(power) power

r(beta) probability of a type II error

r(delta) effect size, i.e. IRR

r(N) total sample size

r(N1) sample size of the control group

r(N2) sample size of the experimental group

r(nratio) ratio of sample sizes, N2/N1

r(r1) control-group rate (per unit of time)

r(r2) experimental-group rate (per unit of time)

r(IRR) Incidence Rate Ratio

r(duration) average follow-up or exposure duration (i.e. how many units of time)

r(overdispersion) negative binomial overdispersion parameter

r(varmethod) method for variance under null hypothesis in Zhu and Lakkis (2014)

r(nfractional) 0

r(onesided) 0

[power_cmd_tworates_zhu stores most of the above also]

Macros

r(type) test

r(method) tworates_zhu

Matrices

References

Zhu, H. and Lakkis, H. 2014. Sample Size Calculation for Comparing Two Negative Binomial Rates. Statistics in Medicine, Volume 33, Pages 376-387. https://onlinelibrary.wiley.com/doi/full/10.1002/sim.5947

Keene ON, Jones MRK, Lane PW, Anderson J. Analysis of exacerbation rates in asthma and chronic obstructive pulmonary disease: example from the TRISTAN study. Pharmaceutical Statistics 2007; 6:89–97.

PASS Sample Size Software, Chapter 438. https://ncss-wpengine.netdna-ssl.com/wp-content/themes/ncss/pdf/Procedures/PASS/Tests_for_the_Ratio_of_Two_Negative_Binomial_Rates.pdf

Author

Mark Chatfield, University of Queensland, Australia.

m.chatfield@uq.edu.au