计算平均值和标准差

编程入门 行业动态 更新时间:2024-10-07 11:31:05
本文介绍了计算平均值和标准差的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在datagridview中有数据,每月有销售数字。 我如何计算平均值和std dev 让我们说数据如下 item#| MTH1 | Mth2 | Mth3 | Mth4 001 | 500 | 0 | 450 | 300 002 | 0 | 150 | 150 | 500 目前我正在添加每个项目的月数并除以零之外的月数即 001 =(500+ 450 + 300)/ 3 = 416.6667 002 =(150 + 150 + 500)/ 3 = 266.6667 这是正确的吗? Std Dev计算的任何线索? 提前感谢 Anoop

Hi, I have data in a datagridview with sales figures per month. how would i calculate the average and std dev lets say data as below item # | Mth1| Mth2| Mth3|Mth4 001 | 500 | 0 | 450 | 300 002 | 0 | 150 | 150 | 500 currently i am adding the months figures per item and dividing by the number of months excluding the zero i.e. 001 = (500+450+300)/3 = 416.6667 002 = (150+150+500)/3 = 266.6667 is this correct? any clue on the Std Dev calculations? thanks in advance Anoop

推荐答案

这是数学,而不是编程: www.google/search?q=Std+Dev+calculations [ ^ ]。 This is mathematics, not programming: www.google/search?q=Std+Dev+calculations[^].

您的平均计算可能不正确。零值通常也计算在内。所以你必须除以4而不是三。 只有当你想要平均只有那些已售出商品的月份时才这是正确的(假设这个是每月表格中的某种商品。) 您已经获得了有关标准偏差的提示。 对于这样的计算,你可以使用一个循环来总结值和方块。然后可以使用平方和来计算偏差。 Your average calculation is probably not correct. The zero values are usually counted too. So you must divide by four and not by three. It would be only correct if you want the average only for those months where items has been sold (assuming that this is some kind of sold items per months table). You already got tips about the standard deviation. For such calculations you can use a loop summing up the values and the squares. The sum of the squares can then be used to calculate the deviation.

平均值是正确的:值的总和/值的数量。 标准偏差更复杂: en.wikipedia/wiki/Standard_deviation [ ^ ]看一下示例,这很明显。 Average is correct: Sum of values / number of values. Std Dev is more complex: en.wikipedia/wiki/Standard_deviation[^] look at the examples, and it's pretty obvious.

更多推荐

计算平均值和标准差

本文发布于:2023-07-09 10:32:16,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1085634.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:平均值   标准差

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!