[R] bootstrapping Levene's test

parsons at uoguelph.ca parsons at uoguelph.ca
Tue Feb 20 04:37:01 CET 2007


Hello all,

I am low down on the learning curve of R but so far I have had little  
trouble using most of the packages. However, recently I have run into  
a wall when it comes to bootstrapping a Levene's test (from the car  
package) and thought you might be able to help. I have not been able  
to find R examples for the "boot" package where the test statistic  
specifically uses a grouping variable (or at least a simple example  
with this condition). I would like to do a  non-parametric bootstrap  
to eventually get 95% confidence intervals using the boot.ci command.  
I have included the coding I have tried on a simple data set below. If  
anyone could provide some help, specifically with regards to how the  
"statistic" arguement should be set up in the boot package, it would  
be greatly appreciated.

> library(boot)
> library(car)
> data<-c(2,45,555,1,77,1,2,1,2,1)
> group<-c(1,1,1,1,1,2,2,2,2,2)
> levene.test(data,group)
Levene's Test for Homogeneity of Variance
       Df F value Pr(>F)
group  1  1.6929 0.2294
        8
> stat<-function(a){levene.test(a,group)}
> trial1<-boot(data,statistic,100)
Error in statistic(data, original, ...) : unused argument(s) ( ...)

Best regards,
Kevin



More information about the R-help mailing list