[R] Calculating the t-test for each row

From: Keizer_71 <christophe.lo_at_gmail.com>
Date: Mon, 03 Mar 2008 09:16:37 -0800 (PST)

Hi Everyone,

I need some simple help.

Here are my codes

##########will give me 10000 probesets####################
data.sub = data.matrix[order(variableprobe,decreasing=TRUE),][1:10000,] dim(data.sub)
data_output<-write.table(data.sub, file = "c://data_output.csv", sep = ",", col.names = NA)

When i export to excel, it shows me this. This is just a short version. There are 1000 rows and 140 columns

	Sample_1_D	Sample_1_C	Sample_2_D	Sample_2_C
1	2.425509867	11.34031409	11.46868531	11.75741478


Here is my question: How do create a new row and calculate the t-test so that it will give me the p-value

Here is what i am looking for. The p-value is not correct but just an example. It needs to calculate the entire each row. There are 10000 rows and 140 columns.

thanks
Kei

	Sample_1_D	Sample_1_C	Sample_2_D	Sample_2_C    p-value
1	2.425509867	11.34031409	11.46868531	11.75741478     .00341111

I tried something like this.

t.test(data.sub,mu=0)

I am pretty new to R. I think it is showing me the entire p-value.

-- 
View this message in context: http://www.nabble.com/Calculating-the-t-test-for-each-row-tp15808716p15808716.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help_at_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.
Received on Mon 03 Mar 2008 - 17:26:27 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 03 Mar 2008 - 19:30:25 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive