Learn R Programming

psycho (version 0.4.91)

create_intervals: Overlap of Two Empirical Distributions.

Description

A method to calculate the overlap coefficient of two kernel density estimates (a measure of similarity between two samples).

Usage

create_intervals(x, n = NULL, length = NULL, equal_range = TRUE,
  labels = NULL, dig.lab = 3)

Arguments

x

A vector of numerics.

n

Number of intervals to create, OR

length

Length of each interval.

equal_range

Makes n groups with with equal range (TRUE) or (approximately) equal numbers of observations (FALSE).

labels

Can be a custom list, "NULL", "FALSE" or "median".

dig.lab

Integer which is used when labels are not given. It determines the number of digits used in formatting the break numbers.

Examples

Run this code
# NOT RUN {
library(psycho)

x <- rnorm(100, 0, 1)

create_intervals(x, n = 4)
create_intervals(x, n = 4, equal_range = FALSE)
create_intervals(x, length = 1)

create_intervals(x, n = 4, labels = "median")
create_intervals(x, n = 4, labels = FALSE)
# }

Run the code above in your browser using DataLab