Skip to content
Prev 336684 / 398513 Next

trouble using sapply to perform multiple t-test

On 02/16/2014 07:16 AM, David Romano wrote:
Hi David,
You have here the old "s" problem. I suspect that you previously ran 
this code on a data frame, not a matrix. Try this:

mm.pvals<-apply(mm,2,
  function(x) {out <- t.test(x[1:15],x[16:25]);out$p.value})

Jim