Description Usage Arguments Value
View source: R/compare_posterior.R
Compares two posterior samples through differencing. Can be used to compare two NEC values from jagsNEC or jagsMANEC model fits, two ECx values from jagsNEC or jagsMANEC model fits, or simply any two posteriors passed as numeric vectors.
1 2 3 4 5 6 7 | compare_posterior(
x,
y,
comparison = "NEC",
ECx.val = 10,
ECx.type = "absolute"
)
|
x |
a jagsNEC or jagsMANEC model fit as returned by fit.jagsNEC or fit.jagsMANEC, or a numeric vector. |
y |
a jagsNEC or jagsMANEC model fit as returned by fit.jagsNEC or fit.jagsMANEC, or a numeric vector. |
comparison |
a character vector indicating the type of comparison to make. Takes values of NEC, ECx or custom. |
ECx.val |
the desired percentage effect value. This must be a value between 1 and 99 (for type = "relative" and "absolute"), defaults to 10. |
type |
a character vector indicating the type of ECx.val to calculate, taking values of "relative", "absolute" (the default) or "direct". Type "relative" is calculated as the percentage decrease from the maximum predicted value of the response (top) to the minimum predicted value of the response. Type "absolute" (the default) is calculated as the percentage decrease from the maximum value of the response (top) to 0 (or bot for a 4 parameter model fit when the y data are not bounded by zero). Type "direct" provides a direct estimate of the x value for a given y. Note that for the current version, ECx for an NECHormesis model is estimated at a percent decline from the control |
a list containing:
"post_vals1" the extracted posterior sample for x
"post_vals2" the extracted posterior sample for y
"diff_posterior" the full differenced posterior sample
"Difference" median, lower and upper 95 percent credible bounds of the differenced posterior
"Prob_diff" the probability that x is great than y
"plot1" a ggplot2 plot of the input posteriors
"plot2" a ggplot2 plot of the difference of the input posteriors (x-y)
"df3.s" the internal df3.s object
"df4.s" the internal df4.s object
Probability (
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.