Package 'factorial2x2'

Title: Design and Analysis of a 2x2 Factorial Trial
Description: Used for the design and analysis of a 2x2 factorial trial for a time-to-event endpoint. It performs power calculations and significance testing as well as providing estimates of the relevant hazard ratios and the corresponding 95% confidence intervals. Important reference papers include Slud EV. (1994) <https://www.ncbi.nlm.nih.gov/pubmed/8086609> Lin DY, Gong J, Gallo P, Bunn PH, Couper D. (2016) <DOI:10.1111/biom.12507> Leifer ES, Troendle JF, Kolecki A, Follmann DA. (2020) <https://github.com/EricSLeifer/factorial2x2/blob/master/Leifer%20et%20al.%20paper.pdf>.
Authors: Eric Leifer and James Troendle
Maintainer: Eric Leifer <[email protected]>
License: GPL-2
Version: 0.2.0
Built: 2025-02-13 04:42:41 UTC
Source: https://github.com/cran/factorial2x2

Help Index


Hazard ratios and correlations for the 2x2 statistics

Description

Computes the hazard ratios, confidence intervals, p-values, and correlations for the overall A, simple A, and simple AB logrank statistics.

Usage

cor2x2(time, event, indA, indB, covmat)

Arguments

time

follow-up times

event

event indicators (0/1)

indA

treatment A indicators (0/1)

indB

treatment B indicators (0/1)

covmat

matrix of covariates; one row per subject. NOTE!! Factor variables must use 0/1 indicator variables

Details

This function computes (i) correlation between the overall A test and the simple A test (ii) correlation between the overall A test and the simple AB test (iii) correaltion between the simple A and simple AB test. The correlation estimates are derived in Lin, Gong, Gallo, et al. (Biometrics 2016).

Value

loghrA

overall A log hazard ratio

seA

standard error of the overall A log hazard ratio

hrA

overall A hazard ratio

ciA

95% confidence interval for overall A hazard ratio

pvalA

two-sided p-value for overall A hazard ratio

loghra

simple A log hazard ratio

sea

standard error of the simple A log hazard ratio

hra

simple A hazard ratio

cia

95% confidence interval for simple A hazard ratio

pvala

two-sided p-value for simple A hazard ratio

loghrab

simple AB log hazard ratio

seab

standard error of the simple AB log hazard ratio

hrab

simple AB hazard ratio

ciab

95% confidence interval for simple AB hazard ratio

pvalab

two-sided p-value for simple AB hazard ratio

corAa

correlation between the overall A and simple A test statistics

corAab

correlation between the overall A and simple AB test statistics

coraab

correlation between the simple A and simple AB test statistics

References

Lin, D.Y., Glong , J., Gallo, P., Bunn, P.H., Couper, D. Simultaneous inference on treatment effects in survival studies with factorial designs. Biometrics, 2016; 72: 1078-1085.

Examples

# First load the simulated data variables. The "simdat" file is
# a 100-by-9 matrix which is loaded with the factorial2x2 package.
time <- simdat[, "time"]
event <- simdat[, "event"]
indA <- simdat[, "indA"]
indB <- simdat[, "indB"]
covmat <- simdat[, 6:10]

cor2x2(time, event, indA, indB, covmat)
# $loghrA
# [1] 0.05613844

# $seA
# [1] 0.4531521

# $hrA
# [1] 1.057744

# $ciA
# [1] 0.4351608 2.5710556

# $pvalA
# [1] 0.9014069

# $loghra
# [1] 0.1987329

# $sea
# [1] 0.6805458

# $hra
# [1] 1.219856

# $cia
# [1] 0.3213781 4.6302116

# $pvala
# [1] 0.7702714

# $loghrab
# [1] 0.2864932

# $seab
# [1] 0.6762458

# $hrab
# [1] 1.331749

# $ciab
# [1] 0.3538265 5.0125010

# $pvalab
# [1] 0.6718193

# $corAa
# [1] 0.6123399

# $corAab
# [1] 0.5675396

# $coraab
# [1] 0.4642737

Critical values for the Equal Allocation 3, Proportional Allocation 2, and Equal Allocation 2 procedures

Description

Computes the critical values for null hypotheses rejection and corresponding nominal two-sided significance levels for the Equal Allocation 3, Proportional Allocation 2, and Equal Allocation 2 procedures

Usage

