Dear List,

I have some discrete data and want to calculate the percentiles and the percentile ranks for each of the unique scores. I can calculate the percentiles with quantile().

I know that "ecdf" can be used to calculate the empirical cumulative distribution. However, I don't know how to exact the cumulative probabilities for each unique element. The requirement is similar to the "FREQUENCIES" in SPSS. Could someone help me in exacting the cumulative probabilities from the ecdf object? Thanks in advance!

# Generating artificial data
x <- round( rnorm(50, mean=50, sd=10) )
probs <- seq(0.1, 0.9, by=0.1)
# Calculating percentiles
x.percentiles <- quantile(x, probs)
# Calculating percentile ranks
x.ranks <- ecdf(x)

Best,
Mike

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to