adapted.cmh.test.str.true: Adapted CMH test if starting frequencies are known, other...

View source: R/adapted.cmh.test.str.true.R

adapted.cmh.test.str.trueR Documentation

Adapted CMH test if starting frequencies are known, other frequencies estimated with sampling variances.

Description

This function performs the adapted CMH test (Spitzer et al. 2019), but in cases where the starting frequencies are known, and other frequencies estimated with sampling variances. Drift variance and sampling variance are taken into account for all none starting frequencies in this test.

Usage

adapted.cmh.test.str.true(freq, Ne, gen, cov, repli)

Arguments

freq

Numeric matrix of frequencies, with the row being the haplotype/SNP, and column being the sequenced time points.

Ne

Numeric vector with length as number of replicates, containing information of Ne (effective population size) at each replicated population. If Ne changes over time, take as input a numeric matrix, with the column being the replicate position, row being the Ne at each sequenced time points.

gen

Numeric vector of sequenced time points.

cov

Numeric matrix of sample size, with the row being the haplotype/SNP, and column being the sequenced time points.

repli

Numeric, specifying the number of replicated populations.

Value

Numeric vector, p-values from the hypothesis test

References

Spitzer, K., Pelizzola, M., Futschik, A., (2019), Modifying the Chi-square and the CMH test for population genetic inference: adapting to over-dispersion, The Annals of Applied Statistics 14(1): 202-220.

See Also

haplotest()


xthchen/haplotest documentation built on Nov. 29, 2022, 12:07 p.m.