|
NAG[g01aac] NAG[nag_summary_stats_1var] - Mean, variance, skewness, kurtosis, etc., one variable, from raw data
|
|
Calling Sequence
g01aac(x, nvalid, xmean, xsd, xskew, xkurt, xmin, xmax, wsum, 'n'=n, 'wt'=wt, 'fail'=fail)
nag_summary_stats_1var(. . .)
Parameters
|
x - Vector(1..n, datatype=float[8]);
|
|
|
On entry: the sample observations, , for .
|
|
|
nvalid - assignable;
|
|
|
Note: On exit the variable nvalid will have a value of type integer.
|
|
On exit: the number of valid observations – see Section [Description] above.
|
|
|
xmean - assignable;
|
|
|
Note: On exit the variable xmean will have a value of type float.
|
|
On exit: the mean, .
|
|
|
xsd - assignable;
|
|
|
Note: On exit the variable xsd will have a value of type float.
|
|
On exit: the standard deviation, .
|
|
|
xskew - assignable;
|
|
|
Note: On exit the variable xskew will have a value of type float.
|
|
On exit: the coefficient of skewness, .
|
|
|
xkurt - assignable;
|
|
|
Note: On exit the variable xkurt will have a value of type float.
|
|
On exit: the coefficient of kurtosis, .
|
|
|
xmin - assignable;
|
|
|
Note: On exit the variable xmin will have a value of type float.
|
|
On exit: the smallest value in the sample.
|
|
|
xmax - assignable;
|
|
|
Note: On exit the variable xmax will have a value of type float.
|
|
On exit: the largest value in the sample.
|
|
|
wsum - assignable;
|
|
|
Note: On exit the variable wsum will have a value of type float.
|
|
On exit: the sum of the weights in the array wt, that is . This will be if weighted estimates are not used.
|
|
|
'n'=n - integer; (optional)
|
|
|
Default value: the first dimension of the arrays x, wt.
|
|
On entry: the number of observations, .
|
|
Constraint: . .
|
|
|
'wt'=wt - Vector(1..n, datatype=float[8]); (optional)
|
|
|
On entry: if weighted estimates are required, then wt must contain the weights , for . Otherwise, wt need not be defined and the corresponding argument must be set to the null pointer, ((double *)0).
|
|
|
'fail'=fail - table; (optional)
|
|
|
The NAG error argument, see the documentation for NagError.
|
|
|
|
Description
|
|
|
Purpose
|
|
nag_summary_stats_1var (g01aac) calculates the mean, standard deviation, coefficients of skewness and kurtosis, and the maximum and minimum values for a set of ungrouped data. Weighting may be used.
|
|
Description
|
|
The data consist of a single sample of observations, denoted by , with corresponding weights, , for .
If no specific weighting is required, then the array need not be defined.
The quantities computed are as follows.
|
a. The sum of the weights
|
|
b. Mean
|
|
c. Standard deviation
|
|
where
|
|
d. Coefficient of skewness
|
|
e. Coefficient of kurtosis
|
|
f. Maximum and minimum elements of the sample.
|
|
|
Error Indicators and Warnings
|
|
"NE_CASES_ONE"
The number of valid cases is one. In this case, standard deviation and coefficients of skewness and of kurtosis cannot be calculated.
"NE_CASES_ZERO"
The number of valid cases is zero.
"NE_INT_ARG_LE"
On entry, must not be less than or equal to 0: .
"NE_REAL_ARG_LT"
On entry, must not be less than : .
|
|
Accuracy
|
|
A single pass updating algorithm is used, which is believed to be stable.
|
|
Further Comments
|
|
The time taken by nag_summary_stats_1var (g01aac) is approximately proportional to .
|
|
|
Examples
|
|
>
|
n := 24:
x := Vector([193, 215, 112, 161, 92, 140, 38, 33, 279, 249, 473, 339, 60, 130, 20, 50, 257, 284, 447, 52, 67, 61, 150, 2200], datatype=float[8]):
wt := Vector([], datatype=float[8]):
NAG:-g01aac(x, nvalid, xmean, xsd, xskew, xkurt, xmin, xmax, wsum, 'n' = n, 'wt' = wt):
|
|
|