Re: [R] multiple paired t-tests without loops

2010-04-28 Thread Daniel Malter
Hi Matt, see the example below. It took me a while to figure it out. I suggest you carefully examine the example step by step. It computes t-values for dataset with 3 variables and 8 unique combinations of two binning variables. The code should extend easily to larger datasets. Also, it uses the e

Re: [R] multiple paired t-tests without loops

2010-04-28 Thread Greg Snow
help@r-project.org > Subject: Re: [R] multiple paired t-tests without loops > > Yes, I suspect that I will end up using a sampling approach, but I'd > like to use an exact test if it's at all feasible. > > Here are two samples of data from 3 subjects: > Sample

Re: [R] multiple paired t-tests without loops

2010-04-27 Thread Tal Galili
Hi Matthew, First - I fully support Greg Snow proposition. Sampling is the way to go here. But besides that: 1) Try to avoid using data.frames as much as possible (use vectors and matrixes instead - they are usually faster) 2) Since you are running on a loop, you can try running it in parallel (

Re: [R] multiple paired t-tests without loops

2010-04-26 Thread Matthew Finkbeiner
Yes, I suspect that I will end up using a sampling approach, but I'd like to use an exact test if it's at all feasible. Here are two samples of data from 3 subjects: Sample SubjC1 C2 44 1 0.0093 0.0077 44 2 0.0089 0.0069 44 3 0.051 0.0432 44 4

Re: [R] multiple paired t-tests without loops

2010-04-26 Thread Greg Snow
801.408.8111 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Matthew Finkbeiner > Sent: Saturday, April 24, 2010 4:58 AM > To: r-help@r-project.org > Subject: [R] multiple paired t-tests without loops >

[R] multiple paired t-tests without loops

2010-04-24 Thread Matthew Finkbeiner
I am new to R and I suspect my problem is easily solved, but I haven't been able to figure it out without using loops. I am trying to implement Blair & Karniski's (1993) permutation test. I've included a sample data frame below. This data frame represents the conditional means (C1, C2) for 3

[R] multiple paired t-tests without loops

2010-04-24 Thread Matthew Finkbeiner
I am new to R and I suspect my problem is easily solved, but I haven't been able to figure it out without using loops. I am trying to implement Blair & Karniski's (1993) permutation test. I've included a sample data frame below. This data frame represents the conditional means (C1, C2) for 3

Re: [R] multiple paired t-tests

2009-03-25 Thread Dan Kortschak
I'm not really looking for a needle in a haystack, there are a small number of the 60 tests (about 20) that are likely to concord with other experiments I have, and in a particular pattern. Since I already have the data in tables for graphic depiction, I was hoping to have a reasonably easy way to

Re: [R] multiple paired t-tests

2009-03-25 Thread Eik Vettorazzi
so you want to find a needle in a haystack, not an easy task. You should account for multiple tests, which is as far as I can see not done in the code yet - or you have to accept that you find a bunch of hay which accidentally looks pretty much like a needle. There are some solutions in doing su

Re: [R] multiple paired t-tests

2009-03-25 Thread Dan Kortschak
Perfect. In conjunction with Jorge's contrib that works a treat. Thanks. Dan On Tue, 2009-03-24 at 19:00 -0400, David Winsemius wrote: > ?try > ?tryCatch __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read t

Re: [R] multiple paired t-tests

2009-03-24 Thread Dan Kortschak
That is a valid point, the number of samples I expect to be different is actually quite small, but it is supportable (or otherwise) by other experimental data. Unfortunately the question I really want answered is pretty much covered by doing this. thanks Dan On 25/03/2009, at 10:25 AM,

Re: [R] multiple paired t-tests

2009-03-24 Thread Eik Vettorazzi
.. and you will end up - in your example- with 60 t-statistics and p-values (so you do bonforroni adjustment or something like that)?! Sometimes the question for "How do I ..." should be read as "What is the question I *really* want to be answered ...". You may consider doing some more sophis

Re: [R] multiple paired t-tests

2009-03-24 Thread David Winsemius
?try ?tryCatch On Mar 24, 2009, at 6:04 PM, Dan Kortschak wrote: Hi Jorge, That is exactly what I wanted - I should have given a reasonable number of observations (my set has *almost* all paired observations, so it will still break with that approach unless I manicure the data set). Is there

Re: [R] multiple paired t-tests

2009-03-24 Thread Dan Kortschak
Hi Jorge, That is exactly what I wanted - I should have given a reasonable number of observations (my set has *almost* all paired observations, so it will still break with that approach unless I manicure the data set). Is there a way to fail nicely on a single one of the tests without the

[R] multiple paired t-tests

2009-03-24 Thread Dan Kortschak
Hi R users, I have a very large data set that has two conditioning variables for the test I want to perform. A toy set can be simulated: type<-sample(1:3,100,replace=TRUE) class<-sample(1:20,100,replace=TRUE) value<-rnorm(100) data<-cbind(type,class,value) (though type and class are alphanum)