Next: select() Up: MacAnova Help File Previous: screen()   Contents


secoefs([Term] [, errorTerm:ErrorTerm, byterm:F, se:F or coefs: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.  byterm:F only when Term, se:F and coefs:F omitted

Keywords: glm, anova, regression, confidence intervals
secoefs(Term) returns the model effects or regression coefficients and
their standard errors for the term specified in the CHARACTER variable
Term.  The result is a structure with components 'coefs' and 'se'.

The coefficients and standard errors pertain to the results of the most
recent GLM (generalized linear or linear model) command such as
regress(), anova(), or poisson().

When Term is a main effect term, the components are vectors.  When it is
an interation term, the components are matrices or arrays with the
leftmost subscript corresponding to the leftmost factor in Term.

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.

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

If any variables in Term originally specified in the form {expr}, where
expr is a MacAnova expression, you must include the enclosing '{' and

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", secoefs(1) gets the estimated intercept or grand mean and its
standard error.

secoefs() (no Term specified) computes coefficients and standard errors
for all terms in the model.  The result is a structure with one
component for each term in the model, with each component itself a
structure with components 'coefs' and 'se'.

The names of the top level components in the result are taken from the
names of the terms, truncated if necessary to 12 characters.  When
such truncation is neccessary, the result is also given labels which
contain the full component names.  See topic 'labels'.

secoefs(byterm:F) is the same as secoefs() except that the resulting
structure has two components, 'coefs' and 'se', each of which is a
structure with one component per term (unless there is only one term in
the model).  In this case, the names of the bottom level components are
taken from the possibly truncated names of the terms.  When any
truncation takes place, the full term names are also attached as labels.

secoefs(Term, silent:T) and secoefs(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.

secoefs(Term,coefs:F) and secoefs(coefs:F) (or secoefs(,coefs:F))
suppress the computation of the coefficients, returning a structure or
matrix containing only standard errors.  secoefs(Term,se:F) and
secoefs(se:F) are equivalent to coefs(Term) and coefs(), respectively.

You can compute a structure containint t-statistics for every
coefficient by
  Cmd> tt <- secoefs(se:F)/secoefs(coefs:F) #or coefs()/secoefs(coefs:F)

Alternatively, you could compute such a structure by
  Cmd> @tmp <- secoefs(byterm:F); tt <- @tmp$coefs/@tmp$se

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

For all forms, an optional keyword phrase argument errorterm:ErrTerm or
errorterm:ErrTermNo, where ErrTerm is a CHARACTER variable or quoted
string specifying a term in the model and ErrTermNo is a positive
integer, specifies that the MS from the indicated term is to be used in
computing standard errors.

If tcrit is a critical value, say, invstu(1-alpha/2,errorDF), you can
compute the lower 1-alpha confidence limits for the coefficients
  Cmd> @tmp <- secoefs(byterm:F);@tmp$coefs - tcrit*@tmp$se
and similarly for upper limits (replace - by +).

Example: After anova("y= a + b + a.b")
   secoefs(a), secoefs("a"), or secoefs(1) will compute the main effect
     coefficients and their standard errors for factor a
   secoefs(a,coefs:F), secoefs("a",coefs:F), or secoefs(2,coefs:F) will
     compute the standard errors of main effect coefficients
   secoefs("a.b") or secoefs(4) will produce matrices of the a by b
     interaction coefficients and their standard errors.
   secoefs() will produce all coefficients and their standard errors in
     a structure with components CONSTANT, a, b, and a.b.
   secoefs(byterm:F) will produce all coefficients and their standard
     errors in a structure with components coefs and se

This will produce the a by b interaction effects and their standard

Secoefs() does not work after fastanova(), ipf(), or screen(), or if
'coefs:F' was an argument to the most recent GLM command.

See also coefs(), contrast(), modelinfo(), popmodel(), pushmodel().

Gary Oehlert 2003-01-15