Dew Stats Master .NET
MeanT Routine
Summary
Trimmed mean.

Unit
Statistics

Declaration
Function MeanT(Data: TVec; alpha: TSample = 0.05): TSample;
 Parameter  Description 
Data Data. An exception is raised if Data vector is complex. 
Alpha Defines the percent of value excluded from mean calculation. If alpha parameter is omitted, the default value 0.05 is used (meaning highest 2.5% and lowest 2.5% of data will be excluded). Alpha paramater must lie on the interval [0,1) otherwise an exception is raised. 
Result
the mean of all Data vector elements, excluding highest and lowest 100*alpha/2 percents of value.
Categories
Descriptive statistics routines
 See Also 
MeanH 
MeanG 

Example 1

Calculate mean for given values, excluding top and bottom 7.5% i.e 15%.

Uses MtxExpr, Statistics, Math387; procedure Example; var a: Vector; MT : TSample; begin a.SetIt(false,[1, 2, 97, 98, 99, 100, 190]); MT := MeanT(a,0.15); // MT = 79.2 end;
#include "MtxVecCpp.h" #include "Statistics.hpp" void __fastcall Example(); { Vector a; a->SetIt(false, OPENARRAY(double,(2,3,5,4))); double MT = MeanT(a); // MT = 79.2 }
using Dew.Math; using Dew.Stats; using Dew.Stats.Units; namespace Dew.Examples { private void Example() { Vector a = new Vector(0), a.SetIt(false, new double[] {1, 2, 97, 98, 99, 100, 190}); double MT = Statistics.MeanT(a); // MT = 79.2 } }


Copyright 2008 Dew Research
http://www.dewresearch.com