crit2x2(
  corAa,
  corAab,
  coraab,
  dig = 2,
  alpha = 0.05,
  niter = 5,
  abseps = 1e-05,
  tol = 1e-04
)

Arguments

corAa

correlation between the overall A and simple A log hazard ratio estimates

corAab

correlation between the overall A and simple AB log hazard ratio estimates

coraab

correlation between the simple A and simple AB log hazard ratio estimates

dig

number of decimal places to which we roundDown the critical value

alpha

two-sided familywise error level to control

niter

number of times we compute the critical values to average out the randomness from the pmvnorm function call

abseps

abseps setting in the pmvnorm function call

tol

tol setting in the uniroot function call

Details

This function computes the Dunnett-corrected critical values based on the asymptotic correlations of the overall A, simple A, and simple AB logrank statistics as described in Leifer, Troendle, et al. (2020) and are derived in Lin, Gong, et al. (2016) and Slud (1994). pmvnorm uses a random seed in its algorithm. To smooth out the randomness, pmvnorm is called niter times. The roundDown function is used in conjunction with the dig argument to insure that any rounding of the (negative) critical values will be done conservatively to control the familywise type I error at the desired level.

Value

critEA3

Equal Allocation 3 procedure's critical value for all three test statistics

sigEA3

two-sided nominal significance level corresponding to critEA3

critPA2A

Proportional Allocation 2 procedure's critical value for the overall A statistic

sigPA2A

two-sided nominal significance level corresponding to critPA2A

critPA2ab

Proportional Allocation 2 procedure's critical value for the simple AB statistic

sigPA2ab

two-sided nominal significance level corresponding to critPA2ab

critEA2

Equal Allocation 2 procedure's critical value for the simple A and AB statistics

sigEA2

two-sided nominal significance level corresponding to critEA2

References

Leifer, E.S., Troendle, J.F., Kolecki, A., Follmann, D. Joint testing of overall and simple effect for the two-by-two factorial design. 2020. Submitted.

Lin, D-Y., Gong, J., Gallo, P., et al. Simultaneous inference on treatment effects in survival studies with factorial designs. Biometrics. 2016; 72: 1078-1085.

Slud, E.V. Analysis of factorial survival experiments. Biometrics. 1994; 50: 25-38.

See Also

roundDown. eventProb, lgrkPower, strLgrkPower, pmvnorm

Examples

# Example 1:  Compute the nominal significance levels for rejection using
# the asymptotic correlations derived in Slud (1994)
corAa  <- 1/sqrt(2)
corAab <- 1/sqrt(2)
coraab <- 1/2

crit2x2(corAa, corAab, coraab, dig = 2, alpha = 0.05, niter = 5)
# critEA3
# [1] -2.32

# sigEA3
# [1] 0.02034088

# critPA2A
# [1] -2.13

# sigPA2A
# [1] 0.03317161

# critPA2ab
# [1] -2.24

# sigPA2ab
# [1] 0.02509092

# critEA2
# [1] -2.22

# sigEA2
# [1] 0.02641877

# Example 2:  Compute the nominal critical values and significance levels for rejection
# using the estimated correlations for simdat.
corAa  <- 0.6123399
corAab <- 0.5675396
coraab <- 0.4642737

crit2x2(corAa, corAab, coraab, dig = 2, alpha = 0.05, niter = 5)
# $critEA3
# [1] -2.34

# $critPA2A
# [1] -2.13

# $sigPA2A
# [1] 0.03317161

# $critPA2ab
# [1] -2.3

# $sigPA2ab
# [1] 0.02144822
#
# $sigEA3
# [1] 0.01928374

# $critEA2
# [1] -2.22

# $sigEA2
# [1] 0.02641877

Calculate event probabilities

Description

Calculates the event probabilities for each of the four factorial groups C, A, B, AB. The time unit is in years, but of course, any time unit could be used. Average event probabilities across various combinations of the groups are also calculated. The event times are assumed to be exponentially distributed. The censoring times are assumed to be uniformly distributed and indepedent of the event times.

Usage

eventProb(rateC, hrA, hrB, hrAB, mincens, maxcens)

Arguments

rateC

group C one year event rate

hrA

group A to group C hazard ratio

hrB

group B to group C hazard ratio

hrAB

group AB to group C hazard ratio

mincens

minimum censoring time

maxcens

maximum censoring time

Value

hazC

group C's exponential hazard rate

probC

event probability of the C group

probA

event probability of the A group

