programlibs/Statistics/demos/heights.xtl

Heights and weights of twelve people: a summary of each, how they relate, the line through them, and who is unusual. Run with "just demo Statistics heights".

source · imports sx: libs/Statistics/src/Statistics.xtl; s: std/Stats.xtl

height : Int

value · line 8
height ← 158 162 165 168 170 171 173 175 178 180 183 191      ⍝ cm

weight : Int

value · line 9
weight ← 52 58 61 60 66 70 68 72 75 80 79 95                  ⍝ kg

f : Float

value · line 14
f ← height ˢˣf̲it weight                ⍝ kg = intercept + slope * cm

z : Float

value · line 19
z ← ˢˣz̲scores weight

ᵘm̲eanOr0 : Num a => a -> Float

function · line 27
ᵘm̲eanOr0 ← { v → 0 = t̲ally v ? 0.0◆ ˢm̲ean v }