# Statistica Visual Basic Library of Matrix Functions - MatrixCrossProductOfDev (Matrix1, Intercept, MatrixResult)

 Parameter Description Matrix name of data matrix (see Arrays in functions) Intercept if 1, correlations computed with intercept; if 0, correlations computed without intercept MatrixResult square destination matrix (see Arrays in functions; number of rows and columns equals number of columns in the source data matrix)

The MatrixCrossProductOfDev function will compute a matrix of squared deviations and crossproducts of deviations for the specified Matrix (see also, Arrays in functions). The resulting values will be placed in the square matrix MatrixResult. If the parameter Intercept is set to 1, then MatrixResult will contain the sums of squared deviations from the means in the diagonal elements and the crossproducts of deviations from the means in the off-diagonal elements of the matrix. If the parameter Intercept is set to 0, then MatrixResult will contain sums of the squared deviations from 0 (zero) in the diagonal, and crossproducts of deviations from 0 (zero) in the off-diagonal elements. Note that you can divide each element in the crossproduct matrix by either N or (N-1) to obtain the covariance matrix [use MatrixElemDivide to divide the elements in the matrix by the scalar N or (N-1)].

Related topics. MatrixElemDivide, MatrixCorrelations, MatrixRead, MatrixDisplay, ReDim. For more information on using arrays, see Arrays in functions. For a complete list of matrix functions, see Statistica Visual Basic library of matrix functions.