ecdf: Compute ECDF for a sample

make_ecdf_dfR Documentation

Compute ECDF for a sample

Description

Function for creating an empirical CDF from a numerical sample

Usage

make_ecdf_df(x, boundedness = c("none", "left", "right", "both"))

make_ecdf_matrix(m)

Arguments

x

numeric sample (vector)

boundedness

should the sample be bounded by the minimum("left"), maximum("right") or both values ("both"). Default is "none".

m

numeric matrix

Details

If boundedness is "none" the ties method in the rank() function is "average" (meaning that two equal samples can get the same probability). Otherwise the ties method is "first", meaning that all probabilities will be unique and the first sample will get the lower probability.

Value

data frame with 2 columns p - vector of empirical probabilities, q - vector of sorted original sample values make_ecdf_matrix() returns a matrix with added probability columns denoted with postfix "_p"

Examples

make_ecdf_df(runif(10))


dmi3kno/qpd documentation built on Sept. 29, 2024, 6:39 p.m.