我正在尝试使用ggplot绘制反向ecdf(相当于Hmisc中Ecdf函数的“ 1-F”等值)。
数据如下:
dat = data.frame(ID = rep(c(1001:1015),each=3),
Month = rep(c("April", "July", "October")),
Value = runif(45,2.0,14.6))
我可以使用ggplot2绘制每个月的ecdf:
ggplot(dat, aes(Value, colour = Month)) + stat_ecdf()
但是,我需要绘制每个月的反向ecdf。我尝试了几种方法,但无法解决。任何帮助表示赞赏!
最好,
D b
如果可以共享数据,更好,但是请尝试:
series <- rnorm(1000, 200, 50)
n<-ceiling(max(series))
qplot(1:n,1-(ecdf(series)(1:n)))+geom_step()
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句