probB

event probability of the B group

probAB

event probability of the AB group

avgprob

average event probability across all factorial groups

probA_C

average event probablity of the A and C groups

probAB_C

average event probablity of the AB and C groups

Examples

# Corresponds to scenario 5 of Table 2 from Leifer, Troendle, et al. (2019).
rateC <- 0.0445
hrA <- 0.80
hrB <- 0.80
hrAB <- 0.72
mincens <- 4.0
maxcens <- 8.4
eventProb(rateC, hrA, hrB, hrAB, mincens, maxcens)
# hazC
# [1] 0.04552052

# probC
# [1] 0.2446365

# probA
# [1] 0.201254

# probB
# [1] 0.201254

# probAB
# [1] 0.1831806

# avgprob
# [1] 0.2075813

# probAB_C
# [1] 0.2139086

Significance testing for the Proportional Allocation 2, Equal Allocation 3, Equal Allocation 2 procedures

Description

Performs significance testing for the Proportional Allocation 2, Equal Allocation 3, Equal Allocation 2 procedures. Also reports the hazard ratios, 95% confidence intervals, p-values, nominal significance levels, and correlations for the overall and simple test statistics.

Usage

fac2x2analyze(time, event, indA, indB, covmat, alpha, dig = 2, niter = 5)

Arguments

time

follow-up times

event

event indicators (0/1)

indA

treatment A indicators (0/1)

indB

treatment B indicators (0/1)

covmat

covariate matrix, must be non-NULL. Factor variables MUST use 0/1 dummy variables

alpha

two-sided familywise significance level

dig

number of decimal places to which we roundDown the critical value

niter

number of interations passed to crit2x2 function call

Details

For each of the three multiple testing procedures, the critical values for the overall A (respectively, simple A) logrank statistics may be slightly different from the overall B (respectively, simple B) logrank statistics. This is due to their slightly different correlations with each other (i.e., correlation between overall A and simple A, respectively, overall B and simple B, statistics) as well as with the simple AB statistic.

Value

loghrAoverall

overall A log hazard ratio

seAoverall

standard error of the overall A log hazard ratio

ZstatAoverall

Z-statistic for the overall A log hazard ratio

pvalAoverall

two-sided p-value for the overall hazard ratio

hrAoverall

overall A hazard ratio

ciAoverall

95% confidence interval for the overall A hazard ratio

loghrAsimple

simple A log hazard ratio

seAsimple

standard error of the simple A log hazard ratio

ZstatAsimple

Z-statistic for the simple A log hazard ratio

pvalAsimple

two-sided p-value for the simple A hazard ratio

hrAsimple

simple A hazard ratio

ciAsimple

95% confidence interval for the simple A hazard ratio

loghrABsimple

simple AB log hazard ratio

seABsimple

standard error of the simple AB log hazard ratio

ZstatABsimple

Z-statistic for the simple AB log hazard ratio

pvalABsimple

two-sided p-value for the simple AB hazard ratio

hrABsimple

simple AB hazard ratio

ciABsimple

95% confidence interval for the simple AB hazard ratio

critEA3_A

Equal Allocation 3's critical value for the overall A simple A, and simple AB hypotheses

sigEA3_A

Equal Allocation 3's p-value rejection criterion for the overall A, simple A, and simple AB hypotheses

resultEA3_A

Equal Allocation 3's accept/reject decisions for the overall A, simple A, and simple AB hypotheses

critPA2overallA

Proportional Allocation 2's critical value for the overall A statistic

sigPA2overallA

Proportional Allocation 2's p-value rejection criterion for the overall A hypothesis

critPA2simpleAB

Proportional Allocation 2's critical value for the simple AB hypothesis

sigPA2simpleAB

Proportional Allocation 2 procedure's p-value rejection criterion for the simple AB hypothesis

resultPA2_A

Proportional Allocation 2 procedure's accept/reject decisions for the overall A and simple A hypotheses

critEA2_A

Equal Allocation 2 procedure's critical value for the simple A and simple AB hypotheses

sigEA2_A

Equal Allocation 2 procedure's p-value rejection criterion for the simple A and simple AB hypotheses

resultEA2_A

Equal Allocation 2 procedure's accept/reject decisions for the simple A and simple AB hypotheses

corAa

correlation between the overall A and simple A logrank statistics

corAab

correlation between the overall A and simple AB logrank statistics

coraab

