diff --git a/lib/growth/calc/centile.ex b/lib/growth/calc/centile.ex index 3acd78c..f2a3c9d 100644 --- a/lib/growth/calc/centile.ex +++ b/lib/growth/calc/centile.ex @@ -23,11 +23,13 @@ defmodule Growth.Calc.Centile do alias Growth.Calc.ZScore - @spec compute(number(), number(), number(), number()) :: number() + @spec compute(number(), number(), number(), number()) :: number() | :na @doc """ Compute the centile for a given measurement (`y`) and the Box-Cox values: power (`l`), median (`m`), and coefficient of variation (`s`). + Returns the centile based on the z-score when -3 <= z-score <= 3; otherwise, returns `:na.` + ## Examples: iex> Growth.Calc.Centile.compute(19, -1.6318, 16.049, 0.10038)