[R] Bootstraping with MANOVA

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue Jun 10 23:13:20 CEST 2003


It means what it says!  The residuals from the manova fit have a 
degenerate distribution: that's a problem with bootstrapping.

I don't think you've done this correctly: assuming you are intending to 
bootstrap residuals you seem to have resampled the independent variable 
and not added back the mean contribution.  Compare the examples in MASS4 
or Davison & Hinkley.

Also, do remember you need to show the bootstrap is valid in each 
scenario: it is not universally valid and this one looks dodgy to me.

On Wed, 11 Jun 2003, Ko-Kang Kevin Wang wrote:

> Hi,
> 
> Does anyone know what the error message mean?
> > Boot2.Pillai <- function(x, ind) {
> +   x <- as.matrix(x[,2:ncol(x)])
> +   boot.x <- as.factor(x[ind, 1])
> +   boot.man <- manova(x ~ boot.x)
> +   summary(manova(boot.man))[[4]][[3]]
> + }
> > 
> > man.res <- manova(as.matrix(pl.nosite) ~
> +                   as.factor(plankton.new[,1]))$residuals
> > boot2.plank <- cbind(plankton.new[, 1], man.res)
> > boot.sep <- boot(boot2.plank, Boot2.Pillai, R = 1000,
> +                  strata = plankton.new[, 1])
> Error in summary.manova(manova(boot.man)) : 
>         residuals have rank 5 < 6
> Execution halted
> 
> 
> A sample of plankton.new is as follows:
> > plankton.new[sample(dim(plankton.new)[1], 5, replace = TRUE),]
>    site  ACARTIA   EUTERP   GLADIO   TEMORA  FAVELLA OIKOPL
> 15    M 2.326336 3.168792 0.000000 0.000000 3.854852      0
> 47    W 2.699838 2.276462 1.799341 2.495544 2.274158      0
> 33    W 2.274158 3.301247 0.000000 0.000000 0.000000      0
> 8     M 2.875640 2.796574 0.000000 0.000000 3.051538      0
> 4     M 2.100371 2.796574 0.000000 0.000000 2.100371      0
> 
> 
> pl.nosite is a data frame like plankton.new, but without the site column.
> 
> 

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list