Gst_prime: Estimation Nei's Gst parameter with Hedrick's correction for...

View source: R/gst_prime.R

Gst_primeR Documentation

Estimation Nei's Gst parameter with Hedrick's correction for allelic diversity

Description

This function estimates the parameter (and potentially the confidence surrounding its value) for Gst. It is corrected by the diversity of the parameter as outlined by Hedrick.

Usage

Gst_prime(x, stratum = "Population", nperm = 0, size.correct = TRUE)

Arguments

x

A vector of locus objects or a data.frame with locus objects.

stratum

Either a vector of strata variables if x is a locus vector or the name of the column representing strata in x if it is a data.frame.

nperm

The number of permutations to run for significance of the estimator.

size.correct

A flag indicating that the estimate should be corrected for based upon sample sizes (default=TRUE).

Value

An data.frame with Gst, Ht, and Hs and optionally P. If more than one locus is provided, then a 'mutlilocus' estimate is shown using the harmonic mean of individual locus Gst_prime values.

Author(s)

Rodney J. Dyer rjdyer@vcu.edu

Examples

 a1 <- sample( LETTERS[1:5], size=20, replace=TRUE)
 a2 <- sample( LETTERS[4:8], size=20, replace=TRUE)
 raw_alleles <- matrix( c(a1,a2), ncol=2, byrow=TRUE )
 locus <- locus( raw_alleles, type="column")
 Population <- c(rep("Pop-A",10),rep("Pop-B",10))
 Gst_prime( locus, Population )
 a1 <- sample( LETTERS[1:5], size=20, replace=TRUE)
 a2 <- sample( LETTERS[4:8], size=20, replace=TRUE)
 raw_alleles <- matrix( c(a1,a2), ncol=2, byrow=TRUE )
 locus2 <- locus( raw_alleles, type="column")
 df <- data.frame( Population, TPI=locus, PGM=locus2 )
 Gst_prime( df, nperm=99)

dyerlab/gstudio documentation built on Feb. 2, 2024, 8:24 p.m.