Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: ttest


From   Nick Cox <[email protected]>
To   "[email protected]" <[email protected]>
Subject   Re: st: ttest
Date   Fri, 23 Aug 2013 16:54:42 +0100

No; the t-test is a rifle, not a shotgun.

You could do something like this

foreach pair in "1, 2" "1, 3" "1, 4" "2, 3" "2, 4" "3, 4" {
    di "pair `pair'"
    ttest math_score if inlist(group, `pair'), by(group)
}

But the major statistical point is that the t-test is mis-applied like
this, or so many would argue. Better to use analysis of variance,
followed by whatever post hoc tests you can justify. That means
-anova- or -oneway-.
Nick
[email protected]


On 23 August 2013 16:47, Seok-Woo Kwon <[email protected]> wrote:
> Hello,
>
> I want to performs t-tests for four groups (group1 vs. group2, group 2
> vs. group3, etc). When I tried "ttest math_score, by(group)",  it
> gives an error message: "more than 2 groups found, only 2 allowed."
>
> Is there a way to do this without writing command for each comparison?
>
> Thanks.
>
> Seok-Woo Kwon
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index