naginterfaces.library.correg.coeffs_​pearson_​miss_​case¶

naginterfaces.library.correg.coeffs_pearson_miss_case(x, miss, xmiss)[source]

coeffs_pearson_miss_case computes means and standard deviations of variables, sums of squares and cross-products of deviations from means, and Pearson product-moment correlation coefficients for a set of data omitting completely any cases with a missing observation for any variable.

For full information please refer to the NAG Library document for g02bb

https://www.nag.com/numeric/nl/nagdoc_29/flhtml/g02/g02bbf.html

Parameters
xfloat, array-like, shape

must be set to , the value of the th observation on the th variable, for , for .

missint, array-like, shape

must be set equal to if a missing value, , is to be specified for the th variable in the array , or set equal to otherwise. Values of must be given for all variables in the array .

xmissfloat, array-like, shape

must be set to the missing value, , to be associated with the th variable in the array , for those variables for which missing values are specified by means of the array (see Accuracy).

Returns
xbarfloat, ndarray, shape

The mean value, , of the th variable, for .

stdfloat, ndarray, shape

The standard deviation, , of the th variable, for .

sspfloat, ndarray, shape

is the cross-product of deviations , for , for .

rfloat, ndarray, shape

is the product-moment correlation coefficient between the th and th variables, for , for .

ncasesint

The number of cases actually used in the calculations (when cases involving missing values have been eliminated).

Raises
NagValueError
(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

After observations with missing values were omitted, no cases remained.

(errno )

After observations with missing values were omitted, only one case remained.

Notes

No equivalent traditional C interface for this routine exists in the NAG Library.

The input data consist of observations for each of variables, given as an array

where is the th observation on the th variable. In addition, each of the variables may optionally have associated with it a value which is to be considered as representing a missing observation for that variable; the missing value for the th variable is denoted by . Missing values need not be specified for all variables.

Let if observation contains a missing value for any of those variables for which missing values have been declared, i.e., if for any for which an has been assigned (see also Accuracy); and otherwise, for .

The quantities calculated are:

1. Means:

2. Standard deviations:

3. Sums of squares and cross-products of deviations from means:

4. Pearson product-moment correlation coefficients:

If or is zero, is set to zero.