For a data matrix,
, consisting of
observations on
variables, with elements
, nag_mv_z_scores (g03zac) computes a matrix,
, with elements
such that:
where
is a location shift and
is a scaling factor. Typically,
will be the mean and
will be the standard deviation of the
th variable and therefore the elements in column
of
will have zero mean and unit variance.
None.
- 1:
– IntegerInput
-
On entry: the number of observations in the data matrix, .
Constraint:
.
- 2:
– IntegerInput
-
On entry: the number of variables in the data array
x.
Constraint:
.
- 3:
– const doubleInput
-
On entry: must contain the th sample point for the th variable , for and .
- 4:
– IntegerInput
-
On entry: the stride separating matrix column elements in the array
x.
Constraint:
.
- 5:
– IntegerInput
-
On entry: the number of variables to be standardized, .
Constraint:
.
- 6:
– const IntegerInput
-
On entry:
indicates whether or not the observations on the
th variable are included in the matrix of standardized values.
If , then the observations from the th variable are included.
If , then the observations from the th variable are not included.
Constraint:
for
nvar values of
.
- 7:
– const doubleInput
-
On entry: if
, then
must contain the scaling (standard deviation),
, for the
th variable.
If , then is not referenced.
Constraint:
if , , for .
- 8:
– const doubleInput
-
On entry: if
, then
must contain the location shift (mean),
, for the
th variable.
If , then is not referenced.
- 9:
– doubleOutput
-
Note: the th element of the matrix is stored in .
On exit: the matrix of standardized values (-scores), .
- 10:
– IntegerInput
-
On entry: the stride separating matrix column elements in the array
z.
Constraint:
.
- 11:
– NagError *Input/Output
-
The NAG error argument (see
Section 2.7 in How to Use the NAG Library and its Documentation).
- NE_2_INT_ARG_LT
-
On entry, while . These arguments must satisfy .
On entry, while . These arguments must satisfy .
On entry, while . These arguments must satisfy .
- NE_INT_ARG_LT
-
On entry, .
Constraint: .
On entry, .
Constraint: .
- NE_INTARR_REALARR
-
On entry, , .
Constraint: if , , for .
- NE_INTERNAL_ERROR
-
An internal error has occurred in this function. Check the function call
and any array sizes. If the call is correct then please contact
NAG for
assistance.
- NE_VAR_INCL_INDICATED
-
The number of variables,
nvar in the analysis
, while number of variables included in the analysis via array
.
Constraint: these two numbers must be the same.
Standard accuracy is achieved.
nag_mv_z_scores (g03zac) is not threaded in any implementation.
Means and standard deviations may be obtained using
nag_summary_stats_onevar (g01atc) or
nag_corr_cov (g02bxc).
A 4 by 3 data matrix is input along with location and scaling values. The first and third columns are scaled and the results printed.