Field-Map Scripting

4.1.3.2.8 MeanError

MeanError function


Prototype:

function MeanError (const StandardDeviation :extended; const NSample :integer) : extended;

Description:

Calculates maximal accepted error of estimate of variable with specified number of observations and standard deviation

Syntax:

variable := MeanError (StandardDeviation, NSample);


Part

Description


variable

A variable declared as type of extended


StandardDeviation

Sample standard deviation


NSample

Number of observations in sample







Return value:

Mean error

Note:

Calculations are based on the presumption of unknown population standard deviation, i.e. quantiles of Students distribution are used.

Definition:

Quantile of Students distribution (alpha 5 %) * StandardError



Example:


Task:

Calculate mean error of DBH.


Data stored in the database.



Script:

var

 tab : TTableWrapper;

 attributeName: string;

 nullAsZero: boolean;

 x,e: extended;


begin

 tab:= Trees.table;

 attributeName:= 'DBH_mm';

 nullAsZero:= false;                    // dont want calculate with a null value


 x:= StandardDeviation(tab, attributeName, nullAsZero);


 e:= MeanError(x, Trees.RecordCount);             // Trees.RecordCount returns number of records

//e:= MeanError(StandardDeviation(tab, attributeName, nullAsZero), Trees.RecordCount);     //this is same as previous line


 ShowMessage(FloatToStr(e));

end.


Output in Field-Map Data Collector:

mean error of DBH


See also:

Mean; QuadraticMean; WeightedMean; Median; SampleVariance; StandardDeviation; StandardError; MeanError;VarianceOfMean; WeightedSampleVariance; WeightedStandardDeviation; WeightedVarianceOfMean;ConfidenceIntervalOfMean; VarianceOfTotal; ConfidenceIntervalOfTotal; StratifiedConfidenceIntervalOfTotal; SampleSize;ShowDistributionChart; ParameterizeRegressionModel; CalculateModelValue


Example