16.4.2.4 Minimum, Maximum, and Sum Functions

Matrix Function: CMIN (M)
Matrix Function: CMAX (M)
Matrix Function: CSUM (M)
Matrix Function: CSSQ (M)
Matrix Function: MEAN (M)

Returns a row vector with the same number of columns as M, in which each element is the minimum, maximum, sum, sum of squares, or mean, respectively, of the elements in the same column of M.

CMIN({1, 2, 3; 4, 5, 6; 7, 8, 9}) ⇒ {1, 2, 3}
CMAX({1, 2, 3; 4, 5, 6; 7, 8, 9}) ⇒ {7, 8, 9}
CSUM({1, 2, 3; 4, 5, 6; 7, 8, 9}) ⇒ {12, 15, 18}
CSSQ({1, 2, 3; 4, 5, 6; 7, 8, 9}) ⇒ {66, 93, 126} MEAN({1, 2, 3; 4, 5, 6; 7, 8, 9}) ⇒ {4, 5, 6}

MEAN is a PSPP extension.

Matrix Function: MMIN (M)
Matrix Function: MMAX (M)
Matrix Function: MSUM (M)
Matrix Function: MSSQ (M)

Returns the minimum, maximum, sum, or sum of squares, respectively, of the elements of M.

MMIN({1, 2, 3; 4, 5, 6; 7, 8, 9}) ⇒ 1
MMAX({1, 2, 3; 4, 5, 6; 7, 8, 9}) ⇒ 9
MSUM({1, 2, 3; 4, 5, 6; 7, 8, 9}) ⇒ 45
MSSQ({1, 2, 3; 4, 5, 6; 7, 8, 9}) ⇒ 285

Matrix Function: RMIN (M)
Matrix Function: RMAX (M)
Matrix Function: RSUM (M)
Matrix Function: RSSQ (M)

Returns a column vector with the same number of rows as M, in which each element is the minimum, maximum, sum, or sum of squares, respectively, of the elements in the same row of M.

RMIN({1, 2, 3; 4, 5, 6; 7, 8, 9}) ⇒ {1; 4; 7}
RMAX({1, 2, 3; 4, 5, 6; 7, 8, 9}) ⇒ {3; 6; 9}
RSUM({1, 2, 3; 4, 5, 6; 7, 8, 9}) ⇒ {6; 15; 24}
RSSQ({1, 2, 3; 4, 5, 6; 7, 8, 9}) ⇒ {14; 77; 194}

Matrix Function: SSCP (M)

Returns M^T × M.

SSCP({1, 2, 3; 4, 5, 6}) ⇒ {17, 22, 27; 22, 29, 36; 27, 36, 45}

Matrix Function: TRACE (M)

Returns the sum of the elements along M’s main diagonal, equivalent to MSUM(DIAG(M)).

TRACE(MDIAG(1:5)) ⇒ 15

Matrix Function: COV (M)

Returns a symmetric matrix whose diagonal elements are the variance of the each column in M and whose off-diagonal elements are the covariance of the two columns of the element’s row and column. For example, if M is a 2×n matrix, the result is a 2×2 matrix {a, b; b, c}, where a is the variance of M’s first column, b is the covariance between M’s two columns, and c is the variance of M’s second column.

COV({80, 70; 63, 20; 100, 50}) ⇒ {343, 260; 260, 633.33}

COV is a PSPP extension.