get_pwt_rates_MrBayes: Conduct pairwise t-tests between node rates and clock base...

View source: R/SelectionStrength.R

get_pwt_rates_MrBayesR Documentation

Conduct pairwise t-tests between node rates and clock base rate from a Mr.Bayes output.


Produces a data frame containing the results of 1-sample t-tests for the mean of posterior clock rates against each node's absolute clock rate.


get_pwt_rates_MrBayes(rate_table, posterior)



A data frame containing a single "value" column (for all rate values) and one column for the "clock" variable (indicating to which clock partition each rate values refers to), such as from the output of get_clockrate_table_MrBayes with an extra clade column added, and followed by clock_reshape.


A data frame of posterior parameter estimates including a "clockrate" column indicating the base of the clock rate estimate for each generation that will be used for pairwise t-tests. Such data frame can be imported using combine_log (no need to reshape from wide to long). See the posterior1p or posterior3p datasets for an examples of how the input file should look.


get_pwt_rates_MrBayes() first transforms relative clock rates to absolute rate values for each node and each clock, by multiplying these by the mean posterior clock rate base value. Then, for each node and clock, a one-sample t-test is performed with the null hypothesis that the mean of the posterior clockrates is equal to that node and clock's absolute clock rate.


A long data frame with one row per node per clock and the following columns:


The name of the clade, taken from the "clade" column of rate_table


The node number, taken from the "node" column of rate_table


The clock partition number


The relative mean clock rate per node, taken from the "rates" columns of rate_table


The absolute mean clock rate per node; the relative clock rate multiplied by the mean of the posterior clock rates


The absolute clock rate used as the null value in the t-test


The p-value of the test comparing the mean ofthe posterior clockrates to each absolute clockrate

See Also

vignette("rates-selection") for the use of this function as part of an analysis pipeline.



# See vignette("rates-selection") for how to use this
# function as part of an analysis pipeline

# Load example rate table and posterior data sets

get_pwt_rates_MrBayes(RateTable_Means_3p_Clades, posterior3p)

EvoPhylo documentation built on Nov. 4, 2022, 1:06 a.m.