+ Reply to Thread
Results 1 to 9 of 9

Thread: Kruskal Wallis/Dunn's test issue

  1. #1
    Points: 1,301, Level: 20
    Level completed: 1%, Points required for next Level: 99

    Posts
    9
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Kruskal Wallis/Dunn's test issue




    Apologies, I cannot find an answer to this on these boards...

    Anyway, first post...

    I have been asked to look at some stats by a colleague, and have hit a brick wall (at least in my head).

    The lab involves up to 30 germinating seeds under a treatments of nutrient, all other conditions are controlled. The data I have are of biomass of each individual plant. There are 9 treatments/concentrations under test, and a total of 216 measurements (some did not germinate).

    My colleague usually ploughs into ANOVA at this point. I have suggested he tests for heteroscedasticity. He has, and concluded that ANOVA was not appropriate. I confirmed this by plotting histograms and a QQ Normal plot. So, we move to Kruskal-Wallis.

    The K-W test shows significance at our alpha (0.05). Due to there being unequal sample sizes, I then chose a Dunn's Test to compare groups to look for where this difference lies, using the Bonferroni adjustment for multiple comparisons.

    The test suggests that no one group is significantly different from another.

    Am I just looking at this issue incorrectly? It makes little sense that when I test the whole dataset there is a difference between groups, yet when I look for this difference it isn't there! Is this just an issue of one test looking at the dataset as a whole , and other looking at it in a piecemeal fashion?

    Must confess, I am a bit stumped. I just need a simple-to-understand explanation which I can relay back to my colleague and, most importantly, the students - they're freaked out by K-W and having to do stuff 'long hand' on Excel as it is....this is causing much brain ache.

    Any thoughts gladly received, and thanks, in advance...

  2. #2
    TS Contributor
    Points: 20,451, Level: 90
    Level completed: 21%, Points required for next Level: 399
    Awards:
    Downloads
    gianmarco's Avatar
    Location
    Italy
    Posts
    989
    Thanks
    137
    Thanked 190 Times in 139 Posts

    Re: Kruskal Wallis/Dunn's test issue

    Hi,
    geneally, the post-hoc test should help you to spot where the significant difference is.
    I do not know why in your case it does not work.
    What tool did you use? Did you do the right calculations?
    May be that a look at your data could help us to see what's going on.

    Gm
    Outside of a dog, a book is man's best friend. Inside of a dog it's too dark to read -Groucho Marx-

  3. #3
    Points: 1,301, Level: 20
    Level completed: 1%, Points required for next Level: 99

    Posts
    9
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Re: Kruskal Wallis/Dunn's test issue

    Hi Gianmarco!

    I have used a combination of Excel, a book by Wheater & Cook (using Statistics to Understand the Environment) and advice from elsewhere on the 'net.

    I have checked, and redone, all the calculations, and even done what I can in 'R'....I still get the same issue (the K-W term in 'R' was slightly different, but I do not think it accounts for ties?)

    Either I cannot see the wood for the trees, or I have made some fundamental assumption that is wrong!

    I have attached an Excel sheet of data and workings.

    Thanks

    Paul
    Attached Files

  4. #4
    Point Mass at Zero
    Points: 7,788, Level: 59
    Level completed: 19%, Points required for next Level: 162
    ledzep's Avatar
    Location
    Berks,UK
    Posts
    650
    Thanks
    174
    Thanked 133 Times in 131 Posts

    Re: Kruskal Wallis/Dunn's test issue

    Very interesting.
    In addition to GM:

    It seems that normality is not necessarily a big problem here. I quickly checked your Q-Q plot, they seemed alright but there were few blatant outlier values.



    Sorry for the dim graph. Three observations : #5, #157 and #70 have standardised residuals >2, which are the outliers in residuals plot.
    These corresponds to:

    0.219 for treatment condition 0
    0.884 for treatment condition 80
    and
    0.394 for treatment condition 600

    If you check your data: these values also happen to be the largest values for each of these groups, somehow a lot larger than rest of the measurements for their groups. Can you check if there is any error or is the data real?

    What is your objective here?
    1. To show if there is any treatment effect? and to make a pairwise comparisons? What is your reference category: Condition 0?

    2. Are you not interested if the germinating probability differs between the groups? May be the seeds that didn't germinate were more from a particular group rather than the other?

    Kruskall-wallis should work well. But I don't see any reasons why regular linear model won't answer your question.
    Oh Thou Perelman! Poincare's was for you and Riemann's is for me.

  5. The Following User Says Thank You to ledzep For This Useful Post:

    pnwright (12-01-2012)

  6. #5
    Points: 1,301, Level: 20
    Level completed: 1%, Points required for next Level: 99

    Posts
    9
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Re: Kruskal Wallis/Dunn's test issue

    Thanks for that....

    Yes, I have questioned whether these data or real or mis-entered. They certainly throw the variance out - hence, I presume, the need for KW.

    As far as I know, the aim is to investigate the effect of nutrients on germinating and supporting plant growth (there is a current test underway using phosphate....and I think follow up labs investigate both data sets to look at comparative effects of N&P)

    So, I know why the data are non-normal, and why I should use a non-parametric method (data transformation helped a little, but not enough) - I suppose my fundamental issue still is why, when I test the group en mass, there is a significant difference between groups, and why I cannot find it when I test pairwise.

    Actually, you issue of reference condition (0) makes me thing....would Dunnett be more appropriate here?...I always thought this just compares to a 'control'?

  7. #6
    TS Contributor
    Points: 20,451, Level: 90
    Level completed: 21%, Points required for next Level: 399
    Awards:
    Downloads
    gianmarco's Avatar
    Location
    Italy
    Posts
    989
    Thanks
    137
    Thanked 190 Times in 139 Posts

    Re: Kruskal Wallis/Dunn's test issue

    Hi,
    as for the KW test and Dunn posthoc test, the problem is that the KW test is not significant at alpha 0.05. In fact, the H statistic is 10.877 with 5 df, with a p value = 0.054. It seems to be due to this reasons that Dunn test does not spot any difference between samples.

    If you set the alpha level to 0.1 (this will surely open a discussion about the "holy" 0.05 threshold; but I do not want to enter this issue), the Dunn test spots a significant difference between 40 vs 80, and 150 vs 80.

    See the attached documents, after the analysis performed with a Minitab macro.

    Hope this helps
    Regards
    Gm
    Attached Thumbnails Attached Thumbnails Click image for larger version

