calcProb | R Documentation |
This function estimates the probability that a vector of posterior draws,
represented by the parameter eta
, falls within a specified range.
It provides flexibility to use either prior distributions or posterior draws,
and to specify one-sided or two-sided probability calculations.
calcProb(x, a = NULL, b = NULL, prior = FALSE, group_name = "group average")
x |
A numeric vector containing either posterior draws (default)
or prior samples of the treatment effect parameter ( |
a |
(Optional) The lower bound of the range (as a proportion, not percentage). |
b |
(Optional) The upper bound of the range (as a proportion, not percentage). |
prior |
A logical value indicating whether to use prior samples ( |
group_name |
A string describing the group for which the probability is being calculated (default: "group average"). |
This function checks the following cases:
If both a
and b
are NULL
, it returns an empty string.
If b
is less than or equal to a
, it throws an error.
The calculated probability and range are presented in a human-readable string
using the glue
package for formatting.
A formatted string stating the calculated probability and the specified range. The probability is the proportion of samples (either prior or posterior) that fall within the defined range.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.