g02ce takes selected elements from two vectors (typically vectors of means and standard deviations) to form two smaller vectors, and selected rows and columns from 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) to form two smaller matrices, allowing reordering of elements in the process.
Syntax
C# |
---|
public static void g02ce( int n, double[] xbar, double[] std, double[,] ssp, double[,] r, int m, int[] korder, double[] xbar2, double[] std2, double[,] ssp2, double[,] r2, out int ifail ) |
Visual Basic |
---|
Public Shared Sub g02ce ( _ n As Integer, _ xbar As Double(), _ std As Double(), _ ssp As Double(,), _ r As Double(,), _ m As Integer, _ korder As Integer(), _ xbar2 As Double(), _ std2 As Double(), _ ssp2 As Double(,), _ r2 As Double(,), _ <OutAttribute> ByRef ifail As Integer _ ) |
Visual C++ |
---|
public: static void g02ce( int n, array<double>^ xbar, array<double>^ std, array<double,2>^ ssp, array<double,2>^ r, int m, array<int>^ korder, array<double>^ xbar2, array<double>^ std2, array<double,2>^ ssp2, array<double,2>^ r2, [OutAttribute] int% ifail ) |
F# |
---|
static member g02ce : n : int * xbar : float[] * std : float[] * ssp : float[,] * r : float[,] * m : int * korder : int[] * xbar2 : float[] * std2 : float[] * ssp2 : float[,] * r2 : float[,] * ifail : int byref -> unit |
Parameters
- n
- Type: System..::..Int32On entry: , the number of variables in the input data.Constraint: .
- xbar
- Type: array<System..::..Double>[]()[][]An array of size [n]On entry: must be set to , the mean of variable , for .
- std
- Type: array<System..::..Double>[]()[][]An array of size [n]On entry: must be set to , the standard deviation of variable , 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 .
- 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 .
- m
- Type: System..::..Int32On entry: the number of variables , required in the reduced vectors and matrices.Constraint: .
- korder
- Type: array<System..::..Int32>[]()[][]An array of size [m]On entry: must be set to the number of the original variable which is to be the th variable in the output vectors and matrices, for .Constraint: , for .
- xbar2
- Type: array<System..::..Double>[]()[][]An array of size [m]
- std2
- Type: array<System..::..Double>[]()[][]An array of size [m]
- ssp2
- Type: array<System..::..Double,2>[,](,)[,][,]An array of size [dim1, m]Note: dim1 must satisfy the constraint:
- r2
- Type: array<System..::..Double,2>[,](,)[,][,]An array of size [dim1, m]Note: dim1 must satisfy the constraint:
- 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 vector of means:
|
||
(b) | A vector of standard deviations:
|
||
(c) | A matrix of sums of squares and cross-products of deviations from means:
|
||
(d) | A matrix of correlation coefficients:
|
||
(e) | The number of variables, , in the required subset, and their row/column numbers in the input data, ,
|
New vectors and matrices are output containing 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) | A vector of means:
|
||
(ii) | A vector of standard deviations:
|
||
(iii) | A matrix of sums of squares and cross-products of deviations from means:
|
||
(iv) | A 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, LDSSP2, LDR2) In these
cases, an error in another parameter has usually caused an incorrect value to be inferred.
On entry, , or .
On entry, .
On entry, , or for some .
Accuracy
Not applicable.
Parallelism and Performance
None.
Further Comments
The time taken by g02ce depends on and .
The method is intended primarily for use when a subset of variables from a larger set of variables is to be used in a regression, and is described accordingly. There is however no reason why the method should not also be used to select specific rows and columns from vectors and arrays 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 four variables. New vectors and matrices are created containing the means, standard deviations, sums of squares and cross-products, and correlation coefficients for the fourth, first and second variables (in that order). Finally these new vectors and matrices are printed.
Example program (C#): g02cee.cs