Dest: Estimation Joost's Dest parameter

View source: R/dest.R

DestR Documentation

Estimation Joost's Dest parameter

Description

This function estimates the parameter (and potentially the confidence surrounding its value) for Joost's Dest.

Usage

Dest(x, stratum = "Population", nperm = 0, size.correct = FALSE)

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

A data.frame with Dest, Hs, Ht, and P (if asked for). When multiple loci are provided, the results also provide a multilocus estimate using the harmonic mean.

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))
 Dest( 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 )
 Dest( df, nperm=99)

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