Next: chiqqplot() Up: Multivariate Macros Help File Previous: Multivariate Macros Help File   Contents

backstep()

Usage:
backstep(H,E,fh,fe), H and E symmetric REAL matrices of the same size
  with no MISSING values



Keywords: classification, discrimination, stepwise
NOTE: This macro is OBSOLETE and is retained only for backward
compatibility because it was in file MacAnova.mac in earlier versions of
MacAnova.  For doing stepwise variable selection in discriminant
analysis you should use newer macros dastepsetup(), daentervar(),
daremovevar(), dastepstatus() and dasteplook().

You can use macro backstep() to perform a variable elimination step in
backwards stepwise variable selection in linear discriminant analysis.

Macro backstep() is intended to be used after you have used manova() to
compute hypothesis and error matrices H and E, with fh and fe degrees of
freedom respectively.

Status information about the variables currently "in" and "out" is
maintained in integer vectors INS and OUTS containing numbers of
variables currently included and currently excluded.  When no variables
are "in", INS = NULL (INS = 0 means the same thing); when all variables
are "in", OUTS = NULL.  INS must be initialized, usually to run(p),
before backstep() can be used.

backstep(H,E,fh,fe) computes F-to-delete for all variables currently
included in vector INS.  It then updates INS by removing the index of
the variable with the smallest F-to-delete, setting INS to 0 if no
variable is left "in".  OUTS is computed as run(p) when there are no
variables "in" and as run(p)[-INS] otherwise.

The value returned is structure(f:F_to_delete, df:vector(fh,fe-k+1),
ins:INS,outs:OUTS), where F_to_delete is the vector of F-to-delete
statistics and k = length(INS) before deletion.  INS and OUTS are
copies of the updated INS and OUTS vectors.  The F-to-delete statistics
have nominal degrees of freedom fh an fe - k + 1.

The variable that is deleted is the one with the smallest F-to-delete
statistic.  If this is large enough, you may want to reenter the
variable using forstep().  See forstep().

You can initialize things by
  Cmd> manova("y = groups",silent:T) # response matrix y, factor groups

  Cmd> H <- matrix(SS[2,,]); E <- matrix(SS[3,,])

  Cmd> fh <- DF[2]; fe <- DF[3]

  Cmd> INS <- run(nrows(H)) # all variables "in"

Macro forstep() is available for doing a forward step (variable
inclusion).  One difference between backstep() and forstep() is that
backstep() determines the variable to eliminate, and then updates INS
and OUTS; you must tell forstep() which variable to include.  See
forstep() for details.  See also compf() which computes F-to-enter for
variables not in INS.  compf() does not compute F-to-delete.

Both forstep() and compf() are OBSOLETE and are retained only for
backward compatibility.

See also manova(), daentervar(), daremovevar(), dastepsetup(),
dastepstatus() and dasteplook().


Gary Oehlert 2003-01-15