s-news
[Top] [All Lists]

Re: PermutationTest2 with Paired Samples

To: s-news@lists.biostat.wustl.edu
Subject: Re: PermutationTest2 with Paired Samples
From: Chris Fiebrich <fiebrich@ou.edu>
Date: Tue, 11 Apr 2006 22:22:26 -0500
In-reply-to: <D29E683F-D4C9-4898-80F9-67F29960E2DE@ou.edu>
References: <D29E683F-D4C9-4898-80F9-67F29960E2DE@ou.edu>
A follow-up on PermutationTest2 for the S-News archive...

Thank you to Tim Hesterberg who identified a problem in my original post. In re-typing my commands for the posting, I inadvertently made my array lengths 3 instead of length 2. Tim's description below explains in a straight-forward way how the PermutationTest2 works.

---------------------------------------------------
I can't reproduce that; when I do
a<-c(1,1,1)
b<-c(10,10,10)
c<-permutationTest2(a,data2=b,statistic=mean,paired=T)

I get:

unique(c$replicates)

[1] -3  9  3 -9

This makes sense; the values correspond to switching 0, 1, 2, or 3 of the
pairs.

I can reproduce your results if I make a and b length 2.

Tim Hesterberg

On Apr 7, 2006, at 8:52 PM, Chris Fiebrich wrote:

I'm using PermutationTest2 to compare two samples. My data is paired, so I am using the "paired=T" option. I wasn't convinced this algorithm was working the way I thought, so I did a simple test:

a<-c(1,1,1)
b<-c(10,10,10)

c<-permutationTest2(a,data2=b,statistic=mean,paired=T)

When I view c$replicates, I see lots of 0s, 9s and -9s. How can it calculate 0 for one of the replicates if it is keeping the pairs together? I would think the only permutations would be: 1-10 and 10-1 (or -9 and 9). Obviously, it's also using 10-10 and 1-1 to get the "0" replicates.

When I use paired=F, I also get replicates that include 0, 9 and -9. I understand that.

Does anyone understand how the paired=T option works?

--------------------------------------------------------------------
This message was distributed by s-news@lists.biostat.wustl.edu.  To
unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with
the BODY of the message:  unsubscribe s-news


<Prev in Thread] Current Thread [Next in Thread>