T test across columns
1
0
Entering edit mode
@mark-salsburg-1360
Last seen 9.7 years ago
> ok I created a matrix C with > > A B D A1 B1 D1 > .................................. > ................................. > > the columns contain the gene expression values for tissues... > > I ran the following t.test: > > apply(C, 1, function(x) t.test( x[1:3], x[4,6] )$p.value ) > > which outputs out 16063 pvalues (the number of rows) > > I just want to output 3 pvalues showing if A's column is different from A1 etc.. > > any help would be great.. thank you.. >
• 531 views
ADD COMMENT
0
Entering edit mode
Naomi Altman ★ 6.0k
@naomi-altman-380
Last seen 3.1 years ago
United States
The absolutely simplest thing would be t.test(C[,1],C[,4]) t.test(C[,2],C[,5]) t.test(C[,3],C[,6]) Why spend a lot of time figuring out clever ways to do something, when you only want to do 3 tests? --Naomi p.s. If you need to repeat this on many matrices, C, write a small function with the 3 lines above. At 03:59 PM 7/26/2005, mark salsburg wrote: > > ok I created a matrix C with > > > > A B D A1 B1 D1 > > .................................. > > ................................. > > > > the columns contain the gene expression values for tissues... > > > > I ran the following t.test: > > > > apply(C, 1, function(x) t.test( x[1:3], x[4,6] )$p.value ) > > > > which outputs out 16063 pvalues (the number of rows) > > > > I just want to output 3 pvalues showing if A's column is different from > A1 etc.. > > > > any help would be great.. thank you.. > > > >_______________________________________________ >Bioconductor mailing list >Bioconductor at stat.math.ethz.ch >https://stat.ethz.ch/mailman/listinfo/bioconductor Naomi S. Altman 814-865-3791 (voice) Associate Professor Bioinformatics Consulting Center Dept. of Statistics 814-863-7114 (fax) Penn State University 814-865-1348 (Statistics) University Park, PA 16802-2111
ADD COMMENT
0
Entering edit mode
I do not understand why one wants to compare if the arrays are behaving differently given the fact we assume that majority of the genes are not differentially expressed. Isn't this the assumption behind most preprocessing methods ? But if you want to do this anyway, you might as well use the paired=TRUE option to test if the differences between two arrays are zero. t.test( C[ ,1] , C[ ,2], paired=TRUE ) Regards, Adai On Tue, 2005-07-26 at 16:31 -0400, Naomi Altman wrote: > The absolutely simplest thing would be > > t.test(C[,1],C[,4]) > t.test(C[,2],C[,5]) > t.test(C[,3],C[,6]) > > Why spend a lot of time figuring out clever ways to do something, when you > only want to do 3 tests? > > --Naomi > > p.s. If you need to repeat this on many matrices, C, write a small function > with the 3 lines above. > > At 03:59 PM 7/26/2005, mark salsburg wrote: > > > ok I created a matrix C with > > > > > > A B D A1 B1 D1 > > > .................................. > > > ................................. > > > > > > the columns contain the gene expression values for tissues... > > > > > > I ran the following t.test: > > > > > > apply(C, 1, function(x) t.test( x[1:3], x[4,6] )$p.value ) > > > > > > which outputs out 16063 pvalues (the number of rows) > > > > > > I just want to output 3 pvalues showing if A's column is different from > > A1 etc.. > > > > > > any help would be great.. thank you.. > > > > > > >_______________________________________________ > >Bioconductor mailing list > >Bioconductor at stat.math.ethz.ch > >https://stat.ethz.ch/mailman/listinfo/bioconductor > > Naomi S. Altman 814-865-3791 (voice) > Associate Professor > Bioinformatics Consulting Center > Dept. of Statistics 814-863-7114 (fax) > Penn State University 814-865-1348 (Statistics) > University Park, PA 16802-2111 > > _______________________________________________ > Bioconductor mailing list > Bioconductor at stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor >
ADD REPLY

Login before adding your answer.

Traffic: 403 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6