correlation between the simple A and simple AB logrank statistics

Author(s)

Eric Leifer, James Troendle

References

Leifer, E.S., Troendle, J.F., Kolecki, A., Follmann, D. Joint testing of overall and simple effect for the two-by-two factorial design. (2020). Submitted.

Lin, D-Y., Gong, J., Gallo, P., et al. Simultaneous inference on treatment effects in survival studies with factorial designs. Biometrics. 2016; 72: 1078-1085.

Slud, E.V. Analysis of factorial survival experiments. Biometrics. 1994; 50: 25-38.

Examples

# First load the simulated data variables. The "simdataSub" file is
 # a 100-by-9 matrix which is loaded with the factorial2x2 package.
 time <- simdataSub[, "time"]
 event <- simdataSub[, "event"]
 indA <- simdataSub[, "indA"]
 indB <- simdataSub[, "indB"]
 covmat <- simdataSub[, 6:10]
 fac2x2analyze(time, event, indA, indB, covmat, alpha = 0.05, niter = 5)
#  $loghrA
# [1] 0.05613844

# $seA
# [1] 0.4531521

# $ZstatA
# [1] 0.1238843

# $pvalA
# [1] 0.9014069

# $hrA
# [1] 1.057744

# $ciA
# [1] 0.4351608 2.5710556

# $loghra
# [1] 0.1987329

# $sea
# [1] 0.6805458

# $Zstata
# [1] 0.2920198

# $pvala
# [1] 0.7702714

# $hra
# [1] 1.219856

# $cia
# [1] 0.3213781 4.6302116

# $loghrab
# [1] 0.2864932

# $seab
# [1] 0.6762458

# $Zstatab
# [1] 0.4236525

# $pvalab
# [1] 0.6718193

# $hrab
# [1] 1.331749

# $ciab
# [1] 0.3538265 5.0125010

# $critPA2A
# [1] -2.129

# $sigPA2A
# [1] 0.03325426

# $critPA2ab
# [1] -2.299

# $sigPA2ab
# [1] 0.02150494

# $result23
# [1] "accept overall A" "accept simple AB"

# $critEA3
# [1] -2.338

# $sigEA3
# [1] 0.01938725

# $result13
# [1] "accept overall A" "accept simple A"  "accept simple AB"

# $critEA2
# [1] -2.216

# $sigEA2
# [1] 0.0266915

# $result12
# [1] "accept simple A"  "accept simple AB"

# $corAa
# [1] 0.6123399

# $corAab
# [1] 0.5675396

# $coraab
# [1] 0.4642737

Power for the Equal Allocation 3, Proportional Allocation 2, and Equal Allocation 2 procedures.

Description

Power for the Equal Allocation 3, Proportional Allocation 2, and Equal Allocation 2 procedures.

Usage

fac2x2design(
  n,
  rateC,
  hrA,
  hrB,
  hrAB,
  mincens,
  maxcens,
  dig = 2,
  alpha = 0.05,
  niter = 5,
  abseps = 0.001,
  corAa = 1/sqrt(2),
  corAab = 1/sqrt(2),
  coraab = 1/2
)

Arguments

n

total sample size

rateC

group C one year event rate

hrA

group A to group C hazard ratio

hrB

group B to group C hazard ratio

hrAB

group AB to group C hazard ratio

mincens

minimum censoring time

maxcens

maximum censoring time

dig

number of decimal places to roundDown the critical value to

alpha

two-sided significance level

niter

number of times we call pmvnorm to average out its randomness

abseps

abseps setting in the pmvnorm call

corAa

correlation between the overall A and simple A log hazard ratio estimates

corAab

correlation between the overall A and simple AB log hazard ratio estimates

coraab

correlation between the simple A and simple AB log hazard ratio estimates

Value

events

expected number of events

evtprob

event probabilities for the C, A, B, and AB groups, respectively

powerEA3overallA

Equal Allocation 3's power to detect the overall A effect

powerEA3simpleA

Equal Allocation 3's power to detect the simple A effect

powerEA3simpleAB

Equal Allocation 3's power to detect the simple AB effect

powerEA3anyA

Equal Allocation 3's power to detect the simple A or AB effects

powerPA2overallA

Proportional Allocation 2's power to detect the overall A effect

powerPA2simpleAB

Proportional Allocation 2's power to detect the simple AB effect

powerEA2simpleA

Equal Allocation 2's power to detect the simple A effect

