You are here: Symbol Reference > Statistics Namespace > Functions > Statistics.Mode Function
Stats Master VCL
ContentsIndex
Example

Calculate the mode of sample data [1,5,2,11,5,3].

Uses MtxExpr, Statistics, Math387;
procedure Example;
var a: Vector;
  Md : double;
begin
  a.SetIt(false,[1,5,2,11,5,3]);
  Md := Mode(a); // Md = 5
end;
 #include "MtxExpr.hpp"
#include "Statistics.hpp"
void __fastcall Example()
{
  sVector a;
  a.SetIt(false, OPENARRAY(double,(1,5,2,11,5,3)));
  double Md = Mode(a); // Md = 5
}
Copyright (c) 1999-2025 by Dew Research. All rights reserved.