Next: colplot() Up: MacAnova Help File Previous: cmplx()   Contents


coefs([Term] [, errorTerm:ErrorTerm, se:T, coefs:F, byterm:F,
  silent:T]), Term a CHARACTER scalar, a positive integer, or a factor
  or variate in the current GLM model, ErrorTerm a CHARACTER scalar or
  positive integer.  Use byterm:F only when Term and coefs:F omitted,
  and se:T included

Keywords: glm, anova, regression
coefs(Term) returns the model effects or regression coefficients for
term Term in the current GLM model.  These are determined from
information computed by the most recent GLM (generalized linear or
linear model) command such as regress(), anova(), or poisson().

Term is usually a quoted string or CHARACTER variable such as "a.b"
which exactly matches a term in the most recent model, that is, "a.b" is
not the same as "b.a".  An interaction term produces a matrix or array
with the leftmost subscript corresponding to the leftmost factor in
Term.  When a model term contains {expr} where expr is a MacAnova
expression, '{' and '}' are part of the term name and must be included.

For a term which consists of a single factor or variate, Term can be its
unquoted name.

Alternatively, Term can be a integer between 1 and the number of terms,
excluding the final error term.  For example, unless the model contained
"-1", coefs(1) gets the estimated intercept or grand mean.

coefs() (no Term specified) computes coefficients for all terms in the
model as a structure with one component for each term.  The component
names are taken from the term names, truncated if necessary to 12
characters.  When any truncation is necessary, the complete term names
are attached to the result as labels.  See topic 'labels'.

coefs(Term, silent:T) and coefs(silent:T) do the same, but certain
warning and advisory messages are suppressed.  'silent:T' can be used
with any other keywords.  This feature is useful in a macro when warning
messages might confuse the user, or in a simulation.  The default value
of 'silent' is False unless the value of option' 'warnings' is False.

coefs(Term,se:T) and coefs(se:T) also compute standard errors and are
equivalent to secoefs(Term) and secoefs(), respectively.  You can also
use keywords 'error' and 'byterm' in this case.  See secoefs().

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.

coefs(Term,Varno) or coefs(,Varno) computes coefficients only for
variable number Varno in the case of a multivariate dependent variable.
When present, Varno must be the second argument and any keywords must
follow it.

Function coefs() does not work after screen() or after a GLM command
with 'coefs:F' as an argument.

Example: After anova("y= a + b + a.b")
   coefs(a), coefs("a"), or coefs(2) will compute the main effect
     coefficients for factor a
   coefs("a.b") or coefs(4) will produce a matrix of the a by b
     interaction coefficients.
   coefs() will produce all coefficients, including the constant.

See also secoefs(), contrast(), modelinfo(), popmodel(), pushmodel()

Gary Oehlert 2003-01-15