g02cf reorders the elements in two vectors (typically vectors of means and standard deviations), and the rows and columns in two matrices (typically either matrices of sums of squares and cross-products of deviations from means and Pearson product-moment correlation coefficients, or matrices of sums of squares and cross-products about zero and correlation-like coefficients).
Syntax
C# |
---|
public static void g02cf( int n, int[] korder, double[] xbar, double[] std, double[,] ssp, double[,] r, out int ifail ) |
Visual Basic |
---|
Public Shared Sub g02cf ( _ n As Integer, _ korder As Integer(), _ xbar As Double(), _ std As Double(), _ ssp As Double(,), _ r As Double(,), _ <OutAttribute> ByRef ifail As Integer _ ) |
Visual C++ |
---|
public: static void g02cf( int n, array<int>^ korder, array<double>^ xbar, array<double>^ std, array<double,2>^ ssp, array<double,2>^ r, [OutAttribute] int% ifail ) |
F# |
---|
static member g02cf : n : int * korder : int[] * xbar : float[] * std : float[] * ssp : float[,] * r : float[,] * ifail : int byref -> unit |
Parameters
- n
- Type: System..::..Int32On entry: , the number of variables in the input data.Constraint: .
- korder
- Type: array<System..::..Int32>[]()[][]An array of size [n]On entry: must be set to the number of the original variable which is to be the th variable in the re-arranged data, for .Constraint: , for .
- xbar
- Type: array<System..::..Double>[]()[][]An array of size [n]On entry: must be set to the mean of variable , for .On exit: contains the mean of variable where , for .
- std
- Type: array<System..::..Double>[]()[][]An array of size [n]On entry: must be set to the standard deviation of variable , for .On exit: contains the standard deviation of variable where , for .
- ssp
- Type: array<System..::..Double,2>[,](,)[,][,]An array of size [dim1, n]Note: dim1 must satisfy the constraint:On entry: must be set to the sum of cross-products of deviations from means (or about zero ) for variables and , for and .On exit: contains the sum of cross-products of deviations from means (or about zero ) for variables and , where , and , .
- r
- Type: array<System..::..Double,2>[,](,)[,][,]An array of size [dim1, n]Note: dim1 must satisfy the constraint:On entry: must be set to the Pearson product-moment correlation coefficient (or the correlation-like coefficient ) for variables and , for and .On exit: contains the Pearson product-moment correlation coefficient (or the correlation-like coefficient ) for variables and , where and , for and .
- ifail
- Type: System..::..Int32%On exit: unless the method detects an error or a warning has been flagged (see [Error Indicators and Warnings]).
Description
Input to the method consists of:
(a) | A list of the order in which the variables are to be arranged on exit:
|
||
(b) | A vector of means:
|
||
(c) | A vector of standard deviations:
|
||
(d) | A matrix of sums of squares and cross-products of deviations from means:
|
||
(e) | A matrix of correlation coefficients:
|
On exit from the method, these same vectors and matrices are reordered, in the manner specified, and contain the following information:
Note: for sums of squares of cross-products of deviations about zero and correlation-like coefficients and should be replaced by and in the description of the input and output above.
(i) | The vector of means:
|
||
(ii) | The vector of standard deviations:
|
||
(iii) | The matrix of sums of squares and cross-products of deviations from means:
|
||
(iv) | The matrix of correlation coefficients:
|
References
None.
Error Indicators and Warnings
Errors or warnings detected by the method:
Some error messages may refer to parameters that are dropped from this interface
(LDSSP, LDR) In these
cases, an error in another parameter has usually caused an incorrect value to be inferred.
On entry, .
On entry, , or for some .
- On entry, there is not a one-to-one correspondence between the old variables and the new variables; at least one of the original variables is not included in the new set, and consequently at least one other variable has been included more than once.
Accuracy
Not applicable.
Parallelism and Performance
None.
Further Comments
The time taken by g02cf depends on and the amount of re-arrangement involved.
The method is intended primarily for use when a set of variables is to be reordered for use in a regression, and is described accordingly. There is however no reason why the method should not also be used to reorder vectors and matrices which contain any other non-statistical information; the matrices need not be symmetric.
The method may be used either with sums of squares and cross-products of deviations from means and Pearson product-moment correlation coefficients in connection with a regression involving a constant, or with sums of squares and cross-products about zero and correlation-like coefficients in connection with a regression with no constant.
Example
This example reads in the means, standard deviations, sums of squares and cross-products, and correlation coefficients for three variables. The vectors and matrices are reordered so that they contain the means, standard deviations, sums of squares and cross-products, and correlation coefficients for the first, third and second variables (in that order). Finally the reordered vectors and matrices are printed.
Example program (C#): g02cfe.cs