get_prop: Get the Proportion of Each Predictor Level Having Each...

Description Usage Arguments Value Author(s) Examples

Description

Get the proportion of each predictor level having each outcome level as well as the lower and higher ends of the 95% confidence interval of the proportion.

Usage

1
get_prop(data, predictor, outcome)

Arguments

data

The dataframe containing the predictor and outcome variables.

predictor

The predictor variable name.

outcome

The outcome variable name.

Value

Returns a dataframe that includes the following columns:

predictor

The predictor variable levels.

outcome

The outcome variable levels.

n

The number of observations for each combination of levels of the predictor and the outcome.

sum_n

The total number of observations for each level of the predictor.

prop

The proportion of each predictor level associated with each outcome level.

low_95ci

The lower end of the 95% confidence interval of the proportion.

high_95ci

The upper end of the 95% confidence interval of the proportion.

Author(s)

Andrew Kostandy (andrew.kostandy@gmail.com)

Examples

1
get_prop(diamonds, clarity, cut)

AndrewKostandy/MLtoolkit documentation built on May 7, 2019, 9:51 p.m.