Re: [R] Bug in t.test?

2010-08-14 Thread Thomas Lumley
On Sat, 14 Aug 2010, ted.hard...@manchester.ac.uk wrote: Hi Thomas, I'm not too sure about your interpretation. Consider: It seems hard to interpret The formula interface is only applicable for the 2-sample tests. any other way Johannes' original query was about differences when there are

Re: [R] Bug in t.test?

2010-08-14 Thread Ted Harding
On 14-Aug-10 16:07:14, Thomas Lumley wrote: On Sat, 14 Aug 2010, ted.hard...@manchester.ac.uk wrote: Hi Thomas, I'm not too sure about your interpretation. Consider: It seems hard to interpret The formula interface is only applicable for the 2-sample tests. any other way Johannes'

[R] Bug in t.test?

2010-08-13 Thread Johannes W. Dietrich
Hello all, due to unexplained differences between statistical results from collaborators and our lab that arose in the same large proteomics dataset we reevaluated the t.test() function. Here, we found a weird behaviour that is also reproducible in the following small test dataset:

Re: [R] Bug in t.test?

2010-08-13 Thread Thomas Lumley
Thanks for the clear example. However, if there is a bug it is only that t.test.formula doesn't throw an error when given the paired=TRUE option. The documentation says The formula interface is only applicable for the 2-sample tests., but there probably should be an explicit check -- I

Re: [R] Bug in t.test?

2010-08-13 Thread Johannes W. Dietrich
Thank you for the fast reply! Although I have read the help page for t.test over and over again I have obviously overlooked the relevant sentence. The workaround that I have planned seems to be the correct use. Thanks again, J. W. D. At 15:31 Uhr -0700 13.08.2010, Thomas Lumley wrote:

Re: [R] Bug in t.test?

2010-08-13 Thread Ted Harding
Hi Thomas, I'm not too sure about your interpretation. Consider: set.seed(54321) X - rnorm(10) ; Y - rnorm(10) XY - c(X,Y); group-c(rep(0,10),rep(1,10)) t.test(X,Y,paired=TRUE) # Paired t-test # data: X and Y # t = -1.5265, df = 9, p-value = 0.1612 # 95 percent

Re: [R] Bug in t.test?

2010-08-13 Thread Peter Dalgaard
(Ted Harding) wrote: Johannes' original query was about differences when there are NAs, corresponding to different settings of na.action. It is perhaps possible that 'na.action=na.pass' and 'na.action=na.exclude' result in different pairings in the case paired=TRUE. However, it seems to me