Hi Gang, Perhaps this post might be useful in this case. Please take a special lookat Gábor Csárdi's reply.
http://www.nabble.com/apply,-t-test-and-p-values-to20012292.html#a20012292 HTH, Jorge On Tue, Jan 6, 2009 at 1:10 PM, Gang Chen <[email protected]> wrote: > Thanks a lot for the quick help! > > mapply() seems promising. However, mapply(t.test, myData1, myData2) > would not work, so how can I specify the margin in mapply() which > function t.test() will be applied over? For example, I specify the 2nd > dimension (column) in apply(myData1, 2, t.test) to run one-sample > t-test. Is there a way I can achieve the same with mapply()? > > Thanks again, > Gang > > > On Tue, Jan 6, 2009 at 12:34 PM, Henrique Dallazuanna <[email protected]> > wrote: > > I think that you can use mapply for this. > > > > On Tue, Jan 6, 2009 at 3:24 PM, Gang Chen <[email protected]> wrote: > >> > >> I can run one-sample t-test on an array, for example a matrix myData1, > >> with the following > >> > >> apply(myData1, 2, t.test) > >> > >> Is there a similar fashion using apply() or something else to run > >> 2-sample t-test with datasets from two groups, myData1 and myData2, > >> without looping? > >> > >> TIA, > >> Gang > > ______________________________________________ > [email protected] 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. > [[alternative HTML version deleted]]
______________________________________________ [email protected] 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.

