Skip to contents

Not exported. The following statistics are calculated based on a vector of ALE y values:

Usage

ale_stats(y, bin_n, y_vals = NULL, ale_y_norm_fun = NULL, x_type = "numeric")

Arguments

y

numeric. Vector of ALE y values.

bin_n

numeric. Vector of counts of rows in each ALE bin. Must be the same length as y.

y_vals

numeric. Entire vector of y values. Needed for normalization. If not provided, ale_y_norm_fun must be provided.

ale_y_norm_fun

function. Result of create_ale_y_norm_function(). If not provided, y_vals must be provided. ale_stats() could be faster if ale_y_norm_fun is provided, especially in bootstrap workflows that call the same function many, many times.

x_type

character(1). Datatype of the x variable on which the ALE y is based. Values are the result of var_type(). Used to determine how to correctly calculate ALE, so if the value is not the default "numeric", then it must be set correctly.

Value

Named numeric vector:

  • aled: ALE deviation (ALED)

  • aler_min: Minimum (lower value) of the ALE range (ALER)

  • aler_max: Maximum (upper value) of the ALE range (ALER)

  • naled: Normalized ALE deviation (ALED)

  • naler_min: Normalized minimum (lower value) of the ALE range (ALER)

  • naler_max: Normalized maximum (upper value) of the ALE range (ALER)

Details

  • ALE deviation (ALED)

  • ALE range (ALER): range from minimum value of any ALE y to the maximum value of any y. This is a very simple indication of the dispersion in ALE y values.

  • Normalized ALE deviation (NALED)

  • Normalized ALE range (NALER)

Note that if any ALE y values are missing, they will be deleted from the calculation (with their corresponding bin_n).