Re: [R] generating a paired t-test with multiple levels of a factor

From: Rolf Turner <r.turner_at_auckland.ac.nz>
Date: Fri, 28 Mar 2008 11:47:26 +1300

On 28/03/2008, at 11:14 AM, Peter Dalgaard wrote:

> Michael A. Miller wrote:
>>>>>>> "James" == James Root <jcroot_at_gmail.com> writes:
>>>>>>>
>>
>>> Is there a way to run all paired t-tests where a paired
>>> t-test is run for every possible combination?
>>
>> Sounds like pairwise.t.test is the sort of thing you are looking
>> for...
>>
>>
> Yes, except that it was designed for independent samples t-tests,
> so you
> need to be careful about not mixing up the pairs. This appears to
> do the
> trick:
>
>> pairwise.t.test(a,col(a),paired=T,pool=F,p.adj="none")
>
> Pairwise comparisons using t tests with non-pooled SD

        <snip>

I would very strongly call this a bug in pairwise.t.test. One should *not* have to specify pool=FALSE if one is doing a paired t-test. For a paired t-test there is actually only *one* sample (the sample of pairwise
differences) and hence only one standard deviation, and hence nothing to pool.

My reading of the code is that if pool.sd is TRUE (the default) then the pairwise.t.test function does two-independent-sample t-tests willy- nilly,
and ignores the ``paired=TRUE'' argument. (It doesn't call upon t.test()
which is the only bit which considers the ``paired'' argument.)

This is a dangerous trap, and should be fixed. (Which is not hard.)

                        cheers,

                                Rolf

######################################################################
Attention:\ This e-mail message is privileged and confid...{{dropped:9}}

R-help_at_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. Received on Thu 27 Mar 2008 - 22:53:25 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 28 Mar 2008 - 00:30:25 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive