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

compf()

Usage:
f <- compf(h,e,fh,fe), REAL symmetric matrices h and e, positive
  integers fh and fe; integer vector INS must be defined



Keywords:
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().

Macro compf() computes Fs-to enter at any stage in stepwise variable
selection in linear discriminant analysis.

You can use compf() after manova() has computed hypothesis and error
matrices H and E, with fh and fe degrees of freedom respectively.

Integer vector INS must be defined, containing the variable numbers
that are "in".  INS = 0 means no variables are in and the Fs-to-enter
are simply the separate ANOVA Fs.  When INS != 0, the Fs-to-enter are
the analysis of covariance Fs for each "out" variable, with the "in"
variables being used as covariates.

compf(H,E,fh,fe) returns structure(f:f_to_enter,df:vector(fh,fe-k),
ins:INS, outs:OUTS), where OUTS is run(p) when INS = 0, is NULL when
INS contains all integers 1, ..., p and is run(p)[-J] otherwise, where
p = ncols(H).  k is the number of variables "in".  The F-to-enter
statistics have nominal degrees of freedom fh and fe - k.

Here is an example of starting forward stepwise variable selection.

  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 <- 0 # no variables in

  Cmd> results <- compf(H,E,fh,fe)

  Cmd> j <- grade(results$f,down:T)[1] # index of largest F

  Cmd> # now continue with forstep(j,H,E,fh,fe)


Gary Oehlert 2003-01-15