Compute the Value of Empirical Cumulative Distribution Function in R Programming – ecdf() Function
Last Updated :
25 Jun, 2020
ecdf()
function in R Language is used to compute and plot the value of Empirical Cumulative Distribution Function of a numeric vector.
Syntax: ecdf(x)
Parameters:
x: Numeric Vector
Example 1:
x < - seq( 1 , 50 , by = 2 )
y < - ecdf(x)
y
|
Output:
Empirical CDF
Call: ecdf(x)
x[1:25] = 1, 3, 5, ..., 47, 49
Example 2:
x < - rnorm( 30 )
y < - ecdf(x)
plot(y)
|
Output:
Share your thoughts in the comments
Please Login to comment...