在 R 中绘制数据集的 CDF?
我不太确定 CDF(累积分布函数)和 ECDF(经验累积分布函数)之间的区别,但我通常使用 CDF 图来观察我的数据。
我最近一直在使用 R,并且拼命地想找出如何绘制我的数据的 CDF 和 CCDF(互补 CDF)。我所能找到的只是 R 有 ecdf 但我不确定这是否是我正在寻找的。绘制 ECDF 非常简单:
plot.ecdf(data)
有谁知道如何使用 R 绘制数据集的 CDF 和 CCDF?
I am not really sure about the difference between CDF (Cumulative Distribution Function) and ECDF (Empirical Cumulative Distribution Function) but I usually utilize a CDF plot to make observations about my data.
I have been using R recently and am desperately trying to find out how to plot a CDF and CCDF (Complementary CDF) of my data. All I could find was that R has ecdf but am not really sure if this is what I am looking for. Plotting an ECDF is as simple as:
plot.ecdf(data)
Does anyone know how to plot a CDF and CCDF of a dataset using R?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当您知道或假设分布时,CDF 通常需要封闭形式。另一方面,ECDF 是“经验性的”,因为它来自您的数据。我刚刚回答了有关使用
ecdf()
和 Hmisc 的Ecdf()
在这里 前几天。更一般地说,您可以使用术语在此处进行搜索,例如
在搜索框中查找 R 标签内的“ecdf”。在 rseek.org 上,几乎没有出现“ccdf”的情况。这可能与减去 ECDF 相同吗?如果是这样,Hmisc 中的
Ecdf()
就可以做到。我希望这会有所帮助,如果没有,请重新表述您的问题,因为尚不清楚您到底在寻找什么。
ecdf()
和Ecdf()
都非常有功能,因此请务必阅读它们的帮助页面。A CDF commonly requires closed form when you know or assume a distribution. An ECDF, on the other hand, is 'empiricial' as it comes from your data. I just answered a question about using
ecdf()
and Hmisc'sEcdf()
here the other day.More generally, you can search here using terms such as
in the search box to look for 'ecdf' within the R tag. At rseek.org, little comes up for 'ccdf'. Is that maybe just the same as one minus the ECDF? If so,
Ecdf()
in Hmisc can do it.I hope this helps, if not please re-phrase your question as it is not quite clear exactly what you are looking for. Both
ecdf()
andEcdf()
are pretty featureful so make sure to read their help pages.