sim_cdf_prob: Calculate Simulated (Empirical) Cumulative Probability

Description Usage Arguments Value See Also Examples

View source: R/sim_cdf_prob.R

Description

This function calculates a cumulative probability using simulated data and Martin Maechler's ecdf function. Fn is a step function with jumps i/n at observation values, where i is the number of tied observations at that value. Missing values are ignored. For observations y = (y1, y2, ..., yn), Fn is the fraction of observations less or equal to t, i.e., Fn(t) = sum[yi <= t]/n. This works for continuous, ordinal, or count variables.

Usage

1
sim_cdf_prob(sim_y, delta = 0.5)

Arguments

sim_y

a vector of simulated data

delta

the value y at which to evaluate the cumulative probability

Value

A list with components:

cumulative_prob the empirical cumulative probability up to delta

Fn the empirical distribution function

See Also

ecdf, plot_sim_cdf

Examples

1
2
3
# Beta(a = 4, b = 2) Distribution:
x <- rbeta(10000, 4, 2)
sim_cdf_prob(x, delta = 0.5)

SimMultiCorrData documentation built on May 2, 2019, 9:50 a.m.