Skip to contents

get_medians() generates median estimates for array of samples loaded from load_samples().

get_credible_interval() generates the credible interval of each estimate using samples loaded from load_samples().

get_relative_precision() generates the relative precision of each estimate using samples loaded from load_samples(). The relative precision for an estimate is defined as the ratio of the estimate's median divided by the width of its credible interval.

Usage

get_medians(sample)

get_credible_interval(sample, perc_ci = 0.95)

get_relative_precision(medians, ci)

Arguments

sample

array of samples generated by load_samples.

perc_ci

Number from 0 to 1. Determines width of credible interval.

medians

Array of medians generated from samples.

ci

Credible interval generated by get_credible_interval().

Value

An array of estimates/credible intervals/relative precisions.

Examples

minmedians <- get_medians(minsample)
minci <- get_credible_interval(minsample)
# Reducing perc_ci narrows the credible interval
minci_75 <- get_credible_interval(minsample, perc_ci = 0.75)
# low relative precision due to small data size
minrp <- get_relative_precision(minmedians, minci)
# reducing CI increases relative precision
minrp_75 <- get_relative_precision(minmedians, minci_75)
# find estimates with low relative precision
low_rp <- minrp_75 < 1