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:
n – IntegerInput
On entry: the number of observations in the data matrix, .
Constraint:
.
- 2:
m – IntegerInput
On entry: the number of variables in the data array
x.
Constraint:
.
- 3:
x[] – doubleOutput
-
On exit: must contain the th sample point for the th variable , for and .
- 4:
tdx – IntegerInput
-
On entry: the stride separating matrix column elements in the array
x.
Constraint:
.
- 5:
nvar – IntegerInput
On entry: the number of variables to be standardized, .
Constraint:
.
- 6:
isx[m] – 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:
s[m] – 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:
e[m] – const doubleInput
-
On entry: if
, then
must contain the location shift (mean),
, for the
th variable.
If , then is not referenced.
- 9:
z[] – doubleOutput
-
Note: the th element of the matrix is stored in .
On exit: the matrix of standardized values (-scores), .
- 10:
tdz – IntegerInput
-
On entry: the stride separating matrix column elements in the array
z.
Constraint:
.
- 11:
fail – NagError *Input/Output
-
The NAG error argument (see
Section 3.6 in the Essential Introduction).
- 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.
Not applicable.
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.