RE: [R] How to extract x rows to get x pvalues using t.test

From: Marcus Davy <>
Date: Thu 17 Mar 2005 - 07:53:15 EST

if a striped down version of t.test is required for speed, before implementing a rewrite I would check out the multtest Bioconductor package.

It takes a fraction of a second to do 56000 t-tests on a 2.4 Ghz PIV.

[1] 56000 4

pcols <- 4
replicates <- rep(0:1, each=2)

unix.time({tscores <- mt.teststat(X, classlabel=replicates, test="t.equalvar")

        dfs <- pcols - 2
        pvalues <- 2*(1-pt(abs(tscores), df=dfs))})
[1] 0.21 0.05 0.26 0.00 0.00

> length(pvalues)

[1] 56000

Check out ?mt.teststat and its test argument options.


>>> "Jagarlamudi, Choudary" <> 17/03/2005 7:16:13 a.m. >>> Thanks to everyone who posted on this topic. I tried apply() as Ramasamy had suggested and it took 40 seconds on my machine. The for loop however took over 4 minutes and i gave up. I am going to strip the t.test function and write it as suggested by Andy. Hope that will be the quickest.  

Once again thank you for all who have posted on this.  

Choudary Jagarlamudi
Instructor Computer Science
Southwestern Oklahoma State University
STF 254
100 campus Drive
Weatherford OK 73096
Tel 580-774-7136

        [[alternative HTML version deleted]] mailing list PLEASE do read the posting guide!

The contents of this e-mail are privileged and/or confidenti...{{dropped}} mailing list PLEASE do read the posting guide! Received on Thu Mar 17 07:57:37 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:30:50 EST