![]() |
#2
风吹过b2018-09-14 10:45
|
在excel里,有这两个系数的函数: 峰度:KURT() 偏度:SKEW()
求平均值、最大值、最小值、标准差 的语句我已经写出来了,如下:

Dim a As Single
For i = 0 To List1.ListCount - 1
a = a + List1.List(i)
Next i
Text1.Text = Format(a / List1.ListCount, "0.0000000")
Dim min As Single
Dim max As Single
min = List1.List(0)
For i = 0 To List1.ListCount - 1
If min > List1.List(i) Then min = List1.List(i)
Next
Text2.Text = Format(min, "0.0000000")
max = List1.List(0)
For i = 0 To List1.ListCount - 1
If max < List1.List(i) Then max = List1.List(i)
Next
Text3.Text = Format(max, "0.0000000")
For i = 0 To List1.ListCount - 1
List2.AddItem Format((List1.List(i) - Val(Text1.Text)) ^ 2, "0.0000000")
Next i
Dim b As Single
For i = 0 To List2.ListCount - 1
b = b + List2.List(i)
Next i
Text4.Text = Format(Sqr(Format(b / List2.ListCount, "0.0000000")), "0.0000000")
For i = 0 To List1.ListCount - 1
a = a + List1.List(i)
Next i
Text1.Text = Format(a / List1.ListCount, "0.0000000")
Dim min As Single
Dim max As Single
min = List1.List(0)
For i = 0 To List1.ListCount - 1
If min > List1.List(i) Then min = List1.List(i)
Next
Text2.Text = Format(min, "0.0000000")
max = List1.List(0)
For i = 0 To List1.ListCount - 1
If max < List1.List(i) Then max = List1.List(i)
Next
Text3.Text = Format(max, "0.0000000")
For i = 0 To List1.ListCount - 1
List2.AddItem Format((List1.List(i) - Val(Text1.Text)) ^ 2, "0.0000000")
Next i
Dim b As Single
For i = 0 To List2.ListCount - 1
b = b + List2.List(i)
Next i
Text4.Text = Format(Sqr(Format(b / List2.ListCount, "0.0000000")), "0.0000000")