powerEA2simpleAB

Equal Allocation 2's power to detect the simple AB effect

powerA

power to detect the overall A effect at the two-sided alpha level

powerB

power to detect the overall B effect at the two-sided alpha level

References

Leifer, E.S., Troendle, J.F., Kolecki, A., Follmann, D. Joint testing of overall and simple effect for the two-by-two factorial design. (2019). Submitted.

Slud, E.V. Analysis of factorial survival experiments. Biometrics. 1994; 50: 25-38.

See Also

eventProb, crit2x2, lgrkPower strLgrkPower, powerEA3, powerPA2, powerEA2

Examples

# Corresponds to scenario 4 in Table 2 from Leifer, Troendle, et al. (2019).
n <- 4600
rateC <- 0.0445
hrA <- 0.80
hrB <- 0.80
hrAB <- 0.72
mincens <- 4.0
maxcens <- 8.4

fac2x2design(n, rateC, hrA, hrB, hrAB, mincens, maxcens, dig = 2, alpha = 0.05, niter = 1)
# $events
# [1] 954.8738

# $evtprob
# probC     probA     probB    probAB
# 0.2446365 0.2012540 0.2012540 0.1831806

# $powerEA3overallA
# [1] 0.5861992

# $powerEA3simpleA
# [1] 0.5817954

# $powerEA3simplAB
# [1] 0.9071236

# $powerEA3anyA
# [1] 0.7060777
# $powerPA2overallA
# [1] 0.6582819

# $powerPA2simpleAB
# [1] 0.9197286

# $powerEA2simpleA
# [1] 0.6203837
#
# $powerEA2simpleAB
# [1] 0.9226679

# $powerA
# [1] 0.7182932

# $powerB
# [1] 0.7182932

Unstratified (ordinary) logrank power

Description

Computes the power for the unstratified (ordinary) logrank statistic for two group comparison.

Usage

lgrkPower(hr, nevent, alpha = 0.05, rprob = 0.5)

Arguments

hr

hazard ratio

nevent

expected number of events

alpha

two-sided significance level

rprob

randomization probability

Details

Uses the formula at the bottom of p.317 from Schoenfeld (Biometrika, 1981) where the beta should be 1 - beta. The formula is modified to assume that values of the hazard ratio less than 1 correspond to treatment efficacy. We do this because we only want to include the probability of rejecting the null in favor of efficacy, not inferiority as well.

Value

power

logrank power

Author(s)

Eric Leifer, James Troendle

References

Schoenfeld, D. The asymptotic properties of nonparametric tests for comparing survival distributions. Biometrika. 1981; 68: 316-319.

Examples

hr <- 0.5
 nevent <- 98
 lgrkPower(hr, nevent, alpha = 0.05,  rprob = 0.5)
 # $power
 # [1] 0.9293463

Power of the Equal Allocation 2 procedure

Description

Computes the Equal Allocation 2's procedure power to detect the simple A effect and the simple AB effect, respectively.

Usage

powerEA2(n, hrA, hrAB, probA_C, probAB_C, crit12)

Arguments

n

total subjects with n/4 subjects in each of the C, A, B, and AB groups

hrA

group A to group C hazard ratio; hrA < 1 corresponds to group A superiority

hrAB

group AB to group C hazard ratio; hrAB < 1 corresponds to group AB superiority

probA_C

event probability averaged across the A and C groups

probAB_C

event probability averaged across the AB and C groups

crit12

logrank statistic critical value for both the simple A and simple AB effects

Details

For a 2-by-2 factorial design, this function computes the probability that either the simple A, respectively, simple AB logrank statistics reject their null hypotheses using a Dunnett-corrected crit12 critical value. When the two-sided familywise type I error is 0.05, we may use crit2x2 to compute crit12 = -2.22 which corresponds to a 0.0264 two-sided significance level. This is described in Leifer, Troendle, et al. (2020).

Value

powerEA2simpleA

power to detect the simple A effect

powerEA2simpleAB

power to detect the simple AB effect

References

Leifer, E.S., Troendle, J.F., Kolecki, A., Follmann, D. Joint testing of overall and simple effect for the two-by-two factorial design. (2020). Submitted.

Lin, D-Y., Gong, J., Gallo, P., et al. Simultaneous inference on treatment effects in survival studies with factorial designs. Biometrics. 2016; 72: 1078-1085.

