Next: power() Up: MacAnova Help File Previous: polyroot()   Contents

popmodel()

Usage:
popmodel([all:T])
popmodel(canpop:T)



Keywords: anova, glm, multivariate analysis, regression, residuals
All GLM commands except screen(), for example regress() and anova(),
retain information (GLM information) internally for use by certain
functions such as coefs() and modelinfo() that provide results from the
most recent GLM command.  When a GLM command is run, information from
the previous GLM command, if any, is replaced.  When the GLM command is
in a macro, this may confuse the user who may expect that coefs(), say,
gives the same answer after the macro is used as before.

Commands pushmodel() and popmodel() allow a macro to save and restore
the current GLM information.

pushmodel() saves the current GLM information so that it can
subsequently be restored by popmodel().  Until a new GLM command has
been run or GLM information has been restored by popmodel(), there is no
GLM information available to commands such as secoefs() and modelinfo().

After the next prompt following the use of pushmodel(), the active model
before the first use of pushmodel() is restored (equivalent to an
automatic execution of popmodel(all:T)).

pushmodel() and popmodel() are intended to be used in macros.  A macro
can run pushmodel() before a GLM command and then run popmodel() before
finishing to ensure that the current GLM information is not changed.  Of
course, if the purpose of the macro is to change the information, it
should not use pushmodel() and popmodel().

The default maximum number of sets of GLM information that can be saved
is 2 (0 in limited memory DOS version).  On versions allowing command
line arguments you can change the default by '-savemodels N' where N >=
0 is an integer.  See 'launching'.

popmodel() replaces the current GLM information by the GLM information
saved most recently by pushmodel().  It also deletes all GLM side effect
variables such as RESIDUALS and STRMODEL and then replaces them by side
effect variables appropriate to the model being restored.

popmodel(all:T) discards the current GLM information and all but the
first GLM information saved by previous use of pushmodel().

With either usage, when there is no information that has been saved by
pushmodel(), a warning message is printed and the current GLM
information is not discarded nor are side effect variables modified.

popmodel(canpop:T) returns True if there is saved GLM information that
could be restored by popmodel().  It does not change the current model
or side effect variables.

Type help(pushmodel:"example") for an example.

See also pushmodel(), modelinfo(), coefs(), secoefs(), contrast(),
'macros'.


Gary Oehlert 2003-01-15