sig_sq: Helper function to get sigma squared values for a given...

View source: R/helpers.R

sig_sqR Documentation

Helper function to get sigma squared values for a given dataset

Description

Sigma squared values for a single niche summary statistic are calculated using fitContinuous.

Usage

sig_sq(tree_data, model = "BM")

Arguments

tree_data

a list of two elements (phy and data) resulted from using the function treedata. NOTE: data must be a single vector (i.e., a single column).

model

model to fit to comparative data; see fitContinuous. Default = "BM".

Value

the sigma squared value (evolutionary rate) for the data, given the tree.

Examples

# a simple tree
data("tree5", package = "nichevol")

# simple data
data <- rnorm(n = length(tree5$tip.label))
names(data) <- tree5$tip.label
# tree with data
treeWdata <- geiger::treedata(tree5, data)

# Estimating sigma squared for the dataset
sig_sq(treeWdata)

nichevol documentation built on March 31, 2023, 5:38 p.m.