This is the function calculating T3.

T_3(z_vector, cov_mat, cutoff_value, coefficient_matrix)

Arguments

z_vector

Column vectorized data matrix with rows represent phenotype and columns represent genotype.

cov_mat

Estimated covariance matrix of z_vector.

cutoff_value

Vector of truncated value eta.

coefficient_matrix

Matrix of alpha, beta and d.

Value

A numeric value represent p value of T3.

Examples

z_vector<-MASS::mvrnorm(1,mu=rep(0,10),
                        Sigma = diag(nrow = 10, ncol = 10))
null_distribution<-generate_null_distribution_T3(
    m=10,
    n=1000,
    cov_mat=diag(nrow = 10,ncol= 10), 
    cutoff_value=c(0.2,0.4,0.6,0.8,1))
coefficient_matrix<- approximate_distribution_coefficient_estimate_T3(
        null_distribution_matrix = null_distribution)
pvalue <- T_3(z_vector=z_vector, 
              cov_mat=diag(nrow = 10, ncol = 10),
              cutoff_value=c(0.2,0.4,0.6,0.8,1), 
              coefficient_matrix=coefficient_matrix)