Hi, Could anyone tell me what is wrong:
> length(unique(mydata$myvariable)) [1] 2 > and in t-test: (...) Error in t.test.formula(othervariable ~ myvariable, mydata) : grouping factor must have exactly 2 levels > I re-checked the code and still don't get what is wrong. Moreover, there is some strange behavior: /1 It seems that the error is vulnerable to NA'a, because it affects some variables in data set with NA's and doesn't affect same ones in dataset with NA's removed. /2 It seems it works differently with different ways of using variables in t.test: eg. it hapends here: t.test(x~y, dataset) and does not here: t.test(dataset[['x']]~dataset[['y']]) Does anyone have any ideas? Greetz, Timo ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.