This is a test version of Biostars. For the public version, visit https://www.biostars.org.
t-test for microarray analysis in R

HI, I have a code , I dont know if the code exactly falls for paired t test or not?

logX.cl <- c(0, 0, 1,1)
ttest = function(x) {
  tt = t.test(x[logX.cl == 0], x[logX.cl == 1])
  return(c(tt$statistic, tt$p.value))
}
r

No, look here: https://stat.ethz.ch/R-manual/R-devel/library/stats/html/t.test.html

t.test(..., ..., paired=TRUE)

In this example, though, you are literally just comparing 2 values versus 2 values - makes no sense (?). Whatever is in the object x, you will only be taking index 1-4 from it.

Can you please explain what you are aiming to do? For microarray data, the common (and I would say standardised, at this stage) method to use is limma: https://bioconductor.org/packages/release/bioc/html/limma.html

0 answers

No answers yet.

Log in to answer this question.