Next: glmtable() Up: MacAnova Help File Previous: glmfit()   Contents

glmpred()

Usage:
glmpred(variates,factors [, estimate:F, seest:F, sepred:T, n:N,
  silent:T]), variates and factors REAL vectors or matrices or NULL, N a
  positive scalar or REAL vector with positive elements.



Keywords: glm, regression, anova, categorical data
glmpred(Variates, Factors) computes estimates of the expected value of
the response variable y for specified values of any variates and levels
of any factors in the latest GLM model.  It returns a structure with
REAL components (vectors, except after manova()) "estimate" and "SEest".

If there are no variates in the model, Variates should be NULL (see
topic 'NULL').  Otherwise, Variates should be REAL.  If there are Nvar
variates in the model, Variates should either be a vector of length Nvar
containing values for each of the variates, or a matrix with Nvar
columns, with each row containing values for each variate.

If there are no factors in the model, Factors should be omitted or
explicitly NULL.  Otherwise, Factors should be REAL.  If there are Nfac
variates in the model, Factors should either be a vector of length Nfac
containing levels for each of the factors, or a matrix with Nfac
columns, with each row containing levels for each factor.

If either Variates or Factors contains data for only one case, it is
used for all cases.  Otherwise, you must have nrows(Variates) =
nrows(Factors).

Caution: After anova(), manova() and regress(), standard errors are
computed using the final error mean square in the model.  This may not
be appropriate with mixed models, including split plot designs.

glmpred(Variates, Factors, silent:T) does the same except that certain
advisory messages are suppressed.  'silent:T' can be used with any other
keywords.  The default value of 'silent' is False unless the value of
option' 'warnings' is False.

glmpred(Variates, Factors, sepred:T) adds component SEpred to the output
structure containing a vector or matrix of prediction standard errors.
This is only permissible after regress(), anova() or manova() and their
weighted alternatives.

glmpred(Variates, Factors, seest:F) suppresses the computation of
standard errors.

glmpred(Variates, Factors, estimate:F) suppresses the computation of
expected values.  This option is legal only after anova(), manova(),
regress() and their weighted alternatives.

You cannot use glmpred() after fastanova() or ipf() or when coefs:F was
used on the preceding GLM command.

After GLM functions involving a Binomial response variable (logistic(),
probit(), glmfit(...,dist:"binomial")), the values computed are the
estimated probabilities p of "success" associated with each case (set of
values).  In this case, you can also use keyword phrase n:N, where N is
a REAL variable, to specify the number of trials for each case.  N can
be a scalar or a vector whose length matches the number of cases.  The
resulting estimated values are N*phat, where phat are the estimated
probabilities.

After GLM functions such as poisson(), logistic(), or probit(), where
the expectation of the response is a non-linear function of a linear
combination of the predictors, the standard error is computed from the
expectation and standard error in the linear scale using the
delta-method.  When the response is binomial and you also use n:N, the
standard errors are those of N*p.

Comment: Standard errors are computed on the assumption that all effects
are fixed and not random.  When this is not appropriate, the standard
errors will usually indicate more precision than is warrented.

Examples:
  After regress(), glmpred(x,sepred:T) is equivalent to regpred().
  After anova("y=x+a+b"), x a variate, a and b factors,
     glmpred(x, hconcat(a,b)) computes fitted values and their standard
     errors for each case.
  glmpred(modelvars(variates:T), modelvars(factors:T)) computes fitted
  values and their standard errors for each case, regardless of the
     model.

See also glmtable(), glmpred(), regpred(), modelinfo(), popmodel(),
pushmodel().


Gary Oehlert 2003-01-15