Slud, E.V. Analysis of factorial survival experiments. Biometrics. 1994; 50: 25-38.

See Also

crit2x2, lgrkPower

Examples

# Corresponds to scenario 4 in Table 2 from Leifer, Troendle, et al. (2020).
rateC <- 0.0445  # one-year C group event rate
hrA <- 0.80
hrB <- 0.80
hrAB <- 0.72
mincens <- 4.0
maxcens <- 8.4
evtprob <- eventProb(rateC, hrA, hrB, hrAB, mincens, maxcens)
probA_C <- evtprob$probA_C
probAB_C <- evtprob$probAB_C
corAa  <- 1/sqrt(2)
corAab <- 1/sqrt(2)
coraab <- 1/2
dig <- 2
alpha <- 0.05
critEA2 <- crit2x2(corAa, corAab, coraab, dig, alpha)$critEA2
n <- 4600
powerEA2(n, hrA, hrAB, probA_C, probAB_C, critEA2)

# $powerEA2simpleA
# [1] 0.6203837

# $powerEA2simpleAB
# [1] 0.9226679

Power of the Equal Allocation 3 procedure

Description

Computes the Equal Allocation 3 procedure's power to detect the overall A effect, the simple A effect, or the simple AB effect, respectively.

Usage

powerEA3(
  n,
  hrA,
  hrB,
  hrAB,
  avgprob,
  probA_C,
  probAB_C,
  critEA3,
  dig,
  cormat12 = matrix(c(1, sqrt(0.5), sqrt(0.5), 1), byrow = T, nrow = 2),
  niter = 5,
  abseps = 0.001
)

Arguments

n

total subjects with n/4 subjects in each of the C, A, B, and AB groups

hrA

group A to group C hazard ratio; hrA < 1 corresponds to group A superiority

hrB

group B to group C hazard ratio; hrA < 1 corresponds to group A superiority

hrAB

group AB to group C hazard ratio; hrAB < 1 corresponds to group AB superiority

avgprob

event probability averaged across the C, A, B, and AB groups

probA_C

event probability averaged across the A and C groups

probAB_C

event probability averaged across the AB and C groups

critEA3

rejection critical value for the overall A, simple A, and simple AB logrank statistics

dig

number of decimal places to roundDown the critical value to

cormat12

asymptotic correlation matrix for the overall A and simple A, respectively, simple AB logrank statistics

niter

number of times we call pmvnorm to average out its randomness

abseps

abseps setting in the pmvnorm call

Details

For a 2-by-2 factorial design, this function computes the probability that either the overall A or the simple A or the simple AB logrank statistics reject their null hypotheses at the Dunnet-corrected critEA3 critical value. As described in Leifer, Troendle, et al. (2019), the critEA3 = -2.32 critical value corresponds to controlling the famiywise error of the Equal Allocation 3 procedure at the two-sided 0.05 significance level. The critical value -2.32 may be computed using the crit2x2 function. The pmvnorm function from the mvtnorm package is used to calculate the power for simultaneously detecting the overall and simple A effects. This is used to compute the power for detecting the overall A and/or simple A effects, which is computed as the sum of the powers for each of the effects minus the power for simultaneously detecting both effects. Since the power for simultaneously detecting both effects involves bivariate normal integration over an unbounded region in R^2, pmvnorm uses a random seed for these computations. Note that cRAN suggested we not include the random seed as an argument in this function. To smooth out the randomness, pmvnorm is called niter times and the average value over the niter calls is taken to be those powers.

Value

powerEA3overallA

power to detect the overall A effect

powerEA3simpleA

power to detect the simple A effect

powerEA3simpleAB

power to detect the simple AB effect

powerEA3anyA

power to detect either the overall A or simple A effects

References

Leifer, E.S., Troendle, J.F., Kolecki, A., Follmann, D. Joint testing of overall and simple effect for the two-by-two factorial design. (2020). Submitted.

Lin, D-Y., Gong, J., Gallo, P., et al. Simultaneous inference on treatment effects in survival studies with factorial designs. Biometrics. 2016; 72: 1078-1085.

Slud, E.V. Analysis of factorial survival experiments. Biometrics. 1994; 50: 25-38.

See Also

crit2x2, lgrkPower, strLgrkPower, pmvnorm

Examples

