Hi Users, This is regarding the paired t-test. I have 5 variables (say) Data$v1,Data$v2,Data$v3,Data$v4,Data$v5 in my data frame. Now, I need to perform a paired t-test on all the possible 10 pairs.How do I set up the pairs table directly and pass those variables in to t-test. Thanks in advance, Pratap --------------------------------- Now you can chat without downloading messenger. Click here to know how. [[alternative HTML version deleted]]
Henrique Dallazuanna
2008-Jan-29 14:15 UTC
[R] Form Pairs of Variables for a paired t-test
Try this: lapply(apply(combn(ncol(x),2), 2, function(y)x[,y]), function(z)t.test(z[,1], z[,2])) On 29/01/2008, nalluri pratap <pratap_stat at yahoo.co.in> wrote:> Hi Users, > > This is regarding the paired t-test. I have 5 variables (say) Data$v1,Data$v2,Data$v3,Data$v4,Data$v5 in my data frame. Now, I need to perform a paired t-test on all the possible 10 pairs.How do I set up the pairs table directly and pass those variables in to t-test. > > Thanks in advance, > > Pratap > > > --------------------------------- > Now you can chat without downloading messenger. Click here to know how. > [[alternative HTML version deleted]] > > ______________________________________________ > 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. >-- Henrique Dallazuanna Curitiba-Paran?-Brasil 25? 25' 40" S 49? 16' 22" O