在R中绘制数据集的CDF [英] Plotting CDF of a dataset in R?

查看:1563
本文介绍了在R中绘制数据集的CDF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不太清楚CDF(累积分布函数)和ECDF(经验累积分布函数)之间的区别,但是我通常使用CDF图来对我的数据进行观察。



我最近一直在使用R,并拼命地试图找出如何绘制我的数据的CDF和CCDF(补充CDF)。我可以找到的是,R有ecdf,但我不确定这是否正在寻找。绘制ECDF是简单的:

  plot.ecdf(data)
/ pre>

有谁知道如何使用R?绘制数据集的CDF和CCDF?

解决方案

当您知道或假设发行时,CDF通常需要封闭表单。另一方面,ECDF是来自您的数据的经验性。我刚刚回答了一个关于使用 ecdf() Hmisc Ecdf()这里另一天



更一般地,您可以使用诸如

 搜索框中的[r] ecdf 

在R标签中查找ecdf。在 rseek.org 上,ccdf很少出现。这可能与一个减去ECDF相同吗?如果是这样,Hmisc中的 Ecdf()可以做到。



我希望这有助于,说出你的问题,因为它不是很清楚你正在寻找什么。 ecdf() Ecdf()非常有用,所以请务必阅读他们的帮助页面。


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?

解决方案

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's Ecdf() here the other day.

More generally, you can search here using terms such as

 [r] ecdf

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() and Ecdf() are pretty featureful so make sure to read their help pages.

这篇关于在R中绘制数据集的CDF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