Name:	KW-Dunn.jpg‎
Views:	124
Size:	58.9 KB
ID:	2872  
    Attached Files
    Outside of a dog, a book is man's best friend. Inside of a dog it's too dark to read -Groucho Marx-

  8. The Following User Says Thank You to gianmarco For This Useful Post:

    pnwright (12-01-2012)

  9. #7
    Points: 1,301, Level: 20
    Level completed: 1%, Points required for next Level: 99

    Posts
    9
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Re: Kruskal Wallis/Dunn's test issue

    Gianmarco

    That's great....and it seems to throw up something interesting....I am in a but of a rush, so will work through this tomorrow. However, if you use the formulae given at the bottom of this page I get two different answers!

    I used the very last formula, and get 16.875 (sig at p<0.05). Minitab seems to use the first formula for H, which is not significant (I get the same answer as you by this method).

    Is this due to the large value of N?

    Thanks

    Paul

  10. #8
    TS Contributor
    Points: 20,451, Level: 90
    Level completed: 21%, Points required for next Level: 399
    Awards:
    Downloads
    gianmarco's Avatar
    Location
    Italy
    Posts
    989
    Thanks
    137
    Thanked 190 Times in 139 Posts

    Re: Kruskal Wallis/Dunn's test issue

    Hi,
    I think that regardless of the formula used (by the way, the last one used in the VassarStat site is "An Alternative Formula for the Calculation of H") the result should be the same....
    May be you made some mistake in the calculation and/or you did not take ties into account....
    In any instance, while your effort in making calculations by yourself is laudable, I suggest to use some software to do your tests.
    Obviously, you can use R (as many will surely suggest in this Forum). But, if you are not so advanced in your expertise, you could try other "point-and-click" softwares (commercial). If you want to stay with a free, useful, spreadsheet-like tool, which performs a tremendous array of stat analyses, I suggest the use of PAST.


    Best Regards
    Gm
    Outside of a dog, a book is man's best friend. Inside of a dog it's too dark to read -Groucho Marx-

  11. #9
    Points: 1,301, Level: 20
    Level completed: 1%, Points required for next Level: 99

    Posts
    9
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Re: Kruskal Wallis/Dunn's test issue


    FOUND IT.....

    OK, I blame my book! Just gone back to to the VassarStat site, and realised that the final part of the formula reads "-3(N+1)". In my calculation it is "-3(N-1)"

    Just consulted my book (1st edition), and I have transcribed it correctly, but they have printed the "-3(N-1)" version in place....

    This all works now, and explains the major discrepancies.

    With apologies for denseness....

+ Reply to Thread

           




Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts






Advertise on Talk Stats