fstmatrix: fstmatrix

View source: R/fstmatrix.R

fstmatrixR Documentation

fstmatrix

Description

Cultural FST is a proportion of between-group cultural variance to the total cultural variance in a particular trait.

Usage

  fstmatrix(d, matrixtype = NULL) 

Arguments

d

A matrix where the first column is sample size, and the second column is trait frequency. Ideally, the row names are group identifiers

matrixtype

If unspecified, this function will return a full group x group square matrix. If "upper", this returns an upper triangular matrix, "lower" returns a lower traiangular matrix.

Value

This function returns a square group x group matrix that includes Cultural FST values between each group. If all of the variance lies between the groups, FST = 1. If all of the variance exists within groups, FST = 0.

Note

This function will work with 2 or more groups.

References

Bell, A. V., Richerson, P. J., & McElreath, R. (2009). Culture rather than genes provides greater scope for the evolution of large-scale human prosociality. Proceedings of the National Academy of Sciences, 106(42), 17671-17674.

Handley, C., & Mathew, S. (2020). Human large-scale cooperation as a product of competition between cultural groups. Nature communications, 11(1), 702.

Wright, S. (1965). The interpretation of population structure by F-statistics with special regard to systems of mating. Evolution, 395-420.

Examples

  # across 8 groups, we have sample size, and total number of participants who listed things coded as "moral" when asked to list things that anger a locally-respected god
  data(moralgod)
  fstmatrix(moralgod)
  fstdist <- as.dist(fstmatrix(moralgod, matrixtype = "lower"))
  plot(hclust(fstdist), ylab = NA, xlab = NA, main = NA) # dendrogram
  

alastair-JL/AnthroTools documentation built on Feb. 4, 2025, 8:44 p.m.