# Corresponds to scenario 5 in Table 2 from Leifer, Troendle, et al. (2020).
rateC <- 0.0445
hrA <- 0.80
hrB <- 0.80
hrAB <- 0.72
mincens <- 4.0
maxcens <- 8.4
evtprob <- eventProb(rateC, hrA, hrB, hrAB, mincens, maxcens)
avgprob <- evtprob$avgprob
probAB_C <- evtprob$probAB_C
probA_C <- evtprob$probA_C
dig <- 2
alpha <- 0.05
corAa  <- 1/sqrt(2)
corAab <- 1/sqrt(2)
coraab <- 1/2
critEA3 <- crit2x2(corAa, corAab, coraab, dig, alpha)$critEA3
n <- 4600
powerEA3(n, hrA, hrB, hrAB, avgprob, probA_C, probAB_C,
  critEA3, dig, cormat12 = matrix(c(1, sqrt(0.5), sqrt(0.5), 1), byrow = TRUE,
  nrow = 2), niter = 1, abseps = 1e-03)

# $powerEA3overallA
# [1] 0.5861992

# $powerEA3simpleA
# [1] 0.5817954

# $powerAB
# [1] 0.9071236

# $powerEA3anyA
# [1] 0.7060777

Power of the Proportional Allocation 2 procedure

Description

Computes the Proportional Allocation 2 procedure's power to detect the overall A effect or the simple AB effect, respectively.

Usage

powerPA2(n, hrA, hrB, hrAB, avgprob, probAB_C, critPA2A, critPA2ab, dig)

Arguments

n

total subjects with n/4 subjects in each of the C, A, B, and AB groups

hrA

group A to group C hazard ratio; hrA < 1 corresponds to group A superiority

hrB

group B to group C hazard ratio; hrA < 1 corresponds to group A superiority

hrAB

group AB to group C hazard ratio; hrAB < 1 corresponds to group AB superiority

avgprob

event probability averaged across the C, A, B, and AB groups

probAB_C

event probability averaged across the AB and C groups

critPA2A

rejection critical value for the overall A stratified logrank statistic

critPA2ab

rejection critical value for the simple AB ordinary logrank statistic

dig

number of decimal places to which we roundDown the critical value for the overall A test as calculated in powerPA2 by strLgrkPower

Details

The Proportional Allocation 2 procedure uses a two-sided 2/3 * alpha significance level to test the overall A effect and the remaining Dunnett-corrected type 1 error to thest the simple AB effect. When the familywise error is alpha = 0.05, this corresponds to a critical value critPA2A = -2.13. Then crit2x2 is used to compute a critical value critPA2ab = -2.24 to test the simple AB effect. This corresponds to a two-sided 0.0251 significance level. This controls the asymptotic familywise type I error for the two hypothesis tests at the two-sided 0.05 level. This is because of the 1/sqrt(2) asymptotic correlation between the logrank test statistics for the overall A and simple AB effects (Slud, 1994). The overall A effect's significance level 2/3 * 0.05 is prespecified and the simple AB effect's significance level 0.0251 is computed using crit2x2.

Value

powerPA2overallA

power to detect the overall A effect

powerPA2simpleAB

power to detect the simple AB effect

Author(s)

Eric Leifer, James Troendle

References

Leifer, E.S., Troendle, J.F., Kolecki, A., Follmann, D. Joint testing of overall and simple effect for the two-by-two factorial design. (2020). Submitted.

Lin, D-Y., Gong, J., Gallo, P., et al. Simultaneous inference on treatment effects in survival studies with factorial designs. Biometrics. 2016; 72: 1078-1085.

Slud, E.V. Analysis of factorial survival experiments. Biometrics. 1994; 50: 25-38.

See Also

crit2x2, eventProb, lgrkPower, strLgrkPower

Examples

# Corresponds to scenario 4 in Table 2 from Leifer, Troendle, et al. (2020).
 rateC <- 0.0445  # one-year C group event rate
 hrA <- 0.80
 hrB <- 0.80
 hrAB <- 0.72
 mincens <- 4.0
 maxcens <- 8.4
 evtprob <- eventProb(rateC, hrA, hrB, hrAB, mincens, maxcens)
 avgprob <- evtprob$avgprob
 probAB_C <- evtprob$probAB_C
 dig <- 2
 alpha <- 0.05
 corAa  <- 1/sqrt(2)
 corAab <- 1/sqrt(2)
 coraab <- 1/2
 critvals <- crit2x2(corAa, corAab, coraab, dig, alpha)
 critPA2A <- critvals$critPA2A
 critPA2ab <- critvals$critPA2ab
 n <- 4600
 powerPA2(n, hrA, hrB, hrAB, avgprob, probAB_C,
            critPA2A, critPA2ab, dig)
