Title: | Group-Sequential Procedures with Multiple Endpoints |
---|---|
Description: | Provides various testing procedures for group-sequential trials with multiple endpoints. Two sets of procedures are provided. |
Authors: | Xiaodong Luo [aut, cre], Hui Quan [ctb], Sanofi [cph] |
Maintainer: | Xiaodong Luo <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.0.0 |
Built: | 2025-02-16 03:00:28 UTC |
Source: | https://github.com/marvels2031/multigroupsequential |
Provides various testing procedures for group-sequential trials with multiple endpoints. Two sets of procedures are provided.
The DESCRIPTION file:
Package: | MultiGroupSequential |
Type: | Package |
Version: | 1.0.0 |
Date: | 2022-03-31 |
Title: | Group-Sequential Procedures with Multiple Endpoints |
Description: | Provides various testing procedures for group-sequential trials with multiple endpoints. Two sets of procedures are provided. |
Authors@R: | c( person(given="Xiaodong", family="Luo", email = "[email protected]", role =c("aut", "cre")), person(given="Hui", family="Quan", role = "ctb"), person("Sanofi", role = "cph")) |
Depends: | R (>= 4.0.0) |
Imports: | stats, rpact, gMCP, mvtnorm, OpenMx, hommel, minidown |
License: | GPL (>= 2) |
RoxygenNote: | 7.1.2 |
LazyData: | true |
Suggests: | knitr, rmarkdown |
VignetteBuilder: | knitr |
Config/pak/sysreqs: | make default-jdk libssl-dev libnode-dev |
Repository: | https://marvels2031.r-universe.dev |
RemoteUrl: | https://github.com/marvels2031/multigroupsequential |
RemoteRef: | HEAD |
RemoteSha: | 0c9e830c268337fdaf57f76910ef96f4d0647a20 |
Author: | Xiaodong Luo [aut, cre], Hui Quan [ctb], Sanofi [cph] |
Maintainer: | Xiaodong Luo <[email protected]> |
Index of help topics:
MultiGroupSequential-package Group-Sequential Procedures with Multiple Endpoints crosslist Cross list all the scenarios hxhochberg Hochberg procedure with different alphas for different endpoints hxhommel Hommel procedure with different alphas for different endpoints xccalgsp Calculate group-sequential p-values xccalgspcor Calculate group-sequential p-values given the correlation matrix of the test statistics xccalgspsim Calculate group-sequential p-values via simulation xccalgspsim1 Calculate group-sequential p-values via simulation xccrit Calculate critical values xcmaurerbretz Maurer-Bretz sequential graphical approach xcseqgxgs Sequential graphical procedure for multiple endpoints based on group-sequential p-values xcseqhh Sequential Hochberg/Hommel procedure for multiple endpoints based on q-values xcseqhhgs Sequential Hochberg/Hommel procedure for multiple endpoints based on group-sequential p-values xcspending Calculate alpha spending
Xiaodong Luo [aut, cre], Hui Quan [ctb], Sanofi [cph]
Maintainer: Xiaodong Luo <[email protected]>
Luo (2022)
Cross list all the scenarios
crosslist(b=list(a1=c(2,3),a2=c(2,4),a3=c(0,1)))
crosslist(b=list(a1=c(2,3),a2=c(2,4),a3=c(0,1)))
b |
A list of lists |
df |
dataframe consisting of all the scenarios row by row |
Xiaodong Luo
crosslist(b=list(pbo.hazard=c(0.1,0.15,0.3), hazard.ratio=c(0.6,0.7,0.8), censoring.rate=c(0.05,0.06,0.07) ) )
crosslist(b=list(pbo.hazard=c(0.1,0.15,0.3), hazard.ratio=c(0.6,0.7,0.8), censoring.rate=c(0.05,0.06,0.07) ) )
Hochberg procedure with different alphas for different endpoints
hxhochberg(pvalues,alpha,epsilon=1.0e-10,precision=10)
hxhochberg(pvalues,alpha,epsilon=1.0e-10,precision=10)
pvalues |
p-values from different endpoints |
alpha |
same length as |
epsilon |
lower bound for the alpha |
precision |
precision of the values |
This procedure handles Hochberg procedure with different alphas for different endpoints
decisions |
an index of rejected hypoetheses |
Xiaodong Luo
hxhochberg(pvalues=runif(5),alpha=seq(0.01,0.025,len=5),epsilon=1.0e-10,precision=10)
hxhochberg(pvalues=runif(5),alpha=seq(0.01,0.025,len=5),epsilon=1.0e-10,precision=10)
Hommel procedure with different alphas for different endpoints
hxhommel(pvalues,alpha,epsilon=1.0e-10,precision=10)
hxhommel(pvalues,alpha,epsilon=1.0e-10,precision=10)
pvalues |
p-values from different endpoints |
alpha |
same length as |
epsilon |
lower bound for the alpha |
precision |
precision of the values, obsolete for backward compatibility |
It turns out [hommel](https://cran.r-project.org/web/packages/hommel/) can handle Hommel procedure with different alpha's for different endpoints, the function 'hxhommel' is just a wrapper function.
decisions |
an index of rejected hypotheses |
Xiaodong Luo
hxhommel(pvalues=runif(5),alpha=seq(0.01,0.025,len=5),epsilon=1.0e-10,precision=10)
hxhommel(pvalues=runif(5),alpha=seq(0.01,0.025,len=5),epsilon=1.0e-10,precision=10)
This will calculate group-sequential p-values
xccalgsp(xm=qnorm(matrix(rep(c(0.03,0.04,0.01),times=2),ncol=3,nrow=2)), alpham=matrix(rep(c(0.02,0.03,0.05),each=2),ncol=3,nrow=2), informationm=matrix(rep(c(0.4,0.8,1),each=2),ncol=3,nrow=2),direction=-1)
xccalgsp(xm=qnorm(matrix(rep(c(0.03,0.04,0.01),times=2),ncol=3,nrow=2)), alpham=matrix(rep(c(0.02,0.03,0.05),each=2),ncol=3,nrow=2), informationm=matrix(rep(c(0.4,0.8,1),each=2),ncol=3,nrow=2),direction=-1)
xm |
a matrix of test statistics for each endpoint (in row) and each interim (in column) |
alpham |
a matrix of alpha spending for the statistics |
informationm |
a matrix of information fractions for the statistics |
direction |
-1: (one-sided)reject if test stat is smaller than or equal to the critical value; 1: (one-sided)reject if test stat is greater than or equal to the critical value; 0: (two-sided)reject if the absolute value of the test stat is greater than the critical value |
pm |
group-sequential p-values |
critm |
critical values |
Xiaodong Luo
xm=qnorm(matrix(rep(c(0.03,0.04,0.01),times=4),ncol=3,nrow=4)) im=matrix(rep(c(0.4,0.8,1),each=4),ncol=3,nrow=4) alpham=matrix(0,nrow=4,ncol=3) for (i in 1:4){ alpham[i,]=xcspending(alpha=0.025,fractions=im[i,],family="OBF",rho=(i+1)/2)$aseq } xccalgsp(xm=xm,alpham=alpham,informationm=im,direction=-1)
xm=qnorm(matrix(rep(c(0.03,0.04,0.01),times=4),ncol=3,nrow=4)) im=matrix(rep(c(0.4,0.8,1),each=4),ncol=3,nrow=4) alpham=matrix(0,nrow=4,ncol=3) for (i in 1:4){ alpham[i,]=xcspending(alpha=0.025,fractions=im[i,],family="OBF",rho=(i+1)/2)$aseq } xccalgsp(xm=xm,alpham=alpham,informationm=im,direction=-1)
This will calculate group-sequential p-values given the correlation matrix of the test statistics
xccalgspcor(xm=qnorm(c(0.03,0.04,0.01)), alpham=c(0.02,0.03,0.05), corrm=diag(length(xm)),direction=-1,tol=1e-10)
xccalgspcor(xm=qnorm(c(0.03,0.04,0.01)), alpham=c(0.02,0.03,0.05), corrm=diag(length(xm)),direction=-1,tol=1e-10)
xm |
a vector of test statistics at each analysis |
alpham |
a vector of alpha spending for the statistics |
corrm |
correlation matrix of the statistics |
direction |
-1: (one-sided)reject if test stat is smaller than or equal to the critical value; 1: (one-sided)reject if test stat is greater than or equal to the critical value; 0: (two-sided)reject if the absolute value of the test stat is greater than the critical value |
tol |
accuracy tolerance when calculating the quantiles |
pm |
group-sequential p-values |
critm |
critical values |
Xiaodong Luo
xm=qnorm(matrix(rep(c(0.03,0.04,0.01),times=2),ncol=3,nrow=2)) ir=c(0.4,0.8,1) corrm=diag(length(ir)) for (i in 1:length(ir))for(j in 1:length(ir))corrm[i,j]=sqrt(ir[pmin(i,j)]/ir[pmax(i,j)]) xccalgsp(xm=xm)$critm[1,] xccalgspsim(xm=xm)$critm[1,] xccalgspcor(xm=xm[1,],corrm=corrm)$critm
xm=qnorm(matrix(rep(c(0.03,0.04,0.01),times=2),ncol=3,nrow=2)) ir=c(0.4,0.8,1) corrm=diag(length(ir)) for (i in 1:length(ir))for(j in 1:length(ir))corrm[i,j]=sqrt(ir[pmin(i,j)]/ir[pmax(i,j)]) xccalgsp(xm=xm)$critm[1,] xccalgspsim(xm=xm)$critm[1,] xccalgspcor(xm=xm[1,],corrm=corrm)$critm
This will calculate group-sequential p-values via simulation
xccalgspsim(xm=qnorm(matrix(rep(c(0.03,0.04,0.01),times=2),ncol=3,nrow=2)), alpham=matrix(rep(c(0.02,0.03,0.05),each=2),ncol=3,nrow=2), informationm=matrix(rep(c(0.4,0.8,1),each=2),ncol=3,nrow=2), r.seed=rep(17,2),nsample=1e+6,direction=-1)
xccalgspsim(xm=qnorm(matrix(rep(c(0.03,0.04,0.01),times=2),ncol=3,nrow=2)), alpham=matrix(rep(c(0.02,0.03,0.05),each=2),ncol=3,nrow=2), informationm=matrix(rep(c(0.4,0.8,1),each=2),ncol=3,nrow=2), r.seed=rep(17,2),nsample=1e+6,direction=-1)
xm |
a matrix of test statistics for each endpoint (in row) and each interim (in column) |
alpham |
a matrix of alpha spending for the statistics |
informationm |
a matrix of information fractions for the statistics |
r.seed |
random seeds for each endpoints |
nsample |
number of random samples |
direction |
-1: (one-sided)reject if test stat is smaller than or equal to the critical value; 1: (one-sided)reject if test stat is greater than or equal to the critical value; 0: (two-sided)reject if the absolute value of the test stat is greater than the critical value |
pm |
group-sequential p-values |
critm |
critical values |
This provides the calculation for the group-sequential p-values in case there is an issue in using rpact package.
Xiaodong Luo
xm=qnorm(matrix(rep(c(0.03,0.04,0.01),times=4),ncol=3,nrow=4)) im=matrix(rep(c(0.4,0.8,1),each=4),ncol=3,nrow=4) alpham=matrix(0,nrow=4,ncol=3) for (i in 1:4){ alpham[i,]=xcspending(alpha=0.025,fractions=im[i,],family="OBF",rho=(i+1)/2)$aseq } xccalgspsim(xm=xm,alpham=alpham,informationm=im,r.seed=rep(17,4),direction=-1)
xm=qnorm(matrix(rep(c(0.03,0.04,0.01),times=4),ncol=3,nrow=4)) im=matrix(rep(c(0.4,0.8,1),each=4),ncol=3,nrow=4) alpham=matrix(0,nrow=4,ncol=3) for (i in 1:4){ alpham[i,]=xcspending(alpha=0.025,fractions=im[i,],family="OBF",rho=(i+1)/2)$aseq } xccalgspsim(xm=xm,alpham=alpham,informationm=im,r.seed=rep(17,4),direction=-1)
This utility function will be called by function "xccalgspsim" to calculate group-sequential p-values via simulation for single endpoint
xccalgspsim1(xm=qnorm(c(0.03,0.04,0.01)),alpham=c(0.02,0.03,0.05), informationm=c(0.4,0.8,1), r.seed=17,nsample=1e+6,direction=0)
xccalgspsim1(xm=qnorm(c(0.03,0.04,0.01)),alpham=c(0.02,0.03,0.05), informationm=c(0.4,0.8,1), r.seed=17,nsample=1e+6,direction=0)
xm |
test statistics |
alpham |
alpha spending |
informationm |
information fractions |
r.seed |
random seed |
nsample |
number of random samples |
direction |
-1: (one-sided)reject if test stat is smaller than or equal to the critical value; 1: (one-sided)reject if test stat is greater than or equal to the critical value; 0: (two-sided)reject if the absolute value of the test stat is greater than the critical value |
crit.value |
critical values |
p.value.gs |
group-sequential p-values |
xm |
test statistics |
alpham |
alpha spending |
informationm |
information fractions |
This provides the calculation for the group-sequential p-values in case there is an issue in using rpact package.
Xiaodong Luo
xm=qnorm(c(0.03,0.04,0.01)) im=c(0.4,0.8,1) alpham=xcspending(alpha=0.025,fractions=im,family="OBF",rho=2)$aseq xccalgspsim1(xm=xm,alpham=alpham,informationm=im,direction=-1)
xm=qnorm(c(0.03,0.04,0.01)) im=c(0.4,0.8,1) alpham=xcspending(alpha=0.025,fractions=im,family="OBF",rho=2)$aseq xccalgspsim1(xm=xm,alpham=alpham,informationm=im,direction=-1)
This utility function calculates the critical values
xccrit(direction=-1,alpha=0.025,informationRates=c(0.4,0.7,1), userAlphaSpending=c(0.01,0.015,0.025),alpha.low=1e-10)
xccrit(direction=-1,alpha=0.025,informationRates=c(0.4,0.7,1), userAlphaSpending=c(0.01,0.015,0.025),alpha.low=1e-10)
direction |
-1: (one-sided)reject if test stat is smaller than or equal to the critical value; 1: (one-sided)reject if test stat is greater than or equal to the critical value; 0: (two-sided)reject if the absolute value of the test stat is greater than the critical value |
alpha |
overall familywise error rate |
informationRates |
information fractions |
userAlphaSpending |
alpha spent at each interim |
alpha.low |
default is 1e-10, if allocated alpha is smaller than this number, the corresponding critical value will be set to infinity |
crit |
critical values |
Xiaodong Luo
xccrit(direction=-1,alpha=0.025,informationRates=c(0.4,0.7,1), userAlphaSpending=c(0.01,0.015,0.025),alpha.low=1e-10)
xccrit(direction=-1,alpha=0.025,informationRates=c(0.4,0.7,1), userAlphaSpending=c(0.01,0.015,0.025),alpha.low=1e-10)
This will conduct group-sequential testing for multiple endpoints based on Maurer-Bretz approach
xcmaurerbretz(xm=qnorm(matrix(rep(c(0.03,0.04,0.01),times=4),ncol=3,nrow=4)), informationm=matrix(rep(c(0.4,0.8,1),each=4),ncol=3,nrow=4), spending=rep("OBF",4),param.spending=rep(1,4), alpha=0.025,direction=-1,graphin=BonferroniHolm(nrow(xm)), alpha.low=1e-10,retrospective=0)
xcmaurerbretz(xm=qnorm(matrix(rep(c(0.03,0.04,0.01),times=4),ncol=3,nrow=4)), informationm=matrix(rep(c(0.4,0.8,1),each=4),ncol=3,nrow=4), spending=rep("OBF",4),param.spending=rep(1,4), alpha=0.025,direction=-1,graphin=BonferroniHolm(nrow(xm)), alpha.low=1e-10,retrospective=0)
xm |
a matrix of test statistics for each endpoint (in row) and each interim (in column) |
informationm |
a matrix of information fractions for the statistics |
spending |
spending functions for each endpoint |
param.spending |
parameters in the spending functions |
alpha |
overall familywise error rate |
direction |
-1: (one-sided)reject if test stat is smaller than or equal to the critical value; 1: (one-sided)reject if test stat is greater than or equal to the critical value; 0: (two-sided)reject if the absolute value of the test stat is greater than the critical value |
graphin |
a graph object generated from gMCP |
alpha.low |
default is 1e-10, if allocated alpha is smaller than this number, the corresponding critical value will be set to infinity |
retrospective |
retrospective: 0 (default) only compares the current test statistic with the updated critical value, 1 compares all the test statistics up to the current one with the updated critical values. Even though retrospective looking at the values is statistically valid in terms of control of the type-1 error rate, no retrospective looking at the past comparisons avoids the dilemma of retrospectively increasing the alpha level for the un-rejected hypothesis in the past |
Hrej |
rejected hypotheses |
rejected |
the index set of rejected hypotheses |
decisionsm |
rejection decision for each endpoint (row) at each timepoint (column) |
cumdecisionsm |
cumulative rejection decision for each endpoint (row) at each timepoint (column) |
Xiaodong Luo
Sys.setenv(JAVA_HOME="C:/Program Files/Java/jdk-17.0.2/") library(gMCP) xm=qnorm(matrix(rep(c(0.03,0.04,0.01),times=4),ncol=3,nrow=4)) im=matrix(rep(c(0.4,0.8,1),each=4),ncol=3,nrow=4) spending=rep("OBF",4) param.spending=rep(1,4) graphin=gMCP::BonferroniHolm(nrow(xm)) xcmaurerbretz(xm=xm, informationm=im, spending=spending, param.spending=param.spending, graphin=graphin)
Sys.setenv(JAVA_HOME="C:/Program Files/Java/jdk-17.0.2/") library(gMCP) xm=qnorm(matrix(rep(c(0.03,0.04,0.01),times=4),ncol=3,nrow=4)) im=matrix(rep(c(0.4,0.8,1),each=4),ncol=3,nrow=4) spending=rep("OBF",4) param.spending=rep(1,4) graphin=gMCP::BonferroniHolm(nrow(xm)) xcmaurerbretz(xm=xm, informationm=im, spending=spending, param.spending=param.spending, graphin=graphin)
Sequential graphical procedure for multiple endpoints based on group-sequential p-values
xcseqgxgs(pm=matrix(rep(c(0.03,0.04,0.01),times=2),ncol=3,nrow=2), alpha=0.025,graphin=BonferroniHolm(2))
xcseqgxgs(pm=matrix(rep(c(0.03,0.04,0.01),times=2),ncol=3,nrow=2), alpha=0.025,graphin=BonferroniHolm(2))
pm |
a matrix of group-sequential p-values for different endpoints (in row) at different times (in column) |
alpha |
overall familywise error rate |
graphin |
graph to be used, this is graph object defined by the gMCP package |
rejected |
the index set of rejected hypotheses |
decisionsm |
rejection decision for each endpoint (row) at each timepoint (column) |
cumdecisionsm |
cumulative rejection decision for each endpoint (row) at each timepoint (column) |
This provides the calculation for the variance.
Xiaodong Luo
Sys.setenv(JAVA_HOME="C:/Program Files/Java/jdk-17.0.2/") library(gMCP) pm=matrix(rep(c(0.03,0.04,0.01),times=2),ncol=3,nrow=2) graphin=gMCP::BonferroniHolm(2) xcseqgxgs(pm=pm,alpha=0.025,graphin=graphin)
Sys.setenv(JAVA_HOME="C:/Program Files/Java/jdk-17.0.2/") library(gMCP) pm=matrix(rep(c(0.03,0.04,0.01),times=2),ncol=3,nrow=2) graphin=gMCP::BonferroniHolm(2) xcseqgxgs(pm=pm,alpha=0.025,graphin=graphin)
Sequential Hochberg/Hommel procedure for multiple endpoints based on q-values
xcseqhh(pm=matrix(rep(c(0.03,0.04,0.01),times=2),ncol=3,nrow=2), alpham=matrix(rep(c(0.02,0.03,0.05),each=2),ncol=3,nrow=2), epsilon=1.0e-10,precision=10,method='Hochberg')
xcseqhh(pm=matrix(rep(c(0.03,0.04,0.01),times=2),ncol=3,nrow=2), alpham=matrix(rep(c(0.02,0.03,0.05),each=2),ncol=3,nrow=2), epsilon=1.0e-10,precision=10,method='Hochberg')
pm |
a matrix of group-sequential p-values for different endpoints (in row) at different times (in column) |
alpham |
a matrix of alpha spending corresponding to the p-values |
epsilon |
lower bound for the alpha |
precision |
precision of the values |
method |
"Hochberg" or "Hommel" |
rejected |
the index set of rejected hypotheses |
decisionsm |
rejection decision for each endpoint (row) at each timepoint (column) |
cumdecisionsm |
cumulative rejection decision for each endpoint (row) at each timepoint (column) |
alphaused |
alpha levels actually used for each endpoint (row) at each timepoint (column) |
This provides the calculation for the variance.
Xiaodong Luo
pm=matrix(rep(c(0.03,0.04,0.01),times=2),ncol=3,nrow=2) alpham=matrix(rep(c(0.02,0.03,0.05),each=2),ncol=3,nrow=2) xcseqhh(pm=pm,alpham=alpham,method="Hochberg") xcseqhh(pm=pm,alpham=alpham,method="Hommel")
pm=matrix(rep(c(0.03,0.04,0.01),times=2),ncol=3,nrow=2) alpham=matrix(rep(c(0.02,0.03,0.05),each=2),ncol=3,nrow=2) xcseqhh(pm=pm,alpham=alpham,method="Hochberg") xcseqhh(pm=pm,alpham=alpham,method="Hommel")
Sequential Hochberg/Hommel procedure for multiple endpoints based on group-sequential p-values
xcseqhhgs(pm=matrix(rep(c(0.03,0.04,0.01),times=2),ncol=3,nrow=2), alpha=0.025,epsilon=1.0e-10,precision=10,method='Hochberg')
xcseqhhgs(pm=matrix(rep(c(0.03,0.04,0.01),times=2),ncol=3,nrow=2), alpha=0.025,epsilon=1.0e-10,precision=10,method='Hochberg')
pm |
a matrix of group-sequential p-values for different endpoints (in row) at different times (in column) |
alpha |
overall familywise error rate |
epsilon |
lower bound for the alpha |
precision |
precision of the values |
method |
"Hochberg" or "Hommel" |
rejected |
the index set of rejected hypotheses |
decisionsm |
rejection decision for each endpoint (row) at each timepoint (column) |
cumdecisionsm |
cumulative rejection decision for each endpoint (row) at each timepoint (column) |
This provides the calculation for the variance.
Xiaodong Luo
pm=matrix(rep(c(0.03,0.04,0.01),times=2),ncol=3,nrow=2) xcseqhhgs(pm=pm,alpha=0.025,method="Hochberg") xcseqhhgs(pm=pm,alpha=0.025,method="Hommel")
pm=matrix(rep(c(0.03,0.04,0.01),times=2),ncol=3,nrow=2) xcseqhhgs(pm=pm,alpha=0.025,method="Hochberg") xcseqhhgs(pm=pm,alpha=0.025,method="Hommel")
This utility function calculates alpha spending. Note that the OBF and Pocock spending functions are not the originally proposed ones, they are the modified ones that are closely resemble the original versions. That being said, you might still see some differences
xcspending(alpha,fractions=seq(0.2,1,by=0.2),family="OBF",rho=1)
xcspending(alpha,fractions=seq(0.2,1,by=0.2),family="OBF",rho=1)
alpha |
overall familywise error rate |
fractions |
information fractions |
family |
family of spending functions, one of "OBF", "pocock", "power" |
rho |
parameter of the spending function |
OBF: ;
pocock:
;
power:
aseq |
alpha spending |
Xiaodong Luo
xcspending(alpha=0.025,fractions=seq(0.2,1,by=0.2),family="OBF",rho=1)
xcspending(alpha=0.025,fractions=seq(0.2,1,by=0.2),family="OBF",rho=1)