fwer_est: A function used to compute Family wise error rate (FWER)...

Description Usage Arguments Details Value Author(s) References Examples

View source: R/fwer_est.R

Description

A function to compute the FWER cutoff for p-max using the estimated mixture null distribution

Usage

1
2
fwer_est(alpha10, alpha01, alpha00, alpha1, alpha2, input_pvalues, 
         alpha = 0.05, exact = 0)

Arguments

alpha00

A numeric number represents the proportion of null H_{00}

alpha01

A numeric number represents the proportion of null H_{01}

alpha10

A numeric number represents the proportion of null H_{10}

alpha1

A numeric number represents the proportion of null alpha==0

alpha2

A numeric number represents the proportion of null beta==0

input_pvalues

A matrix contains two columns of p-values for candidate mediators. Column 1 is the p-value of testing if an exposure is associated with the mediator (alpha!=0). Column 2 is the p-value of testing if a mediator is associated with the outcome adjusted for the exposure (beta!=0)

alpha

The designated significance level for FWER

exact

The option to choose from two methods. exact=0: approximation without estimating the CDFs; exact=1: estimate the CDFs nonparametrically

Details

A function to compute FWER cutoff for p-max accounting for the mixture null distribution. The methodology detail can be found in Dai et al (2020).

Value

A numeric number represents the output FWER cutoff

Author(s)

James Y. Dai and X. Wang

References

James Y. Dai, Janet L. Stanford, Michael LeBlanc. A multiple-testing procedure for high-dimensional mediation hypotheses, Journal of the American Statistical Association, 2020, DOI: 10.1080/01621459.2020.1765785.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data(snp_input)
input_pvalues <- snp_input
#To save time for illustration, we use 10 percent of rows
input_pvalues <- input_pvalues[sample(1:nrow(input_pvalues),
                               size = ceiling(nrow(input_pvalues)/10)),]

nullprop <- null_estimation(input_pvalues)
fwercut0 <- fwer_est(nullprop$alpha10,nullprop$alpha01,nullprop$alpha00,nullprop$alpha1,
nullprop$alpha2,input_pvalues,alpha=0.05,exact=0)

fwercut1 <- fwer_est(nullprop$alpha10,nullprop$alpha01,nullprop$alpha00,nullprop$alpha1,
nullprop$alpha2,input_pvalues,alpha=0.05,exact=1)

HDMT documentation built on Jan. 30, 2022, 1:07 a.m.

Related to fwer_est in HDMT...