This is traditional chisq_test.

chisq_test(z_vector, cov_mat)

Arguments

z_vector

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

cov_mat

Estimated covariance matrix of z_vector.

Value

A numeric value represent the p value of chi-square test.

Examples

z_vector<-MASS::mvrnorm(n = 1,
                        mu=rep(0,9),
                        Sigma = diag(nrow = 9, ncol = 9))
ThreeWayTest::chisq_test(z_vector=z_vector, 
                         cov_mat=diag(nrow = 9, ncol = 9))
#> [1] 0.8801177