[R] Calculating the t-test for each row

2008-03-03 Thread Keizer_71
Hi Everyone, I need some simple help. Here are my codes ##will give me 1 probesets data.sub = data.matrix[order(variableprobe,decreasing=TRUE),][1:1,] dim(data.sub) data_output-write.table(data.sub, file = c://data_output.csv, sep = ,, col.names = NA) When

Re: [R] Calculating the t-test for each row

2008-03-03 Thread Henrique Dallazuanna
You can try this: cbind(data.sub, p.value=apply(data.sub, 1, function(x)t.test(x)$p.value)) On 03/03/2008, Keizer_71 [EMAIL PROTECTED] wrote: Hi Everyone, I need some simple help. Here are my codes ##will give me 1 probesets data.sub =

Re: [R] Calculating the t-test for each row

2008-03-03 Thread John Kane
If I understand you correctly what you want to do is do t-test (mu=0) for each column of the data. Treating the data as a data.frame rather than a matrix you can do something like this and then pick out the p-values but with 140 t-tests I don't know what you'll get in terms of anything

Re: [R] Calculating the t-test for each row

2008-03-03 Thread Benilton Carvalho
apparently you want to check the genefilter package... it defines functions like: rowttests colttests rowFtests colFtests rowVars rowSds moreover, a quick look at Biobase is recommended... that would save you lots of time as you wouldn't have to reinvent the wheel. b On Mar 3, 2008, at

Re: [R] Calculating the t-test for each row

2008-03-03 Thread James W. MacDonald
Using t.test() in this case will likely be very slow. A faster alternative would be to use rowttests() from the genefilter package of Bioconductor. Best, Jim Henrique Dallazuanna wrote: You can try this: cbind(data.sub, p.value=apply(data.sub, 1, function(x)t.test(x)$p.value)) On