plotting_numerical_buckets: plotting_numerical_buckets

Description Usage Arguments Value Examples

View source: R/plotting_numerical_buckets.R

Description

This function takes a numeric vector var_to_band and groups it into buckets which are useful for plotting. These groups have approximately equal weight Outliers are excluded/included using the include_outliers option. This function is built on prep_num_bin

Usage

1
2
3
4
5
6
plotting_numerical_buckets(
  var_to_band,
  n_bins = 25,
  weight = NULL,
  include_outliers = FALSE
)

Arguments

var_to_band

Vector[numeric] - vector of values to be binned

n_bins

numeric - Number of bins to split exposure into

weight

numeric - vector weight for observations

include_outliers

logical - should outliers be trimmed

Value

data.frame with columns bin [numeric]: numeric label of bin labels [character]: string output from prep_num_bin if called lower [numeric]: Min bound of the bin upper [numeric]: Max bound of the bin center [numeric] : Center of the bin - (upper + lower) / 2 width [numeric] : Width of the bin - (upper - lower)

Examples

1
plotting_numerical_buckets(var_to_band=runif(100), n_bins=10)

gloverd2/admr documentation built on Dec. 2, 2020, 11:16 p.m.