What's the difference between t.test(x, y) and pairwise.t.test()? Is it just that the former takes two vectors, whereas the latter takes a vector and a factor?
"Jack Tanner" <ihok at hotmail.com> writes:> What's the difference between t.test(x, y) and pairwise.t.test()? Is > it just that the former takes two vectors, whereas the latter takes a > vector and a factor?No. You might try reading the help pages and run the examples there... -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
You wrote:> What's the difference between t.test(x, y) and pairwise.t.test()? Is > it just that the former takes two vectors, whereas the latter takes a > vector and a factor?No. The pairwise.t.test() function (according to the help file) does a multiplicity of t-tests, on more than two samples, adjusting the p-value to compensate for the multiplicity by various methods. IMHO the name of this function is bad, because to me it suggests doing ***paired*** t-tests, which would trip up the naive user, who probably wouldn't notice or would ignore the "t tests with pooled SD" message in the output. As one of the Ripley fortunes says ``It really is hard to anticipate just how silly users can be.'' But why go out of the way to give them a chance to be silly? cheers, Rolf Turner rolf at math.unb.ca
From: Rolf Turner <rolf at math.unb.ca>>No. The pairwise.t.test() function (according to the help >file) does a multiplicity of t-tests, on more than two >samples, adjusting the p-value to compensate for the >multiplicity by various methods.Thank you, Rolf, that's helpful. So pairwise.t.test() is used for comparison of more than two means. I did, indeed, confuse it with t.test(paired=TRUE). But the documentation, which I valiantly tried to make sense of BEFORE asking my stupid question, is not clear enough for this particular idiot. Might I suggest that the documentation be altered? It could use an example (as in, real-life applied statistical problem) of when pairwise.t.test() ought to be used, and why t.test(paired=TRUE) would be inappropriate in that context; it could also use a reference to some published paper, website or some such that explains the rationale and correct procedure for using this test. Thanks again for your clairvoyance.
> From: Duncan Murdoch > > On Thu, 19 Aug 2004 13:42:21 -0300 (ADT), Rolf Turner > <rolf at math.unb.ca> wrote : > > > > >You wrote: > > > >> What's the difference between t.test(x, y) and > pairwise.t.test()? Is > >> it just that the former takes two vectors, whereas the > latter takes a > >> vector and a factor? > > > > No. The pairwise.t.test() function (according to the help > > file) does a multiplicity of t-tests, on more than two > > samples, adjusting the p-value to compensate for the > > multiplicity by various methods. > > > > IMHO the name of this function is bad, because to me it > > suggests doing ***paired*** t-tests, which would trip up the > > naive user, who probably wouldn't notice or would ignore the > > "t tests with pooled SD" message in the output. As one of > > the Ripley fortunes says ``It really is hard to anticipate > > just how silly users can be.'' But why go out of the way to > > give them a chance to be silly? > > And Jack wrote: > > >But the documentation, which I valiantly tried to make sense > of BEFORE > >asking my stupid question, is not clear enough for this > particular idiot. > >Might I suggest that the documentation be altered? It could > use an example > >(as in, real-life applied statistical problem) of when > pairwise.t.test() > >ought to be used, and why t.test(paired=TRUE) would be > inappropriate in that > >context; it could also use a reference to some published > paper, website or > >some such that explains the rationale and correct procedure > for using this > >test. > > I think it's unlikely that we would rename the function; it's been > around a while with its current name so that's a bad idea. On the > other hand, clearer documentation is always a plus: why not submit > some?I guess this is sort of related to the thread on whether R is good for non-statisticians... The help pages in R are sort of like *nix man pages. They give the technical information about the topic, but not necessarily the background. E.g., the man page for `chmod' does not explain file permissions in detail: the user is expected to learn that elsewhere. Perhaps other stat packages do it differently? Does SPSS manuals detail what its t-test procedure does, including which t-test(s) it does and when it's appropriate? That might make it easier on users, but I still think the users should learn the appropriate use of statistical procedures elsewhere... Best, Andy> Duncan Murdoch > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html > >
On Thu, 2004-08-19 at 14:42, Liaw, Andy wrote: > Perhaps other stat packages do it differently? Does SPSS manuals detail > what its t-test procedure does, including which t-test(s) it does and when > it's appropriate? SAS documentation, which Marc pointed out, is much more detailed than SPSS. For completeness, here's SPSS's: username Guest, password Guest (case sensitive): http://support.spss.com/tech/stat/algorithms/algorithms.htm specifically, for the t-test, see http://support.spss.com/tech/stat/Algorithms/12.0/t_test.pdf > That might make it easier on users, but I still think the > users should learn the appropriate use of statistical procedures > elsewhere... Hell, I took my share of stats classes, but it's not like the terminology is always standard, anyway. I much prefer a walked-through example to an abstract explanation like "Calculate pairwise comparisons between group levels with corrections for multiple testing." That seems terse to me. It sorta makes sense only after the fact.
From: Peter Dalgaard <p.dalgaard at biostat.ku.dk>>I didn't suggest looking at the example section of the help pages >without a reason... >It should be pretty clear example(pairwise.t.test) does give output >that pretty clearly indicates that all pairwise comparisons are being >performed.It's only clear if you know what you're looking for. Worse: the pairwise.t.test help page tells me that the value is an "Object of class 'pairwise.htest'". Fine, but help.search("pairwise.htest") produces nothing at all. Sorry, but I'm just a newbie having a tough time interpreting the pairwise.t.test function and its output. P.S. Try googling for "pairwise t-test". Ironically enough, the first hit that correctly explains what pairwise.t.test() does is a SAS help page that's at number 10 for me; the preceding 9 hits confuse paired t-tests and pairwise t-tests. http://support.sas.com/documentation/onlinedoc/v7/whatsnew/insight/sect3.htm