Hypothesis Test

This vignette will introduce you to find the critical value for comparison of observed and expected obtained last step.

library(mixIndependR)

Simulate_DistK and Simulate_DistX simulate bundles of expected distributions for number of heterozygous loci and number of shared alleles respectively.

Simu_K <- Simulate_DistK(H,50,500)
Simu_X <- Simulate_DistX(e,25,500)

Dist_SimuChisq generates a bundle of chi-square values which can be distributed. ecdf build the cumulative probability functions for the chi-square values.

x2_K<-Dist_SimuChisq(Simu_K,ExpDist_K$Density,100)
x2_X<-Dist_SimuChisq(Simu_X,ExpDist_X$Density,100)
P1<-ecdf(x2_K)
P2<-ecdf(x2_X)