fecr_probs {eggCounts}R Documentation

Compute probability of the reduction parameter relative to a given threshold

Description

Computes probability of the reduction parameter's marginal posterior density relative to a threshold.

Usage

fecr_probs(stanFit, threshold = 0.95, lessthan = TRUE, 
           plot = TRUE, xlab, ylab, main, verbose = TRUE, ...)

Arguments

stanFit

a stanfit object from the output of fecr_stan().

threshold

numeric. The default threshold is 0.95 (95%).

lessthan

logical. If TRUE, the probability less than the threshold is computed. Otherwise greater or equal to the threshold is computed. Default is TRUE.

plot

logical. If TRUE, the posterior density of the reduction is plotted with region less than the threshold shaded.

xlab, ylab, main

strings. Arguments for plotting. Only used if plot = TRUE.

verbose

logical. If TRUE, a statement with computed probability is printed.

...

additional plotting arguments

Value

Returns a numeric value indicating the probability in percentage.

Author(s)

Craig Wang

Examples


## load sample data
data(epgs)

## apply individual efficacy model to the data vectors
model <- fecr_stan(epgs$before, epgs$after, rawCounts = FALSE, preCF = 10, 
                   paired = TRUE, indEfficacy = TRUE)
fecr_probs(model$stan.samples)

[Package eggCounts version 2.4 Index]