Learn R Programming

tidysynthesis (version 0.1.2)

ks_distance: Kolmogorov-Smirnov distance

Description

Kolmogorov-Smirnov distance

Usage

ks_distance(data, ...)

# S3 method for data.frame ks_distance(data, truth, estimate, na_rm = TRUE, case_weights = NULL, ...)

ks_distance_vec(truth, estimate, na_rm = TRUE, case_weights = NULL, ...)

Value

For ks_distance_vec(), a single numeric value (or NA).

A single numeric value (or NA).

A single numeric value (or NA).

Arguments

data

A data.frame containing the columns specified by the truth and estimate arguments.

...

Not currently used.

truth

The column identifier for the true results (that is numeric). This should be an unquoted column name although this argument is passed by expression and supports quasiquotation (you can unquote column names). For _vec() functions, a numeric vector.

estimate

The column identifier for the predicted results (that is also numeric). As with truth this can be specified different ways but the primary method is to use an unquoted variable name. For _vec() functions, a numeric vector.

na_rm

A logical value indicating whether NA values should be stripped before the computation proceeds.

case_weights

This is a placeholder for now and will be added when case_weights are added to tidysynthesis.

Examples

Run this code

ks1 <- data.frame(x = 1:100, y = 101:200)

ks_distance(data = ks1, truth = x, estimate = y)


ks1 <- data.frame(x = 1:100, y = 101:200)

ks_distance(data = ks1, truth = x, estimate = y)


ks1 <- data.frame(x = 1:100, y = 101:200)

ks_distance_vec(truth = ks1$x, estimate = ks1$y)

Run the code above in your browser using DataLab