Next: bin() Up: MacAnova Help File Previous: batch()   Contents

bcprd()

Usage:
bcprd(x), REAL matrix x
bcprd(x1, x2, ... ), x1, x2, ... REAL matrices with the same number of
  rows.



Keywords: matrix algebra, glm
bcprd(x) where x is a matrix computes a "bordered" cross product matrix
containing the means of the columns of x and mean-corrected sums of
squares and products of the columns of x.

bcprd(x1,x2,...,xm) yields the same result as bcprd(hconcat(x1,x2,...,
xm)) when x1, x2, ... are all REAL matrices with the same number of
rows.

Specifically, when x is an n by p matrix, bcp <- bcprd(x) sets bcp to
a p+1 by p+1 matrix, where
  bcp[1,1]   = 1/n
  bcp[-1,1]  = a column vector containing the sample mean xbar
  bcp[1,-1]  = a row vector containing -xbar'
  bcp[-1,-1] = the p by p matrix of mean-corrected sums of squares and
               products of the columns of x

bcprd(x) is mathematically equivalent to
  {@TMP <- hconcat(rep(1,nrows(x)),x); swp(@TMP %c% @TMP,1)}.
However, the use of bcrpd() is preferred to the illustrated use of swp()
since it uses a numerically stable algorithm to compute the corrected
sums of squares and products.

When all the arguments of bcprd() have labels, so will the result of
bcprd() with both row and column labels taken from the column labels of
the arguments.

See also swp().


Gary Oehlert 2003-01-15