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

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

Hi,
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.

 dim(X)
[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.

Marcus

>>> "Jagarlamudi, Choudary" <choudary.jagar@swosu.edu> 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]]



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

The contents of this e-mail are privileged and/or confidenti...{{dropped}}



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html 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