Questions tagged [ecdf]

Empirical Cumulative Distribution Function in statistics

For definition please see its Wikipedia page.

In software, a built-in function ecdf takes a vector of samples and generates its ECDF. It is also easy to produce it ourselves, as given in this example: How to derive an ecdf function?

162 questions
2
votes
1 answer

ggplot2 ecdf behaviour seems odd

Consider the following series and cumulative plot: x=c(0,0,0,0.5,10,1500) qplot(x,geom='step',stat='ecdf') This produces a graph that starts left of zero. In other words, it looks as if x has negative values. At the right it continues to the right…
Henk
  • 3,634
  • 5
  • 28
  • 54
2
votes
1 answer

How to extract Ecdf value from the Ecdf() return?

The answer for This question here suggest a way by applying ecdf. However I am using Ecdf() from package Hmisc for it provides a convenient way to do a ccdf(Complementary Cumulative Distribution Function) plot. (by setting the what option to…
JerseyGood
  • 191
  • 4
  • 15
1
vote
1 answer

Label ECDF plot points

I'm trying to label the points of an ECDF plot with another column from my data field. Currently I'm using this: untouched = read.table("results-untouched.tsv", sep="\t") plot.ecdf(untouched$V4, xlim=c(0.75,1.25), ylim=c(0,1), col='green',…
cdecker
  • 4,515
  • 8
  • 46
  • 75
1
vote
1 answer

How to measure the horizontal distances between two cdfs with uneven data point

I have dataset 261 data points, and another with 373 data points. Here is the data dataset_1 = data.frame(dataset_name = rep("dataset_1", 261), value = seq(40, 10000, length.out = 261)) dataset_2 = data.frame(dataset_name =…
mra343
  • 11
  • 1
1
vote
1 answer

R: My calculated cumulative sample distribution probabilities don't reach 1.0

I want to calculate the cumulative probabilities for my sample for each factor level and save them to a data frame. However, the calculated probabilites don't reach 1.0 and stop e.g. at 0.7 which cannot be true. Somehow it always reaches 1.0 only…
Joschi Nin
  • 37
  • 5
1
vote
1 answer

Can ecdfplot show the concentration of a variable? E.g. the top 10 items account for 20% of the total, etc

The issue I want to create a plot to show the concentration by a certain variable. Let's say I have a 1-dimensional array of prices. I want a plot that shows me that the first 10 most expensive items account for 10% of the total price, the first…
Pythonista anonymous
  • 8,140
  • 20
  • 70
  • 112
1
vote
1 answer

Make an ECDF plot of a vector in ggplot

I want to make an ECDF plot in GGplot2. This is a sample of my data (just a vector of numbers with no column name) c(`6` = 0.152116553279516, `14` = 0.20966399205409, `15` = 0.153878854517702, `33` = 0.182997937239927, `34` = 0.157352856182734,…
BHope
  • 135
  • 9
1
vote
1 answer

How can I get the intersection point of two crossing ecdfs in R?

I have two ecdf plots using below code: ecdf1 <- ecdf(data1) ecdf2 <- ecdf(data2) These plots are crossing each other. I need to take the crossing point (intersection point) coordinates. How should I do this in R?
Nmgh
  • 113
  • 7
1
vote
1 answer

Data.table in R: Fitting a function on a different subgroup than the function's application group

In a large data.table, I would like to compute the percentile of a numeric variable with respect to a date variable, and with respect to a subgroup of a group variable. Example: In the table below I compute each value's percentile with respect to…
Chris437
  • 69
  • 1
  • 7
1
vote
1 answer

R: Plot ecdf of one column on an axis of another column with ggplot

I'm sure this can be done by separately collecting all the data and then just using ggplot for the plotting, but I'd really prefer a simpler solution implementing ggplot, particulalry stat_ecdf() because of easier access to grouping variables,…
1
vote
1 answer

How do you get end-points on an ecdf curve using plotly in R?

I am trying to create a cumulative distribution function as a plotly object using ggplot2 and converting it using ggplotly, but the tails for 0 and 1 get lost in the conversion. How can I get the lines to extend to 0 and 1 using plotly in R? This is…
Chezaire
  • 9
  • 3
1
vote
1 answer

Pick values from a CDF curve

everyone, I have a generic values distribution. I post the graph. Is there a way to generate a CDF from these values? Using sns I can create a graph: My goal is to assign a value to the y-axis and take a value from the x-axis from the CDF. I'm…
1
vote
1 answer

make this ecdf plot using ggplot?

This is the my data data <- data.frame(x1 = c(344,347,351,351,355)) I need to plot the empirical cumulative distribution function based on the data above,and here is my…
Enzo Paolo
  • 13
  • 3
1
vote
2 answers

How to Calculate eCDF Mean in MatchIt() R

I've been exploring MatchIt() package in R, and wondering how to calculate eCDF Mean in this package. I have used data lalonde from this package, and running the matchit package library("MatchIt") data("lalonde") m.out1 <- matchit(treat ~ age + educ…
1
vote
2 answers

Is there a python implementation of multidimensional ECDFs?

Looking for a package that implements the multivariate version of statsmodels.distributions.ECDF If one doesn't exist I will implement it for inclusion in statsmodels (if accepted), but don't want to reinvent the wheel. I see this:…
user14904283