Re: [R] stats tests on large tables
On 27/08/2008, at 3:52 AM, Richard Emes wrote: I have a large table of data which i can read in using read.table. I then want to conduct various tests on the data. Is there a simple way to conduct these tests by specifying the column headers which relate to different conditions of the experiment? e.g. data1 <- read.table("test.table", header=TRUE) t.test(test~control, data = data1) Which doesn't work and results in the error "Error in t.test.formula(test ~ control, data = data1) : grouping factor must have exactly 2 levels" with(data1,t.test(test ~ control)) # You do not need to specify the method explicitly. cheers, Rolf Turner ## Attention:\ This e-mail message is privileged and confid...{{dropped:9}} __ 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.
Re: [R] stats tests on large tables
Try t.test(data1[,1],data1[,2]) for the first two columns of data1. --- On Tue, 8/26/08, Richard Emes <[EMAIL PROTECTED]> wrote: > From: Richard Emes <[EMAIL PROTECTED]> > Subject: [R] stats tests on large tables > To: r-help@r-project.org > Received: Tuesday, August 26, 2008, 11:52 AM > I have a large table of data which i can read in using > read.table. > I then want to conduct various tests on the data. > > Is there a simple way to conduct these tests by specifying > the column headers which relate to different conditions of > the experiment? > > e.g. data1 <- read.table("test.table", > header=TRUE) > t.test(test~control, data = data1) > > Which doesn't work and results in the error > "Error in t.test.formula(test ~ control, data = data1) > : > grouping factor must have exactly 2 levels" > > > Many Thanks > > Richard > [[alternative HTML version deleted]] > > __ > 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. __ [[elided Yahoo spam]] __ 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.
[R] stats tests on large tables
I have a large table of data which i can read in using read.table. I then want to conduct various tests on the data. Is there a simple way to conduct these tests by specifying the column headers which relate to different conditions of the experiment? e.g. data1 <- read.table("test.table", header=TRUE) t.test(test~control, data = data1) Which doesn't work and results in the error "Error in t.test.formula(test ~ control, data = data1) : grouping factor must have exactly 2 levels" Many Thanks Richard [[alternative HTML version deleted]] __ 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.