Skip to Content

summarize_metrics {bandit}

summarize_metrics
Package: 
bandit
Version: 
0.4.2

Description

A convenience function to perform overall metric analysis: mean, median, CI.

Usage

summarize_metrics(v, successes=NULL)

Arguments

v
a vector of values to be analyzed (for nonbinary data), or number of trials (for binary data)
successes
number of successes (for binary data)

Values

a list with the following items:

mean
mean
median
median
lower
0.95 confidence interval on the mean
upper
0.95 confidence interval on the mean
num_obs
number of observations of this metric
total
the sum of all values of this metric (mean*num_obs)

Examples

metric_list = list(rbinom(n=100,size=1,prob=0.5),
                   rbinom(n=100,size=1,prob=0.7),
                   rpois(n=100, lambda=5))
summarize_metrics(length(metric_list[[1]]), sum(metric_list[[1]]))
summarize_metrics(length(metric_list[[2]]), sum(metric_list[[2]]))
summarize_metrics(metric_list[[3]])

Author(s)

Thomas Lotze

Documentation reproduced from package bandit, version 0.4.2. License: GPL-3