This is the method of TWT.

TWT(z_mat, est_genetic_cor, est_pheno_cor, cutoff_value, coefficient_matrix)

Arguments

z_mat

is the matrix of z_scores with row number of rows stands for the number of phenotypes and number of columns stands for the number of variants.

est_genetic_cor

Estimated correlation matrix of genetic variants.

est_pheno_cor

Estimated correlation matrix of phenotypes.

cutoff_value

Set Omega.

coefficient_matrix

Calculated based on function approximate_distribution_coefficient_estimate_T3.

Value

p_value_final P_value of TWT.

p_1 P_value of T_1.

p_2 P_value of T_2.

p_3 P_value of T_3.

Examples

z_mat<-MASS::mvrnorm(n = 5,
                     mu=rep(0,5), 
                     Sigma = diag(nrow = 5, ncol = 5))
null_distribution<-generate_null_distribution_T3(
    m=25,
    n=1000,
    cov_mat=diag(nrow = 25,ncol= 25), 
    cutoff_value=c(0.2,0.4,0.6,0.8,1))
coefficient_matrix<- approximate_distribution_coefficient_estimate_T3(
        null_distribution_matrix = null_distribution)
res <- TWT(z_mat=z_mat,
           est_genetic_cor=diag(nrow = 5, ncol = 5),
           est_pheno_cor=diag(nrow = 5, ncol = 5), 
           cutoff_value=c(0.2,0.4,0.6,0.8,1),
           coefficient_matrix=coefficient_matrix)