-1

I have a matrix, where each row is a sample taken from 100 objects. I have taken 30 samples, which results in a 30 x 100 matrix. I want to use the Fligner and bartlett tests to show the variances are homogeneous. Here's some sample code.

 data <- Matrix[1:30,]
 groups <- factor(rep(letters[1:30], each = 100))
 fligner.test(data,groups)

I've gotten the test to work for test data of smaller size (4x6), but it does not for my own data. I keep getting the following error:

Error in complete.cases(x, g) : not all arguments have the same length
Lcat91
  • 804
  • 3
  • 10
  • 14
  • 1
    Well, if it works for the sample, then the error is not [reproducible](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). How is your data different from the sample? Just a larger size? Then create a larger sample until you reproduce the same error you get with your data. Otherwise we really have no way of knowing what's wrong with your data. – MrFlick Sep 11 '14 at 19:20

1 Answers1

1

It doesn't fail on a test set that matches your description (with or without added NA's)

> dat <- matrix( sample(c(1:30, NA), 3000, rep=TRUE))
>  groups <- factor(rep(letters[1:30], each = 100))
>  fligner.test(dat,groups)

    Fligner-Killeen test of homogeneity of variances

data:  dat and groups
Fligner-Killeen:med chi-squared = 17.7191, df = 25, p-value = 0.8541
IRTFM
  • 258,963
  • 21
  • 364
  • 487