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..::..Int32
On entry: n, the number of variables in the input data.
Constraint: n2.
xbar
Type: array<System..::..Double>[]()[][]
An array of size [n]
On entry: xbar[i-1] must be set to x-i, the mean of variable i, for i=1,2,,n.
std
Type: array<System..::..Double>[]()[][]
An array of size [n]
On entry: std[i-1] must be set to si, the standard deviation of variable i, for i=1,2,,n.
ssp
Type: array<System..::..Double,2>[,](,)[,][,]
An array of size [dim1, n]
Note: dim1 must satisfy the constraint: dim1n
On entry: ssp[i-1,j-1] must be set to the sum of cross-products of deviations from means Sij (or about zero, S~ij) for variables i and j, for i=1,2,,n and j=1,2,,n.
r
Type: array<System..::..Double,2>[,](,)[,][,]
An array of size [dim1, n]
Note: dim1 must satisfy the constraint: dim1n
On entry: r[i-1,j-1] must be set to the Pearson product-moment correlation coefficient Rij (or the correlation-like coefficient, R~ij) for variables i and j, for i=1,2,,n and j=1,2,,n.
m
Type: System..::..Int32
On entry: the number of variables m, required in the reduced vectors and matrices.
Constraint: 1mn.
korder
Type: array<System..::..Int32>[]()[][]
An array of size [m]
On entry: korder[i-1] must be set to the number of the original variable which is to be the ith variable in the output vectors and matrices, for i=1,2,,m.
Constraint: 1korder[i]n, for i=0,1,,m-1.
xbar2
Type: array<System..::..Double>[]()[][]
An array of size [m]
On exit: the mean of variable i, xbar[i-1], where i=korder[k-1], for k=1,2,,m. (The array xbar2 must differ from xbar and std.)
std2
Type: array<System..::..Double>[]()[][]
An array of size [m]
On exit: the standard deviation of variable i, std[i-1], where i=korder[k-1], for k=1,2,,m. (The array std2 must differ from both xbar and std.)
ssp2
Type: array<System..::..Double,2>[,](,)[,][,]
An array of size [dim1, m]
Note: dim1 must satisfy the constraint: dim1m
On exit: ssp2[k-1,l-1] contains the value of ssp[i-1,j-1], where i=korder[k-1] and j=korder[l-1], for k=1,2,,m and l=1,2,,m. (The array ssp2 must differ from both ssp and r.)
That is to say: on exit, ssp2[k-1,l-1] contains the sum of cross-products of deviations from means Sij (or about zero, S~ij).
r2
Type: array<System..::..Double,2>[,](,)[,][,]
An array of size [dim1, m]
Note: dim1 must satisfy the constraint: dim1m
On exit: r2[k-1,l-1] contains the value of r[i-1,j-1], where i=korder[k-1] and j=korder[l-1], for k=1,2,,m and l=1,2,,m. (The array r2 must differ from both ssp and r.)
That is to say: on exit, r2[k-1,l-1] contains the Pearson product-moment coefficient Rij (or the correlation-like coefficient, R~ij).
ifail
Type: System..::..Int32%
On exit: ifail=0 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:
x-1,x-2,x-3,,x-n,
where n is the number of input variables.
(b) A vector of standard deviations:
s1,s2,s3,,sn.
(c) A matrix of sums of squares and cross-products of deviations from means:
S11S12S13...S1nS21S22S2nS31.......Sn1Sn2....Snn.
(d) A matrix of correlation coefficients:
R11R12R13...R1nR21R22R2nR31.......Rn1Rn2....Rnn.
(e) The number of variables, m, in the required subset, and their row/column numbers in the input data, i1,i2,i3,,im,
iikn  for k=1,2,,mn2,m1  and  mn.
New vectors and matrices are output containing the following information:
(i) A vector of means:
x-i1,x-i2,x-i3,,x-im.
(ii) A vector of standard deviations:
si1,si2,si3,,sim.
(iii) A matrix of sums of squares and cross-products of deviations from means:
Si1i1Si1i2Si1i3...Si1imSi2i1Si2i2.Si3i1.......Simi1Simi2....Simim.
(iv) A matrix of correlation coefficients:
Ri1i1Ri1i2Ri1i3...Ri1imRi2i1Ri2i2.Ri3i1.......Rimi1Rimi2....Rimim.
Note:  for sums of squares of cross-products of deviations about zero and correlation-like coefficients Sij and Rij should be replaced by S~ij and R~ij in the description of the input and output above.

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.
ifail=1
On entry,n<2,
orm<1.
ifail=2
On entry,n<m.
ifail=4
On entry,korder[i-1]<1,
orkorder[i-1]>n for some i=1,2,,m.
ifail=-9000
An error occured, see message report.
ifail=-6000
Invalid Parameters value
ifail=-4000
Invalid dimension for array value
ifail=-8000
Negative dimension for array value
ifail=-6000
Invalid Parameters value

Accuracy

Not applicable.

Parallelism and Performance

None.

Further Comments

The time taken by g02ce depends on n and m.
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

Example program data: g02cee.d

Example program results: g02cee.r

See Also