Learn R Programming

twoCoprimary (version 1.0.0)

power2BinaryApprox: Power Calculation for Two Co-Primary Binary Endpoints (Approximate)

Description

Calculates the power for a two-arm superiority trial with two co-primary binary endpoints using various asymptotic normal approximation methods, as described in Sozu et al. (2010).

Usage

power2BinaryApprox(n1, n2, p11, p12, p21, p22, rho1, rho2, alpha, Test)

Value

A data frame with the following columns:

n1

Sample size for group 1

n2

Sample size for group 2

p11, p12, p21, p22

Response probabilities

rho1, rho2

Correlations

alpha

One-sided significance level

Test

Testing method used

power1

Power for the first endpoint alone

power2

Power for the second endpoint alone

powerCoprimary

Power for both co-primary endpoints

Arguments

n1

Sample size for group 1 (test group)

n2

Sample size for group 2 (control group)

p11

True probability of responders in group 1 for the first outcome (0 < p11 < 1)

p12

True probability of responders in group 1 for the second outcome (0 < p12 < 1)

p21

True probability of responders in group 2 for the first outcome (0 < p21 < 1)

p22

True probability of responders in group 2 for the second outcome (0 < p22 < 1)

rho1

Correlation between the two outcomes for group 1

rho2

Correlation between the two outcomes for group 2

alpha

One-sided significance level (typically 0.025 or 0.05)

Test

Statistical testing method. One of:

  • "AN": Asymptotic normal method without continuity correction

  • "ANc": Asymptotic normal method with continuity correction

  • "AS": Arcsine method without continuity correction

  • "ASc": Arcsine method with continuity correction

Details

This function implements four approximate power calculation methods:

Asymptotic Normal (AN): Uses the standard normal approximation without continuity correction (equations 3-4 in Sozu et al. 2010).

Asymptotic Normal with Continuity Correction (ANc): Includes Yates's continuity correction (equation 5 in Sozu et al. 2010).

Arcsine (AS): Uses arcsine transformation without continuity correction (equation 6 in Sozu et al. 2010).

Arcsine with Continuity Correction (ASc): Arcsine method with continuity correction (equation 7 in Sozu et al. 2010).

The correlation between test statistics for the two endpoints depends on the method:

For AN and ANc methods: $$\rho_{nml} = \frac{\sum_{j=1}^{2} \rho_j \sqrt{\nu_{j1}\nu_{j2}}/n_j} {se_1 \times se_2}$$ where \(\nu_{jk} = p_{jk}(1-p_{jk})\).

For AS method: $$\rho_{arc} = \frac{n_2 \rho_1 + n_1 \rho_2}{n_1 + n_2}$$ This is the weighted average of the correlations from both groups.

For ASc method: $$\rho_{arc,c} = \frac{1}{se_1 \times se_2} \left(\frac{\rho_1 \sqrt{\nu_{11}\nu_{12}}}{4n_1\sqrt{\nu_{11,c}\nu_{12,c}}} + \frac{\rho_2 \sqrt{\nu_{21}\nu_{22}}}{4n_2\sqrt{\nu_{21,c}\nu_{22,c}}}\right)$$ where \(\nu_{jk,c} = (p_{jk} + c_j)(1 - p_{jk} - c_j)\), \(c_1 = -1/(2n_1)\), and \(c_2 = 1/(2n_2)\).

The correlation bounds are automatically checked using corrbound2Binary.

References

Sozu, T., Sugimoto, T., & Hamasaki, T. (2010). Sample size determination in clinical trials with multiple co-primary binary endpoints. Statistics in Medicine, 29(21), 2169-2179.

Examples

Run this code
# Power calculation using asymptotic normal method
power2BinaryApprox(
  n1 = 200,
  n2 = 100,
  p11 = 0.5,
  p12 = 0.4,
  p21 = 0.3,
  p22 = 0.2,
  rho1 = 0.7,
  rho2 = 0.7,
  alpha = 0.025,
  Test = 'AN'
)

# Power calculation with continuity correction
power2BinaryApprox(
  n1 = 200,
  n2 = 100,
  p11 = 0.5,
  p12 = 0.4,
  p21 = 0.3,
  p22 = 0.2,
  rho1 = 0.7,
  rho2 = 0.7,
  alpha = 0.025,
  Test = 'ANc'
)

# Power calculation using arcsine method
power2BinaryApprox(
  n1 = 150,
  n2 = 150,
  p11 = 0.6,
  p12 = 0.5,
  p21 = 0.4,
  p22 = 0.3,
  rho1 = 0.5,
  rho2 = 0.5,
  alpha = 0.025,
  Test = 'AS'
)

Run the code above in your browser using DataLab