![](/img/trans.png)
[英]I want to create the empirical cumulative distribution function for two samples and put the plots in the same plot [R]
[英]plot of an empirical cumulative distribution function (was Percentile plot)
如何在 R 中生成如下所示的 plot。
它顯示了給定響應時間 (y) 的事務百分比 (x),請參閱下面我自己的 go 的答案。
我認為您想要經驗累積分布 function 的 plot。
因此,請查看ecdf()
的文檔以及 CRAN package Hmisc中更具特色的Ecdf()
文檔。
Hmisc Ecdf 示例: ExecTm
執行時間數組, HttpProvCall
調用下游系統所花費的時間數組,我們將我們與下游系統花費的時間與百分位數進行比較
> library(Hmisc)
> x <- c(ExecTm,ExecTm-HttpProvCall)
> g <- c(rep('ExecTm',length(ExecTm)),rep('ExecTm-HttpProvCall',length(ExecTm)))
> Ecdf(x, group=g, xlab='Test Results',
+ label.curves=list(keys=1:2),q=c(.90,.95,.98))
y <- c(rnorm(8000, 300, 10), rnorm(400, 500, 300) )
t2 <- quantile(y, probs = seq(0, 99.99, by=.1)/100)
情節(t2,xlab =“promille”,ylab =“時間(毫秒)”,pch = 20)
給我:
使用我的數據集
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.