使用 Microsoft Excel 绘制 CDF 图表
我不太确定是否可以在这里或在 SuperUser 上提出这个问题,
我想知道如何绘制 CDF 图表来自我的 Excel 数据。 我的数据是这样的(我的真实数据有22424条记录):
1 2.39E-05
1 2.39E-05
1 2.39E-05
2 4.77E-05
2 4.77E-05
2 4.77E-05
4 9.55E-05
4 9.55E-05
4 9.55E-05
4 9.55E-05
4 9.55E-05
4 9.55E-05
8 0.000190931
8 0.000190931
I'm not quite sure if I can ask this question here or on SuperUser,
I want to know how can I plot a CDF chart out of my excel data.
My data is something like this (my real data have 22424 records):
1 2.39E-05
1 2.39E-05
1 2.39E-05
2 4.77E-05
2 4.77E-05
2 4.77E-05
4 9.55E-05
4 9.55E-05
4 9.55E-05
4 9.55E-05
4 9.55E-05
4 9.55E-05
8 0.000190931
8 0.000190931
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这个答案是如何创建一个“经验分布函数”,这是很多人(包括我自己)在说 CDF 时真正想到的...... https://en.wikipedia.org/wiki/Empirical_distribution_function
假设样本数据的第二列从单元格 B1 开始,在单元格 C1 中键入:
然后按 Shift+Enter,将其作为数组公式输入。现在它在公式栏中看起来像这样:
向下复制单元格以覆盖 C1:C14。然后以B1:B14为X,C1:C14为Y绘制散点图。它将显示四个点。
This answer is how to create an 'empirical distribution function', which is what many people really have in mind (myself included) when they say CDF... https://en.wikipedia.org/wiki/Empirical_distribution_function
Assuming the second column of the sample data starts in cell B1, in cell C1, type:
then press Shift+Enter, to enter it as an array formula. It will now look like this in the formula bar:
Copy the cell down to cover C1:C14. Then make Scatter plot with B1:B14 as X, C1:C14 as Y. It will show four points.
您可以使用 NORMDIST 函数并将最终参数设置为 true:
例如,假设我有 20 个从 0.1 到 2.0 的数据点,增量为 0.1,即 0.1、0.2、0.3...2.0。
现在假设该数据集的平均值为 1.0,标准差为 0.2。
要获得 CDF 图,我可以对每个值使用以下公式:
从数据中删除重复条目和总和值相同,您可以使用以下代码。
ALT + F11
打开 VBEInsert >; Module
将模块放置在编辑器中RemoveDuplicates
中的任意位置,然后按F5
运行代码因此,您的独特的汇总结果将显示在工作簿的 Sheet2 中。
You can use the
NORMDIST
function and set the final parameter to true:As an example, suppose I have 20 data points from 0.1 to 2.0 in increments of 0.1 i.e. 0.1, 0.2, 0.3...2.0.
Now suppose that the mean of that dataset is 1.0 and the standard deviation is 0.2.
To get the CDF plot I can use the following formula for each of my values:
To remove duplicate entries from your data and sum values that are the same you can use the following code.
ALT + F11
to open VBEInsert > Module
to place a module in the editorRemoveDuplicates
and PressF5
to run the codeAs a result, your unique, summed results will appear in Sheet2 in your workbook.
让我们看看我是否理解你的问题。假设 Excel 2007 及更高版本。假设您的数据位于 A 列和 B 列中。
步骤 1
在单元格 C1 中使用此公式:
在单元格 D1 中使用此公式:
并将这两个公式复制到数据末尾。
第 2 步
选择四列。
在功能区数据中选择 -> 删除重复项
取消选中 B、C 和 D 列
第 3 步
选择 A 和 D 列。
在 Ribbon Insert 中选择 -> Scatter -> Line
这是您想要实现的目标吗?
哈!
Let's see if I understood your problem. Assuming Excel 2007 and up. Assuming your data is in columns A and B.
Step 1
Use this formula in cell C1:
And this formula in cell D1:
and copy both formulas down to the end of data.
Step 2
Select the four columns.
Select in Ribbon Data->Delete Duplicates
Uncheck Columns B,C and D
Step 3
Select Columns A and D.
Select in Ribbon Insert->Scatter->Line
Is this what you want to achieve?
HTH!