# $powerPA2overallA
# [1] 0.6582819

# $powerPA2simpleAB
# [1] 0.9197286

Round down a negative number

Description

Rounds a negative number to the nearest, more negative number to a specified decimal place.

Usage

roundDown(x, dig)

Arguments

x

number to be rounded

dig

number of decimal places to be rounded

Details

roundDown is used to round a negative Z-statistic critical value, which has (infinitely) many significant digits, to the nearest dig decimal place which is more extreme than the critical value itself. This is done to preserve the desired type I error level.

Examples

roundDown(-1.95456, 2)
# [1] -1.96

Simulated 2x2 factorial trial data

Description

A dataset mimicking data that might be obtained from a two-by-two factorial clinical trial. It is the first 100 rows of the data set simdata.

Usage

data(simdat)

Format

A data frame with 100 rows and 10 variables

Details

  • subjno subject ID

  • time time to event or censoring

  • event event indicator (1=event, 0=censoring)

  • indA indicator of receiving treatment A (1=yes, 0=no)

  • indB indicator of receiving treatment B (1=yes, 0=no)

  • cvd history of cardiovascular disease (1=yes, 0=no)

  • fac2-fac5 indicator variables for the 5 level factor variable


Simulated 2x2 factorial trial data

Description

A dataset mimicking data that might be obtained from a two-by-two factorial clinical trial.

Usage

data(simdata)

Format

A data frame with 4600 rows and 10 variables

Details

  • subjno subject ID

  • time time to event or censoring

  • event event indicator (1=event, 0=censoring)

  • indA indicator of receiving treatment A (1=yes, 0=no)

  • indB indicator of receiving treatment B (1=yes, 0=no)

  • cvd history of cardiovascular disease (1=yes, 0=no)

  • fac2-fac5 indicator variables for the 5 level factor variable


Simulated 2x2 factorial trial data

Description

A dataset mimicking data that might be obtained from a two-by-two factorial clinical trial. It is the first 100 rows of the data set simdata.

Usage

data(simdataSub)

Format

A data frame with 100 rows and 10 variables

Details

  • subjno subject ID

  • time time to event or censoring

  • event event indicator (1=event, 0=censoring)

  • indA indicator of receiving treatment A (1=yes, 0=no)

  • indB indicator of receiving treatment B (1=yes, 0=no)

  • cvd history of cardiovascular disease (1=yes, 0=no)

  • fac2-fac5 indicator variables for the 5 level factor variable


Stratified (overall) logrank power

Description

Computes the power for the overall treatment A effect based on the stratified logrank test based on Slud (1994).

Usage

strLgrkPower(n, hrA, hrB, hrAB, avgprob, dig = 2, alpha = 0.05)

Arguments

n

total subjects with n/4 subjects in the C, A, B, and AB groups

hrA

group A to group C hazard ratio

hrB

group B to group C hazard ratio

hrAB

group AB to group C hazard ratio

avgprob

average event probability across the four groups as calculated by the function eventProb

dig

number of decimal places to which we roundDown the critical value corresponding to alpha

alpha

two-sided significance level

Details

The roundDown function is used in conjunction with the dig argument to insure that any rounding of the (negative) critical values will be done conservatively to control the familywise type I error at the desired level.

Value

mean

logrank mean value

power

logrank power

nevent

expected number of events

Author(s)

Eric Leifer, James Troendle

References

Leifer, E.S., Troendle, J.F., Kolecki, A., Follmann, D. Joint testing of overall and simple effect for the two-by-two factorial design. (2019). Submitted.

Slud, E.V. Analysis of factorial survival experiments. Biometrics. 1994; 50: 25-38.

See Also

roundDown, eventProb

Examples

rateC <- 0.0445
hrA <- 0.80
hrB <- 0.80
hrAB <- 0.72
mincens <- 4.0
maxcens <- 8.4
avgprob <- eventProb(rateC, hrA, hrB, hrAB, mincens, maxcens)$avgprob
n <- 4600
strLgrkPower(n, hrA, hrB, hrAB, avgprob, dig = 2, alpha = 0.05)
# $mean
# [1] -2.537779

# $power
# [1] 0.7182932

# $nevent
# [1] 954.8738