g02bw calculates a matrix of Pearson product-moment correlation coefficients from sums of squares and cross-products of deviations about the mean.

Syntax

C#
public static void g02bw(
	int m,
	double[] r,
	out int ifail
)
Visual Basic
Public Shared Sub g02bw ( _
	m As Integer, _
	r As Double(), _
	<OutAttribute> ByRef ifail As Integer _
)
Visual C++
public:
static void g02bw(
	int m, 
	array<double>^ r, 
	[OutAttribute] int% ifail
)
F#
static member g02bw : 
        m : int * 
        r : float[] * 
        ifail : int byref -> unit 

Parameters

m
Type: System..::..Int32
On entry: m, the number of variables.
Constraint: m1.
r
Type: array<System..::..Double>[]()[][]
An array of size [m×m+m/2]
On entry: contains the upper triangular part of the sums of squares and cross-products matrix of deviations from the mean. These are stored packed by column, i.e., the cross-product between variable j and k, kj, is stored in r[k×k-1/2+j-1].
On exit: Pearson product-moment correlation coefficients.
These are stored packed by column corresponding to the input cross-products.
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

g02bw calculates a matrix of Pearson product-moment correlation coefficients from sums of squares and cross-products about the mean for observations on m variables which can be computed by a single call to g02bu or a series of calls to g02bt. The sums of squares and cross-products are stored in an array packed by column and are overwritten by the correlation coefficients.
Let cjk be the cross-product of deviations from the mean, for j=1,2,,m and k=j,,m, then the product-moment correlation coefficient, rjk is given by
rjk=cjkcjjckk.

References

None.

Error Indicators and Warnings

Note: g02bw may return useful information for one or more of the following detected errors or warnings.
Errors or warnings detected by the method:
ifail=1
On entry,m<1.
ifail=2
A variable has a zero variance. All correlations involving the variable with zero variance will be returned as zero.
ifail=-9000
An error occured, see message report.
ifail=-8000
Negative dimension for array value
ifail=-6000
Invalid Parameters value

Accuracy

The accuracy of g02bw is entirely dependent upon the accuracy of the elements of array r.

Parallelism and Performance

None.

Further Comments

g02bw may also be used to calculate the correlations between parameter estimates from the variance-covariance matrix of the parameter estimates as is given by several methods in this chapter.

Example

See Also