Type: Package
Title: Correlated Weighted Hochberg
Version: 0.2.0
Description: Perform additional multiple testing procedure methods to p.adjust(), such as weighted Hochberg (Tamhane, A. C., & Liu, L., 2008) <doi:10.1093/biomet/asn018>, ICC adjusted Bonferroni method (Shi, Q., Pavey, E. S., & Carter, R. E., 2012) <doi:10.1002/pst.1514> and a new correlation corrected weighted Hochberg for correlated endpoints.
License: GPL (≥ 3)
Encoding: UTF-8
RoxygenNote: 7.3.2
Imports: dplyr, glue, magrittr, Matrix, tibble
NeedsCompilation: no
Packaged: 2024-07-30 20:18:09 UTC; huanxinw
Author: Xin-Wei Huang ORCID iD [aut, cre], Jia Hua [ctb], Bhramori Banerjee [ctb], Xuelong Wang [ctb], Qing Li [ctb], Merck & Co., Inc [cph, fnd]
Maintainer: Xin-Wei Huang <xinweihuangstat@gmail.com>
Repository: CRAN
Date/Publication: 2024-08-02 12:50:03 UTC

corrMCT: Correlated Weighted Hochberg

Description

Perform additional multiple testing procedure methods to p.adjust(), such as weighted Hochberg (Tamhane, A. C., & Liu, L., 2008) doi:10.1093/biomet/asn018, ICC adjusted Bonferroni method (Shi, Q., Pavey, E. S., & Carter, R. E., 2012) doi:10.1002/pst.1514 and a new correlation corrected weighted Hochberg for correlated endpoints.

Author(s)

Maintainer: Xin-Wei Huang xinweihuangstat@gmail.com (ORCID)

Other contributors:


Pipe operator

Description

See magrittr::%>% for details.

Usage

lhs %>% rhs

Arguments

lhs

A value or the magrittr placeholder.

rhs

A function call using the magrittr semantics.

Value

The result of calling rhs(lhs).


Weighted Hochberg method

Description

WHC performs the weighted Hochberg method proposed by Tamhane and Liu (2008).

Usage

WHC(p, w, alpha = 0.05)

Arguments

p

A numeric vector. A length m P-value vector from multiple tests.

w

A numeric vector. Any non-negative real numbers to denote the importance of the endpoints. Length must be equal to m. A single value, e.g. w = 1, represents equal weight. WHC can scale the weight vector as if the sum of weight is not 1.

alpha

A real number. 1-\alpha is the confidence level, alpha must between (0, 1).

Value

A table contains p-values, weights, adjusted critical values, significance

References

Tamhane, A. C., & Liu, L. (2008). On weighted Hochberg procedures. Biometrika, 95(2), 279-294.

Examples

m <- 5
WHC(
  p = runif(m),
  w = runif(m)
)

ICC adjusted Bonferroni method

Description

corr.Bonferroni performs the ICC adjusted Bonferroni method proposed by Shi, Pavey, and Carter(2012). Power law approximation by r is tricky, suggested options was listed in the paper.

Usage

corr.Bonferroni(p, ICC, r = 0, alpha = 0.05)

Arguments

p

A numeric vector. A length m P-value vector from multiple tests.

ICC

A number. Intraclass correlation correction factor, a real number between (0, 1).

r

A number. Tuning parameter for g** between (0, 1). Default r=0.

alpha

A real number. 1-\alpha is the confidence level, alpha must between (0, 1).

Value

A numeric vector of adjusted p-values.

References

Shi, Q., Pavey, E. S., & Carter, R. E. (2012). Bonferroni‐based correction factor for multiple, correlated endpoints. Pharmaceutical statistics, 11(4), 300-309.

Examples

m <- 10
corr.Bonferroni(
  p = runif(m),
  ICC = 0.3
)

Correlation adjusted weighted Hochberg method

Description

A new method implement correlation correction based on weighted Hochberg. An ACF is applied for weight reduction to conserve alpha. Details see Huang et al. (2024+). A correlation structure with too many zero leads the method reduce to weighted Hochberg.

Usage

corr.WHC(p, w, corr.mat, a = 0.5, b = 0.6, penalty = NULL, alpha = 0.05)

Arguments

p

A numeric vector. A length m P-value vector from multiple tests.

w

A numeric vector. Any non-negative real numbers to denote the importance of the endpoints. Length must be equal to m. A single value, e.g. w = 1, represents equal weight. WHC can scale the weight vector as if the sum of weight is not 1.

corr.mat

A matrix. The dimension must be m \times m. Positive correlation is the theoretical assumption, however, it is robust to run with some negative elements in the correlation matrix.

a

A numeric number. a \in (0,1) determines the greatest penalty on weight, Default a=0.5. Details see Huang et al (2024+).

b

A numeric number. b \in (0,1) is the shape parameter of the penalty function. b = 1 produce a linear function.

penalty

A function. User can define their own penalty function. The basic rule is the function must be monotone decreasing from 0 to 1, and range from 1 to a where a \in (0,1). A convex function is recommended. Concave function can produce result, but have no meaning on alpha conserving.

alpha

A real number. 1-\alpha is the confidence level, alpha must between (0, 1).

Value

A table contains p-values, weights, adjusted critical values, significance

References

Huang, X. -W., Hua, J., Banerjee, B., Wang, X., Li, Q. (2024+). Correlated weighted Hochberg procedure. In-preparation.

Examples

m <- 5
corr.WHC(
  p = runif(m),
  w = runif(m),
  corr.mat = cor(matrix(runif(10*m), ncol = m))
)

AR(1) correlation matrix

Description

An easy function to generate a AR(1) correlation matrix.

Usage

corrmat_AR1(m, rho)

Arguments

m

An integer. Dimension of the correlation matrix.

rho

A number. Correlation coefficient between (0,1)

Value

A correlation matrix

Examples

corrmat_AR1(
  m = 3,
  rho = 0.2
)

Compound symmetric correlation matrix

Description

An easy function to generate a compound symmetric correlation matrix

Usage

corrmat_CS(m, rho)

Arguments

m

An integer. Dimension of the correlation matrix.

rho

A number. Correlation coefficient between (0,1)

Value

A correlation matrix

Examples

corrmat_CS(
  m = 3,
  rho = 0.2
)

Block design correlation matrix

Description

An easy function to generate a block design correlation matrix. Each diagonal element R_i is a compound symmetric matrix with dimension d_i \times d_i. Correlation coefficient in each block is \rho_i. All the off-diagonal elements are 0.

Usage

corrmat_block(d, rho)

Arguments

d

An integer vector. Length B of block dimensions. Element of d can be 1, it would not generate a sub-matrix with the corresponding element in rho, but just 1.

rho

A numeric vector. A length B vector of correlation coefficients, represent B different block of correlation matrix.

Value

A correlation matrix

Examples

corrmat_block(
  d = c(2,3,4),
  rho = c(0.1, 0.3, 0.5)
)

Block AR(1) design correlation matrix

Description

An easy function to generate a block AR(1) design correlation matrix. Each diagonal element R_i is an AR(1) correlation matrix with dimension d_i \times d_i. Correlation coefficient in each block is \rho_i. All the off-diagonal elements are 0.

Usage

corrmat_blockAR1(d, rho)

Arguments

d

An integer vector. Length B of block dimensions. Element of d can be 1, it would not generate a sub-matrix with the corresponding element in rho, but just 1.

rho

A numeric vector. A length B vector of correlation coefficients, represent B different block of correlation matrix.

Value

A correlation matrix

Examples

corrmat_blockAR1(
  d = c(2,3,4),
  rho = c(0.1, 0.3, 0.5)
)