Skip to contents

Produces numerical summaries of each fossilized birth–death process (FBD) posterior parameter by time bin.

Usage

FBD_summary(posterior, file = NULL, digits = 3)

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 by FBD_reshape.

file

An optional file path where the resulting table will be stored using write.csv.

digits

The number of digitis to round the summary results to. Default is 3. See round.

Value

A data frame with a row for each paramater and time bin, and columns for different summary statistics. These include the number of data points (n) and the mean, standard deviation (sd), minimum value (min), first quartile (Q1), median, third quartile (Q3), and maximum value (max). When file is not NULL, a .csv file containing this data frame will be saved to the filepath specified in file and the output will be returned invisibly.

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 parameters.

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_summary(posterior3p_long)
#>                 parameter Time_bin     n  mean    sd   min    Q1 median    Q3
#> 1          net_speciation        1 10000 0.044 0.019 0.000 0.031  0.043 0.057
#> 2          net_speciation        2 10000 0.028 0.016 0.001 0.015  0.025 0.037
#> 3          net_speciation        3 10000 0.020 0.013 0.000 0.011  0.018 0.027
#> 4          net_speciation        4 10000 0.047 0.024 0.000 0.029  0.047 0.065
#> 5     relative_extinction        1 10000 0.785 0.152 0.075 0.711  0.823 0.897
#> 6     relative_extinction        2 10000 0.926 0.048 0.551 0.901  0.935 0.961
#> 7     relative_extinction        3 10000 0.946 0.050 0.176 0.929  0.959 0.977
#> 8     relative_extinction        4 10000 0.031 0.096 0.000 0.000  0.000 0.007
#> 9  relative_fossilization        1 10000 0.039 0.051 0.000 0.011  0.023 0.047
#> 10 relative_fossilization        2 10000 0.066 0.043 0.002 0.035  0.055 0.086
#> 11 relative_fossilization        3 10000 0.014 0.021 0.000 0.003  0.007 0.016
#> 12 relative_fossilization        4 10000 0.043 0.112 0.000 0.000  0.001 0.020
#>      max
#> 1  0.168
#> 2  0.123
#> 3  0.122
#> 4  0.117
#> 5  0.998
#> 6  0.998
#> 7  1.000
#> 8  0.973
#> 9  0.723
#> 10 0.359
#> 11 0.542
#> 12 0.990