Test for differences in FBD parameter values
FBD_tests2.Rd
FBD_tests2()
performs t-tests and Mann-Whitney U-tests to compare the average value of fossilized birth–death process (FBD) parameters between time bins.
Arguments
- posterior
A data frame of posterior parameter estimates containing a single "Time_bin" column and one column for each FBD parameter value. Such data frame can be imported using
combine_log
followed byFBD_reshape
.- p.adjust.method
The method use to adjust the p-values for multiple testing. See
p.adjust
for details and options. Default if"fdr"
for the Benjamini-Hochberg false discovery rate correction.
Details
pairwise.t.test
and pairwise.wilcox.test
are used to calculate, respectively, the t-test and Mann-Whitney U-tests statistics and p-values. Because the power of these tests depends on the number of posterior samples, it can be helpful to examine the distributions of FBD parameter posteriors using FBD_dens_plot
instead of relying heavily on the tests.
Value
A list with an element for each test, each of which contains a list of test results for each parameter. The results are in the form of a data frame containing the sample sizes and unadjusted and adjusted p-values for each comparison.
See also
vignette("fbd-params")
for the use of this function as part of an analysis pipeline.
combine_log
for producing a single data set of parameter posterior samples from individual parameter log files.
FBD_reshape
for converting posterior parameter table from wide to long format.
FBD_dens_plot
, FBD_normality_plot
, FBD_tests1
, and FBD_tests2
for other functions used to summarize and display the distributions of the parameter posteriors.
pairwise.t.test
and pairwise.wilcox.test
for the tests used.
Examples
# See vignette("fbd-params") for how to use this
# function as part of an analysis pipeline
data("posterior3p")
posterior3p_long <- FBD_reshape(posterior3p)
FBD_tests2(posterior3p_long)
#> $t_tests
#> $t_tests$net_speciation
#> parameter Time_bin1 Time_bin2 n1 n2 p-value p-value adj
#> 1 net_speciation 1 2 10000 10000 0.000000e+00 0.000000e+00
#> 2 net_speciation 1 3 10000 10000 0.000000e+00 0.000000e+00
#> 3 net_speciation 1 4 10000 10000 6.233495e-24 6.233495e-24
#> 4 net_speciation 2 3 10000 10000 2.211519e-178 2.653822e-178
#> 5 net_speciation 2 4 10000 10000 0.000000e+00 0.000000e+00
#> 6 net_speciation 3 4 10000 10000 0.000000e+00 0.000000e+00
#>
#> $t_tests$relative_extinction
#> parameter Time_bin1 Time_bin2 n1 n2 p-value p-value adj
#> 1 relative_extinction 1 2 10000 10000 0.000000e+00 0.000000e+00
#> 2 relative_extinction 1 3 10000 10000 0.000000e+00 0.000000e+00
#> 3 relative_extinction 1 4 10000 10000 0.000000e+00 0.000000e+00
#> 4 relative_extinction 2 3 10000 10000 3.621037e-48 3.621037e-48
#> 5 relative_extinction 2 4 10000 10000 0.000000e+00 0.000000e+00
#> 6 relative_extinction 3 4 10000 10000 0.000000e+00 0.000000e+00
#>
#> $t_tests$relative_fossilization
#> parameter Time_bin1 Time_bin2 n1 n2 p-value
#> 1 relative_fossilization 1 2 10000 10000 5.666499e-179
#> 2 relative_fossilization 1 3 10000 10000 1.447373e-164
#> 3 relative_fossilization 1 4 10000 10000 1.030473e-05
#> 4 relative_fossilization 2 3 10000 10000 0.000000e+00
#> 5 relative_fossilization 2 4 10000 10000 4.449998e-129
#> 6 relative_fossilization 3 4 10000 10000 3.026156e-220
#> p-value adj
#> 1 1.133300e-178
#> 2 2.171060e-164
#> 3 1.030473e-05
#> 4 0.000000e+00
#> 5 5.339997e-129
#> 6 9.078469e-220
#>
#>
#> $mwu_tests
#> $mwu_tests$net_speciation
#> parameter Time_bin1 Time_bin2 n1 n2 p-value p-value adj
#> 1 net_speciation 1 2 10000 10000 0.000000e+00 0.000000e+00
#> 2 net_speciation 1 3 10000 10000 0.000000e+00 0.000000e+00
#> 3 net_speciation 1 4 10000 10000 1.687839e-20 1.687839e-20
#> 4 net_speciation 2 3 10000 10000 7.102785e-263 8.523342e-263
#> 5 net_speciation 2 4 10000 10000 0.000000e+00 0.000000e+00
#> 6 net_speciation 3 4 10000 10000 0.000000e+00 0.000000e+00
#>
#> $mwu_tests$relative_extinction
#> parameter Time_bin1 Time_bin2 n1 n2 p-value
#> 1 relative_extinction 1 2 10000 10000 0.000000e+00
#> 2 relative_extinction 1 3 10000 10000 0.000000e+00
#> 3 relative_extinction 1 4 10000 10000 0.000000e+00
#> 4 relative_extinction 2 3 10000 10000 3.308183e-304
#> 5 relative_extinction 2 4 10000 10000 0.000000e+00
#> 6 relative_extinction 3 4 10000 10000 0.000000e+00
#> p-value adj
#> 1 0.000000e+00
#> 2 0.000000e+00
#> 3 0.000000e+00
#> 4 3.308183e-304
#> 5 0.000000e+00
#> 6 0.000000e+00
#>
#> $mwu_tests$relative_fossilization
#> parameter Time_bin1 Time_bin2 n1 n2 p-value p-value adj
#> 1 relative_fossilization 1 2 10000 10000 0 0
#> 2 relative_fossilization 1 3 10000 10000 0 0
#> 3 relative_fossilization 1 4 10000 10000 0 0
#> 4 relative_fossilization 2 3 10000 10000 0 0
#> 5 relative_fossilization 2 4 10000 10000 0 0
#> 6 relative_fossilization 3 4 10000 10000 0 0
#>
#>