summarize_metrics {bandit}R Documentation

summarize_metrics

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)

Value

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)

Author(s)

Thomas Lotze <thomaslotze@thomaslotze.com>

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]])

[Package bandit version 0.5.1 Index]