Navigation
Synopsis Cumulative percentage of values less than or equal to a given value.
Function
  1. num cumPct(list[value] values, num n)
  2. num cumPct(list[value] values, str s)
Usage import analysis::statistics::Frequency;
Description Returns the cumulative percentage of values less than or equal to v (as a proportion between 0 and 1).
rascal>import analysis::statistics::Frequency;
ok
rascal>D = [1, 2, 1, 1, 3, 5];
list[int]: [1,2,1,1,3,5]
rascal>cumPct(D, 1);
num: 0.5
rascal>cumPct(D, 2);
num: 0.6666666666666666
rascal>cumPct(D, 10);
num: 1.0
Is this page unclear, or have you spotted an error? Please add a comment below and help us to improve it. For all other questions and remarks, visit ask.rascal-mpl.org.