get_pwt_rates_MrBayes {EvoPhylo} | R Documentation |
Conduct pairwise t-tests between node rates and clock base rate from a Mr.Bayes output.
Description
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.
Usage
get_pwt_rates_MrBayes(rate_table, posterior)
Arguments
rate_table |
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 |
posterior |
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 |
Details
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.
Value
A long data frame with one row per node per clock and the following columns:
clade |
The name of the clade, taken from the "clade" column of |
nodes |
The node number, taken from the "node" column of |
clock |
The clock partition number |
relative.rate |
The relative mean clock rate per node, taken from the "rates" columns of |
absolute.rate(mean) |
The absolute mean clock rate per node; the relative clock rate multiplied by the mean of the posterior clock rates |
null |
The absolute clock rate used as the null value in the t-test |
p.value |
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.
Examples
# See vignette("rates-selection") for how to use this
# function as part of an analysis pipeline
# Load example rate table and posterior data sets
data("RateTable_Means_3p_Clades")
data("posterior3p")
get_pwt_rates_MrBayes(RateTable_Means_3p_Clades, posterior3p)