Last data update: 2014.03.03

R: Longs heterogeneity test for admixture proportions in a...
longX2R Documentation

Longs heterogeneity test for admixture proportions in a single population.

Description

For hybrid individuals genotyped with diagnostic markers (one allele fixed in each parental lineage), the null hypothesis that variation in allele frequencies is explained by sampling and drift (no selection) is evaluated with a chi-squared test statistic.

Usage

longX2(Freqs)

Arguments

Freqs

A vector of allele frequencies (one estimate per locus in a single population).

Value

A list with the following items is returned.

test

a list including the global test statistic, degrees of freedom, and p-value.

chisq.res

Chi-squared residuals for each marker

Author(s)

Ben Fitzpatrick

References

Long, J. C. (1991). The genetic structure of admixed populations. Genetics, 127:417-428. Fitzpatrick, B. M., Johnson, J. R., Kump, D. K., Shaffer, H. B., Smith, J. J., and Voss, S. R. (2009). Rapid fixation of non-native alleles revealed by genome-wide snp analysis of hybrid tiger salamanders. BMC Evolutionary Biology, 9:176.

Examples

longX2(c(0.95,rbeta(20,2,5)))

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(HIest)
Loading required package: nnet
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/HIest/longX2.Rd_%03d_medium.png", width=480, height=480)
> ### Name: longX2
> ### Title: Longs heterogeneity test for admixture proportions in a single
> ###   population.
> ### Aliases: longX2
> ### Keywords: ~kwd1 ~kwd2
> 
> ### ** Examples
> 
> longX2(c(0.95,rbeta(20,2,5)))
$test
     chisq df        p.val
1 67.50659 20 4.625406e-07

$chisq.res
 [1]  6.41158584  0.17362824 -1.32255379 -1.48873576 -0.48473413 -1.10317871
 [7] -1.27316811  0.37611218  0.08934681  0.38925691 -0.46080096  0.06510138
[13]  0.14937861  0.09365412 -2.44187772 -3.03941417 -0.45249498  0.74440202
[19]  0.44922457 -0.09391345  1.61575338

> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>