Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Question on how to obtain letter of significance after anova (preferably Tukey HSD)?

    Hi All,

    I have an anova, where the sex was significantly different (P<0.05), and I run Tukey hsd test. However, I cannot obtain the letters indicating the significant differences among the groups. I have emailed the UCLA Stats Consulting Service, but they are not aware of this kind of code in Stata. Can anyone help me with that? Thank you very much.

    by Visit_f: anova FS0p Sex_f Litter_mat

    ---------------------------------------------------------------------------------------------------------
    -> Visit_f = 0

    Number of obs = 18 R-squared = 0.4970
    Root MSE = .275211 Adj R-squared = 0.3422

    Source | Partial SS df MS F Prob>F
    -----------+----------------------------------------------------
    Model | .97281304 4 .24320326 3.21 0.0486
    |
    Sex_f | .79861759 1 .79861759 10.54 0.0064
    Litter_mat | .12017304 3 .04005768 0.53 0.6703
    |
    Residual | .98463696 13 .0757413
    -----------+----------------------------------------------------
    Total | 1.95745 17 .11514412




  • #2
    Originally posted by Gabriella Furo View Post
    sex was significantly different (P<0.05), and I run Tukey hsd test. However, I cannot obtain the letters indicating the significant differences among the groups.
    But there are only two groups . . .

    You can't figure out what's going on from the output of the postestimation command?

    .ÿ
    .ÿversionÿ16.1

    .ÿ
    .ÿclearÿ*

    .ÿ
    .ÿsetÿseedÿ`=strreverse("1553264")'

    .ÿ
    .ÿquietlyÿsysuseÿauto

    .ÿ
    .ÿsummarizeÿrep78,ÿmeanonly

    .ÿquietlyÿreplaceÿrep78ÿ=ÿruniformint(r(min),ÿr(max))ÿifÿmissing(rep78)

    .ÿ
    .ÿanovaÿgear_ratioÿi.rep78

    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿNumberÿofÿobsÿ=ÿÿÿÿÿÿÿÿÿ74ÿÿÿÿR-squaredÿÿÿÿÿ=ÿÿ0.2048
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿRootÿMSEÿÿÿÿÿÿ=ÿÿÿÿ.418511ÿÿÿÿAdjÿR-squaredÿ=ÿÿ0.1587

    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿSourceÿ|ÿPartialÿSSÿÿÿÿÿÿÿÿÿdfÿÿÿÿÿÿÿÿÿMSÿÿÿÿÿÿÿÿFÿÿÿÿProb>F
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿ-----------+----------------------------------------------------
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿModelÿ|ÿÿ3.1129788ÿÿÿÿÿÿÿÿÿÿ4ÿÿÿÿ.7782447ÿÿÿÿÿÿ4.44ÿÿ0.0030
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ|
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿrep78ÿ|ÿÿ3.1129788ÿÿÿÿÿÿÿÿÿÿ4ÿÿÿÿ.7782447ÿÿÿÿÿÿ4.44ÿÿ0.0030
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ|
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿResidualÿ|ÿÿ12.085469ÿÿÿÿÿÿÿÿÿ69ÿÿÿ.17515172ÿÿ
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿ-----------+----------------------------------------------------
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿTotalÿ|ÿÿ15.198448ÿÿÿÿÿÿÿÿÿ73ÿÿÿ.20819791ÿÿ

    .ÿ
    .ÿpwcompareÿrep78,ÿmcompare(tukey)ÿpveffects

    Pairwiseÿcomparisonsÿofÿmarginalÿlinearÿpredictions

    Marginsÿÿÿÿÿÿ:ÿasbalanced

    ---------------------------
    ÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿÿÿÿNumberÿof
    ÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿÿComparisons
    -------------+-------------
    ÿÿÿÿÿÿÿrep78ÿ|ÿÿÿÿÿÿÿÿÿÿÿ10
    ---------------------------

    -----------------------------------------------------
    ÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿTukey
    ÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿÿÿContrastÿÿÿStd.ÿErr.ÿÿÿÿÿÿtÿÿÿÿP>|t|
    -------------+---------------------------------------
    ÿÿÿÿÿÿÿrep78ÿ|
    ÿÿÿÿÿ2ÿvsÿ1ÿÿ|ÿÿ-.4008333ÿÿÿÿ.251494ÿÿÿÿ-1.59ÿÿÿ0.506
    ÿÿÿÿÿ3ÿvsÿ1ÿÿ|ÿÿÿ-.229758ÿÿÿ.2223465ÿÿÿÿ-1.03ÿÿÿ0.839
    ÿÿÿÿÿ4ÿvsÿ1ÿÿ|ÿÿÿ.0686112ÿÿÿ.2313408ÿÿÿÿÿ0.30ÿÿÿ0.998
    ÿÿÿÿÿ5ÿvsÿ1ÿÿ|ÿÿÿÿÿÿÿÿ.22ÿÿÿ.2416276ÿÿÿÿÿ0.91ÿÿÿ0.892
    ÿÿÿÿÿ3ÿvsÿ2ÿÿ|ÿÿÿ.1710753ÿÿÿ.1584656ÿÿÿÿÿ1.08ÿÿÿ0.816
    ÿÿÿÿÿ4ÿvsÿ2ÿÿ|ÿÿÿ.4694444ÿÿÿ.1708565ÿÿÿÿÿ2.75ÿÿÿ0.057
    ÿÿÿÿÿ5ÿvsÿ2ÿÿ|ÿÿÿ.6208333ÿÿÿ.1845461ÿÿÿÿÿ3.36ÿÿÿ0.011
    ÿÿÿÿÿ4ÿvsÿ3ÿÿ|ÿÿÿ.2983692ÿÿÿÿ.124019ÿÿÿÿÿ2.41ÿÿÿ0.126
    ÿÿÿÿÿ5ÿvsÿ3ÿÿ|ÿÿÿÿ.449758ÿÿÿ.1422886ÿÿÿÿÿ3.16ÿÿÿ0.019
    ÿÿÿÿÿ5ÿvsÿ4ÿÿ|ÿÿÿ.1513889ÿÿÿÿÿ.15597ÿÿÿÿÿ0.97ÿÿÿ0.867
    -----------------------------------------------------

    .ÿ
    .ÿexit

    endÿofÿdo-file


    .


    It seems so 70s, the letters and all, but you should be able to manually construct a letter diagram from the individual contrasts shown in the output.

    Comment


    • #3
      Hi Joseph,

      Thank you very much for answering my question. Of course, in my example, I can figure out the sex, as we have 2 options. I have a much larger dataset for 18 groups, so I would appreciate an instant answer from Stata. I used to use R, and Statistix, and it was not a problem to obtain the letters indicating the differences among the variables.

      Your example is a better one. It shows, that there is a significant difference between 2 vs 5, and 3 vs 5 (P<0.05). How would you obtain the letters to indicate the differences between the groups? Can it be a, b, c, or maybe a, ab, b describing the differences for groups 2, 3 and 5, respectively?

      Thank you very much.

      Comment


      • #4
        Originally posted by Gabriella Furo View Post
        I have a much larger dataset for 18 groups
        That seems like a lot for a focused research question. You might have bigger fish to fry than how to present Tukey HSD comparisons.

        How would you obtain the letters to indicate the differences between the groups? Can it be a, b, c, or maybe a, ab, b describing the differences for groups 2, 3 and 5, respectively?
        Conventionally, for a so-called compact letter display, the groups that share a common letter form a set of groups whose means are not statistically significantly different from one another. For balanced datasets, you can do that by ordering the means and assigning letters. For your case, with 18 groups, it might be clearer to indicate beside each group the group(s) where a statistically significant difference was observed from that group.

        Comment

        Working...
        X