Announcement

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

  • Differences in Friedman test statistic when using emh, friedman, skilsmack, and fried

    Dear Statalist,

    I'm interested in conducting a Friedman test. I've used different commands, which yield different test statistics. In particular, the commands "friedman" and "skilmack" (my sample has no missing values so the Skillings-Mack test is equivalent to the Friedman test) agree with each other and give a test statistic of 47.201. In contrast, "fried" and "emh" yield a test statistic of 57.1595. The program "fried" was provided in the following post: https://www.stata.com/statalist/arch.../msg00687.html. The same post mentions that "a look at the code in friedman.ado suggests that there is no correction for ties." Is this the source of discrepancy? If it is, can I still rely on the "skilmack" command when I have missing data and have to use the Skillings-Mack test rather than the Friedman test?

    You can find the commands I use and the outputs below.

    Many thanks,
    Ufuk

    Code:
    emh cold_hot cond, strata(id) anova tr(rank)
    Extended Mantel-Haenszel (Cochran-Mantel-Haenszel) Stratified Test of Association

    ANOVA (Row Mean Scores) Statistic:
    Q (3) = 57.1595, P = 0.0000
    Transformation: Ranks

    Code:
    skilmack cold_hot, id(id) repeated(cond)
    Weighted Sum of Centered Ranks

    cond | N WSumCRank SE WSum/SE
    -------+-------------------------------------
    1 | 353 -96.05 32.54 -2.95
    2 | 353 -94.50 32.54 -2.90
    3 | 353 -27.89 32.54 -0.86
    4 | 353 218.44 32.54 6.71
    ---------------------------------------------
    Total 0

    Skillings Mack = 47.201
    P-value (No ties) = 0.0000
    N.B. As P-value <0.02, it is likely to be conservative (unless n large). Consider obtaining a p-value from
    a simulated null distribution of SM - see options.

    Ties exist. Above SEs and P-value approximate, if not too many ties;
    1412 rows of [id, cold_hot]; 1009 different combinations; n(id) = 353

    Consider using the p-value below, (which is found from a simulated
    conditional null distribution of SM - see options -
    simulating ...........)

    Empirical P-value (Ties) ~ 0.0000

    Code:
    reshape wide cold_hot, i(cond) j(id)
    friedman cold_hot*
    Friedman = 47.2011
    Kendall = 0.0446
    P-value = 0.0000

  • #2
    Further to my original message, I copied the dataset into Excel and used the XLSTAT add in to compute the Friedman test statistics. The result I obtain matches those given by "emh" and "fried".

    Comment

    Working...
    X