Proc code - Solutions - STATISTICS
|
|
Statistics component.
This is a component (STATX service) that allows you
some statistics operations.
The operations in the statx
service are:
DATA COLLECTION OPERATIONS
-
AddItem(item) : adds the item to the sample
set. $status returns the item count
-
AddList(list) : adds a list of sample to set
.$status returns the item count
MESURES OF CENTRAL TENDENCY OPERATIONS
-
Average(value): returns in value the Arithmetic
mean of all the items.
-
HAverage(value): returns in value the Harmonic
mean of all the items.
-
Median(value): returns the median (central
value) of the set (see performace issue)
-
Mode(value,freq): returns the mode (most repeated
value) and its frequency (see performace issue)
MESURES OF VARIABILITY OPERATIONS
-
Range(value): returns in value the difference
between the maxim and minimum values
-
Max(value): returns in value the maxim value
of the sample set
-
Min(value): returns in value the minimum value
of the sample set
-
Variance(value): returns in value the sample
variance (see performace issue)
-
PVariance(value): returns in value the population
variance (see performace issue)
-
StDeviation(value): returns in value the sample
standard deviation (see performace issue)
-
PstDeviation(value): returns in value the
standard deviation for the population (see performace issue)
MISCELANEOUS OPERATIONS
-
Count(value): returns in value the number
of samples
-
Sum(value): returns in value the sum of samples
-
Sum2(value): returns in value the sum of the
sample^2
-
GetList(list): returns the list of items
-
GetSortedList(list): returns the sorted list
of items
-
SaveDisable: Disable saving item list (see
performace issue)
-
ChangeSortAlg({"Q"|"B"}). Set the Quicksort
or BubbleSort as sorting algorithm (Q is the default) (see
performace issue)
HTML OPERATIONS
-
HTMLTable(poperties,table): returns a string
with the HTML code of a table for representing a bar graph of sample using
the specified properties.
The properties
parameter is a list where you can specify:
ORDER |
Y|N If you want order by
value or not the list (default Y) |
HEADER |
The text of the table header |
HCOLOR |
The background colour of
the table header (default #FFFFCC) |
IMAGE |
The 1x1 pixel image to show
as bar (default dot.gif included in this sample) |
CCOLOR |
The background colour of
the columns (default #FFFFFF) |
HEIGHT |
The height of the table
(default is the maxim value of the samples) |
WIDTH |
The table width (default
is number of sample * 12) |
VALUE |
Y|N If you want include
the value of every column (default is N) |
FOOT |
Y|N If you want include
the sample position as table foot (default is Y) |
FCOLOR |
The background colour of
the foot columns (default is #FFFFFF) |
NOTE
$status contains >= 0 if all is right and
<0 if there occurs an error (for instance there are no samples).
PERFORMANCE ISSUE.
If you don’t need calculating
the median, mode, arithmetic average you can use the SaveDisable
operation in order to have a better performance.
Depending of the characteristics
of your data and system you can use the ChangeSortAlg
operation to change form QuickSort (recursive) to BubbleSort (non-recursive)
algorithm.
The statx.zip file is composed
by:
-
The STATX service
(in the statx.trx)
-
The TESTSTATX form
to test the STATX service (in the statx.zip)
-
dot.gif is a image used as default for HTML table creation
operation.
Copyright © 1999-1999 $UUU All rights reserved.
Disclaimer. |
Site Comments.