cdf: Function to compute the cumulative distribution of a variable

View source: R/cdf.r

cdfR Documentation

Function to compute the cumulative distribution of a variable

Description

Builds the cumulative distribution of a vector, using a step% of the data as fixed-intervals.

Usage

cdf(y = y, step = 0.05)

Arguments

y

a vector of a random variable

step

a numeric proportion of the data used as increment interval for building the cdf of the random variable. The default value for 'step' is 0.05, representing a 5%.

Details

By default the cumulative distribution is build using 5% of the data as intervals, that is to say, from 0.05 (i.e., 5%) to 0.95 (i.e., 95%).

Value

returns a dataframe having two columns: the first contains the random variable values and the second the cumulative distribution for the variable.

Author(s)

Christian Salas-Eljatib

References

Salas-Eljatib, C. 2021. Análisis de datos con el programa estadístico R: una introducción aplicada. Ediciones Universidad Mayor, Santiago, Chile. 170 p. https://eljatib.com/rlibro

Examples

y.var <- rnorm(10)
cdf(y.var)
cdf(y.var, step=0.1)

datana documentation built on June 13, 2025, 1:11 a.m.