Solved – Quantiles for non-normal cdf

When I compute the five-number summary on my sample, I obtain quantiles that differ from the quantiles I got from the empirical cdf, since they are not normally distributed data.

Can you help me in the interpretation of this difference?

For instance, with a randomly-generated Poisson dataset x

x=rpois(50, 2) summary(x) Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 0.00    1.00    1.50    1.82    2.75    6.00  y=ecdf(x) summary(y) Empirical CDF:    7 unique values with summary Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 0.0     1.5     3.0     3.0     4.5     6.0 

What does it mean that the 3rd quantile of the sample is 2.75 while it is 4.5 for the ecdf?

This has nothing to do with being non-normal.

summary(x) is computing sample quantiles of your data, using type 7 quantiles (see help(quantile) in R for the various quantile types).

I'm guessing that you've used summary(y) to produce the second set of values. In that case, the results are probably not what you want as they are giving you quantiles of the data set {0,1,2,3,4,5,6}, the step points of the empirical cdf.

You can get the quantiles from the ecdf object using quantile(y) which should give you the same results as quantile(x).

Similar Posts:

Rate this post

Leave a Comment