Learn R Programming

SimMultiCorrData (version 0.2.2)

sim_cdf_prob: Calculate Simulated (Empirical) Cumulative Probability

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

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

Run this code
# NOT RUN {
# Beta(a = 4, b = 2) Distribution:
x <- rbeta(10000, 4, 2)
sim_cdf_prob(x, delta = 0.5)

# }

Run the code above in your browser using DataLab