Next: xvariables() Up: MacAnova Help File Previous: wx   Contents

xrows()

Usage:
xrows(variates [,factors]), variates and factors REAL matrices or
  vectors or NULL.



Keywords: glm
xrows(Variates, Factors) computes rows of an X-variable (design) matrix
corresponding to variate values in Variates and factor levels in
Factors, using the information saved by the preceding GLM command.

In the following, let nv = number of variates in the model and nf = the
number of factors in the model.

Variates should be either a REAL vector with length(Variates) = nv, or a
REAL matrix with ncols(Variates) = nv.  when nv = 0, Variates should be
NULL.

Factors should be either a REAL vector with length(Factors) = nf or a
REAL matrix with ncols(Factors) = nf.  All the elements of Factors
should be positive integers not exceeding the maximim level for each
factor.  When nf = 0, Factors should be NULL or should be omitted
entirely.

Let nrowv be 1 if Variates is a vector and nrows(Variates) otherwise,
and let nrowf be 1 if Factors is a vector and nrows(Factors) otherwise.
Then if nrowv != nrowf, you must have either nrowv = 1 or nrowf = 1 and
the single row of Variates or Factors is used for every row of the
output.

The result is a REAL matrix with max(nrowv, nrowf) rows.  Each row
consists of the values of the X-variables (design matrix) corresponding
to that row of Variates and Factors.

Examples:
  After anova("y=x1+x2+a*b"), xrows(hconcat(x1,x2), hconcat(a,b)) is
  equivalent to xvariables().

  After regress("y=x1+x2"); xrows(x0) %*% COEF is equivalent to
  regpred(x0,seest:F,sepred:F) where x0 is a matrix of values for x1 and
    x2.

See also topics xvariables(), modelinfo(), regpred(), glmpred(), 'glm'.


Gary Oehlert 2003-01-15