|
From: | Mr. Brian B. McGuinness |
Subject: | Bug in WS 1 STAT |
Date: | Fri, 20 Dec 2019 18:33:15 +0000 |
Looking through the functions in workspace 1 STAT I noticed that stat∆skewness calls stat∆pearson with no argument (under line label "four"):
∇skewness←stat∆pearson vector;mm;md;sd
⍝ Function returns the Pearson coefficient of skewness
mn←stat∆mean vector←,vector
md←stat∆median vector
sd←stat∆sampleSD vector
skewness←(3×mn-md)÷sd
∇
∇ skew←type stat∆skewness vector;n;var;sq
⍝ Function returns a measure of skewness
⍎(0=⎕nc 'type')/'type←1'
type←4⌊type
n←stat∆count vector
var←vector - stat∆mean vector
skew←(n*.5)×(+/var*3)÷(+/var*2)*3÷2
→(one,two,three,four)[type]
one:
→end
two:
⎕es (n<3)/'At least three observations are required.'
skew←skew × ((n × ( n -1))*.5)÷n - 2
→end
three:
skew←skew×(1-1÷n)*3÷2
→end
four:
skew←stat∆pearson
→end
end:
∇
|
[Prev in Thread] | Current Thread | [Next in Thread] |