Package 'regrap'

Title: Reverse Graphical Approaches
Description: The graphical approach is proposed as a general framework for clinical trial designs involving multiple hypotheses, where decisions are made only based on the observed marginal p-values. A reverse graphical approach starts from a set of singleton graphs, and gradually add vertices into graphs until rejection of a set of hypotheses is made. See Gou, J. (2020). Reverse graphical approaches for multiple test procedures. Technical Report.
Authors: Jiangtao Gou [aut, cre], Fengqing Zhang [aut]
Maintainer: Jiangtao Gou <[email protected]>
License: GPL-3
Version: 1.0.1
Built: 2024-12-08 06:48:59 UTC
Source: CRAN

Help Index


Condition check for weak FWER control in RGA

Description

Check the sufficient condition in RGA for the weak FWER control.

Usage

checkConditionW(w, G)

Arguments

w

a vector of initial weights

G

a matrix of initial transaction weights

Details

The conditions verified here are sufficient conditions. If a logical value TRUE is returned, then the weak control of the FWER is guaranteed. The weak control of the FWER may still hold even if the output is FALSE.

Value

a logical value indicating whether the RGA's conditions are satisfied or not for the weak FWER control

Author(s)

Jiangtao Gou

Fengqing Zhang

Examples

w <- c(0.31, 0.33, 0.36)
G <- matrix(c(0,0.4,0.6, 0.7,0,0.3, 0.5,0.5,0),nrow=3,byrow=TRUE)
checkConditionW(w=w,G=G)
w <- c(0.5,0.5,0)
G <- matrix(c(0,1,0, 0.25,0,0.75, 1,0,0), nrow=3, byrow=TRUE)
checkConditionW(w=w,G=G)

Condition check for strong FWER control in RGA

Description

Check the sufficient condition in RGA for the strong FWER control.

Usage

conditionCheck(w, G)

Arguments

w

a vector of initial weights

G

a matrix of initial transaction weights

Details

The conditions verified here are sufficient conditions. If a logical value TRUE is returned, then the strong control of the FWER is guaranteed. The strong control of the FWER may still hold even if the output is FALSE.

Value

a logical value indicating whether the RGA's conditions are satisfied or not for the strong FWER control

Author(s)

Jiangtao Gou

Examples

w <- c(0.1,0.2,0.3,0.4)
G <- matrix(c(0,0.3,0.3,0.4, 0.6,0,0.2,0.2, 0.5,0.2,0,0.3, 0.3,0.4,0.3,0),nrow=4,byrow=TRUE)
conditionCheck(w=w,G=G)

Graphical approach for two hypotheses

Description

Graphical approach for two hypotheses

Usage

ga2h(w, G, p, alpha)

Arguments

w

a vector of initial weights

G

a matrix of initial transaction weights

p

a vector of p-values

alpha

a number of significance level

Value

a logical vector indicating whether the hypothesis is rejected: TRUE = rejected, FALSE = accepted

References

Bretz, F., Maurer, W., Brannath, W., and Posch, M. (2009). A graphical approach to sequentially rejective multiple test procedures. Statistics in Medicine 28, 586–-604. <doi:10.1002/sim.3495>

Examples

w <- c(0.3,0.7)
G <- matrix(c(0,1,1,0),nrow=2,byrow=TRUE)
p <- c(0.032, 0.038)
alpha <- 0.05
ga2h(w=w,G=G,p=p, alpha=alpha)

Graphical approach for three hypotheses

Description

Graphical approach for three hypotheses

Usage

ga3h(w, G, p, alpha)

Arguments

w

a vector of initial weights

G

a matrix of initial transaction weights

p

a vector of p-values

alpha

a number of significance level

Value

a logical vector indicating whether the hypothesis is rejected: TRUE = rejected, FALSE = accepted

Author(s)

Jiangtao Gou

References

Bretz, F., Maurer, W., Brannath, W., and Posch, M. (2009). A graphical approach to sequentially rejective multiple test procedures. Statistics in Medicine 28, 586–-604. <doi:10.1002/sim.3495>

Examples

w <- c(0.3,0.5,0.2)
G <- matrix(c(0,1/3,2/3, 1/2,0,1/2, 1/5,4/5,0),nrow=3,byrow=TRUE)
p <- c(0.012, 0.051, 0.021)
p <- c(0.012, 0.051, 0.019)
alpha <- 0.05
ga3h(w=w,G=G,p=p, alpha=alpha)

Graph Update

Description

Update the graph by removing a set of vertices

Usage

graphUpdate(w, G, vec01)

Arguments

w

a numeric vector of vertex weights

G

a matrix of transition weights

vec01

a binary vector indicating the set of vertices planned to be removed: the vertex corresponding to the zeros in this vector will be removed

Value

a list of one updated vertex weight vector, one updated transition weight matrix, and a binory TRUE/FALSE indicater to show whether a node has been removed

Author(s)

Jiangtao Gou

Examples

