pvalue_arbutus: Extract p-values for test statistics

View source: R/compare.summStat.R

pvalue_arbutusR Documentation

Extract p–values for test statistics

Description

Utility function for extracting p-values from the output of compare_pic_stat

Usage

pvalue_arbutus(x)

Arguments

x

an arbutus object from the function compare_pic_stat

Value

a named vector of two-tailed p-values

See Also

compare_pic_stat

Examples

data(finch)
phy <- finch$phy
dat <- finch$data[,"wingL"]
unit.tree <- make_unit_tree(phy, data=dat)

## calculate default test stats on observed data
obs <- calculate_pic_stat(unit.tree, stats=NULL)

## simulate data on unit.tree
sim.dat <- simulate_char_unit(unit.tree, nsim=10)

## calculate default test stats on simulated data
sim <- calculate_pic_stat(sim.dat, stats=NULL)

## compare simulated to observed test statistics
res <- compare_pic_stat(obs, sim)

## get p-values
pvalue_arbutus(res)

## note these are returned by default with print.arbutus
res


mwpennell/arbutus documentation built on Oct. 6, 2022, 10 a.m.