Darwin Help

Back to Index

Stat

Class Stat - Basic Univariate Statistics Package

Calling Sequence  Stat()
Stat(Description)
Return Type  Stat
Selectors
NameTypeDescription

Number integernumber of observations recorded
Mean numericmean of the sample
Average numericmean of the sample (same as Mean)
Variance numericvariance of the sample
VarVariance numericvariance of the observed variance
Skewness numericcoefficient of skewness (sidewise leaning)
Excess numericexcess (flatness, or kurtosis)
Min numericthe minimum of the sample
Minimum numericthe minimum of the sample
Max numericthe maximum of the sample
Maximum numericthe maximum of the sample
ShortForm stringDescription: MeanVar
StdErr numeric95% conf. interval of mean
CV numericcoefficient of variance (std. dev/mean)
Description stringuser-defined description
MeanVar stringform: xxx+-xx (mean and 95% conf. interval)
VarVar stringform: xxx+-xx (variance and 95% conf. interval)
Methods HTMLC, plus, print, printf, printpm, Rand, rawprint, select, string, type, union
Synopsis Stat defines a new data structure to gather univariate statistical information. Methods exist for printing, adding and creating a union of two Stat data structures. The extraction of useful statistical data from the information collected in a Stat data structure is performed with the provided selectors.
References Handbook of Mathematical Functions, M. Abramowitz and I. Stegun, Ch 26.1
Examples
> BooHoo := Stat('Stock Market Losses');
BooHoo := Stat(0,1.7797162035136925e+308,-1.7797162035136925e+308,0,0,0,0,0,Stoc
k Market Losses)
> BooHoo2 := Stat('More Losses');
BooHoo2 := Stat(0,1.7797162035136925e+308,-1.7797162035136925e+308,0,0,0,0,0,More Losses)
> UpdateStat( BooHoo, 10000 ):

> UpdateStat( BooHoo, 30000 ):

> UpdateStat( BooHoo2, 50000 ):

> UpdateStat( BooHoo2, 60000 ):

> BooHoo[Mean];
20000
> BooHoo[Number];
2
> Akk := BooHoo union BooHoo2;
Akk := Stat(4,10000,60000,30000,1700000000,27000000000000,1130000000000000000,30
000,Stock Market Losses and More Losses)
> print(BooHoo);
 Stock Market Losses: number of sample points=2
 mean = 20000 +- 19600
 variance = 200000000 +- 999999
 skewness=999999,   excess=999999
 minimum=10000,     maximum=30000
See also CollectStat,   Counter,   ExpFit,   ExpFit2,   LinearRegression,   OutsideBounds,   UpdateStat