w <- c(0.1,0.2,0.3,0.4)
G <- matrix(c(0,0.3,0.3,0.4, 0.6,0,0.2,0.2, 0.5,0.2,0,0.3, 0.3,0.4,0.3,0),nrow=4,byrow=TRUE)
vec01 <- c(1,0,0,1)
graphUpdate(w=w,G=G,vec01=vec01)

Single Step Graph Update

Description

Update the graph by removing one vertex

Usage

graphUpdateOne(w, G, vec01)

Arguments

w

a numeric vector of vertex weights

G

a matrix of transition weights

vec01

a binary vector indicating the set of vertices planned to be removed: the vertex corresponding to the first zero in this vector will be removed

Value

a list of one updated vertex weight vector, one updated transition weight matrix, one updated indicator vector, and a binory TRUE/FALSE indicater to show whether a node has been removed

Author(s)

Jiangtao Gou

Examples

w <- c(0.1,0.2,0.3,0.4)
G <- matrix(c(0,0.3,0.3,0.4, 0.6,0,0.2,0.2, 0.5,0.2,0,0.3, 0.3,0.4,0.3,0),nrow=4,byrow=TRUE)
vec01 <- c(1,0,0,1)
graphUpdateOne(w=w,G=G,vec01=vec01)

Generate a Random Graph

Description

Generate a random graph from uniform distribution

Usage

randomGraph(n, seed = as.numeric(Sys.time()), wlim = c(0, 1), Glim = c(0, 1))

Arguments

n

an integer: number of vertices

seed

an integer: a seed for random number generator

wlim

a vector of two numbers: range of vertex weights

Glim

a vector of two numbers: range of transition weights

Value

A list of one vector for vertex weights and one matrix for transition weights

Author(s)

Jiangtao Gou

Fengqing Zhang

Examples

wG <- randomGraph(n=5)

reverse graphical approach for two hypotheses

Description

reverse graphical approach for two hypotheses

Usage

rga2h(w, G, p, alpha)

Arguments

w

a vector of initial weights

G

a matrix of initial transaction weights

p

a vector of p-values

alpha

a number of significance level

Value

a logical vector indicating whether the hypothesis is rejected: TRUE = rejected, FALSE = accepted

Author(s)

Jiangtao Gou

References

Gou, J. (2020). Reverse graphical approaches for multiple test procedures. Technical Report.

Examples

w <- c(0.3,0.7)
G <- matrix(c(0,1,1,0),nrow=2,byrow=TRUE)
p <- c(0.032, 0.038)
alpha <- 0.05
rga2h(w=w,G=G,p=p, alpha=alpha)

Power Analysis for Graphical Approaches and Reverse Graphical Approaches with Two Hypotheses

Description

Power Analysis for Graphical Approaches and Reverse Graphical Approaches with Two Hypotheses

Usage

rga2pwr(w, G, alpha, delta, corr, method = "rga")

Arguments

w

a vector of initial weights

G

a matrix of initial transaction weights

alpha

a number of significance level

delta

a vector of effect sizes

corr

a correlation matrix

method

a string specified the method: "rga" for Reverse Graphical Approaches and "ga" for Graphical Approaches

Value

a numerical matrix including the probabilities of four combinations of being rejected and being accepted for two hypotheses. Row indices stand for the first hypothesis, and column indices stand for the second hypothesis. The first index stands for the probability of acceptance, and the second index stands for the probability of rejection.

Author(s)

Jiangtao Gou

References

Bretz, F., Maurer, W., Brannath, W., and Posch, M. (2009). A graphical approach to sequentially rejective multiple test procedures. Statistics in Medicine 28, 586–-604. <doi:10.1002/sim.3495>

Gou, J. (2020). Reverse graphical approaches for multiple test procedures. Technical Report.

Examples

w <- c(0.3,0.7)
G <- matrix(c(0,1,1,0),nrow=2,byrow=TRUE)
alpha <- 0.05
delta <- c(0,2)
rho <- 0.0
corr <- matrix(c(1,rho,rho,1), nrow=2)
method="rga"
rga2pwr(w=w, G=G, alpha=alpha, delta=delta, corr=corr, method=method)

reverse graphical approach for three hypotheses

Description

reverse graphical approach for three hypotheses

Usage

rga3h(w, G, p, alpha)

Arguments

w

a vector of initial weights

G

a matrix of initial transaction weights

p

a vector of p-values

alpha

a number of significance level

Value

a logical vector indicating whether the hypothesis is rejected: TRUE = rejected, FALSE = accepted

Author(s)

Jiangtao Gou

References

Gou, J. (2020). Reverse graphical approaches for multiple test procedures. Technical Report.

Examples

w <- c(0.3,0.5,0.2)
G <- matrix(c(0,1/3,2/3, 1/2,0,1/2, 1/5,4/5,0),nrow=3,byrow=TRUE)
p <- c(0.012, 0.051, 0.021)
p <- c(0.012, 0.051, 0.019)
alpha <- 0.05
rga3h(w=w,G=G,p=p, alpha=alpha)