# Are Kruskal-Test and Dunn-Test the correct way for my data?

Hi,
im doing undergrad research in horticulture and its my first time working with R so please forgive me if I do rookie mistakes.
In my experiment I wanted to evaluate three different beneficial insects and one insecticide in their effects against aphids. So for that reason I infected 50 plant groups of millet (isolated from surroundings by glass tube with cloth) with aphids and then introduced the beneficial insects (1, 2 and 3) and the insecticide (4) for 10 plant groups per treatment (I also did one control-group 0 without any further treatment). I harvested 5 plants for each plant group on two dates and counted the aphids: before the additional treatment and after the additional treatment with beneficial insects and insecticides. Then I subtracted the mean of the control-group at the second date with the second-date-measurements of all 50 plant group individualy to clarify the number of killed aphids per treament. My goal was to show significant differences between the treatments. So I tested for normal distribution of these results (divided by treatment) with an Shapiro-Wilk-Test giving out following test results:
Faktorstufe p_value

1 0 0.194
2 1 0.392
3 2 0.00607
4 3 0.00594
5 4 0.544
These p-values imply that I have to use a non-parametric test, right?
At least I assumed that was the case. So after that I performed a Kruskal-Test:
Kruskal-Wallis rank sum test

• data: Auswirkung der Faktorstufe [n] by Faktorstufe
Kruskal-Wallis chi-squared = 36.806, df = 4, p-value = 1.974e-07

That means there are significant differences between the treatments, right?
Again I assumed it was that way.
Following the Kruskal-Test I did a dunn-test:
Kruskal-Wallis rank sum test

data: x and group
Kruskal-Wallis chi-squared = 29.4043, df = 3, p-value = 0

``````                       Comparison of x by group
(Bonferroni)
``````

Col Mean-|
Row Mean | 1 2 3
---------+---------------------------------
2 | -3.778882
| 0.0005*
|
3 | -4.324190 -0.545307
| 0.0000* 1.0000
|
4 | -0.507039 3.271842 3.817150
| 1.0000 0.0032* 0.0004*

alpha = 0.05
Reject Ho if p <= alpha/2

print(dunn_test)
\$chi2
[1] 29.40431

\$Z
[1] -3.7788830 -4.3241901 -0.5453072 -0.5070400 3.2718430 3.8171501

\$P
[1] 7.876672e-05 7.654662e-06 2.927711e-01 3.060634e-01 5.342445e-04 6.750102e-05

[1] 4.726003e-04 4.592797e-05 1.000000e+00 1.000000e+00 3.205467e-03 4.050061e-04

\$comparisons
[1] "1 - 2" "1 - 3" "2 - 3" "1 - 4" "2 - 4" "3 - 4"

Why is there another kruskal-test-result given out and why does it have such weird results?
I guess because of my ■■■■ty code, but Id like to know the specific reason.
Also can I even use this Dunn-Test to compare the significance of the different treatments (1-4)?
If so, would that classification according to significant differences in lowercase letters be correct?
1 = a
2 = b
3 = b
4 = a

I appreciate any help, thanks in advance guys!

Here is my Code for my actions (killed insecticides per treatment = Auswirkung der Faktorstufe [n]; treatments = Faktorstufe):

View(data)

shapiro_results <- summarise(grouped_data, p_value = shapiro.test(`Auswirkung der Faktorstufe [n]`)\$p.value)

shapiro_results

kruskal_test <- kruskal.test(`Auswirkung der Faktorstufe [n]` ~ Faktorstufe, data = data)

kruskal_test

library(dunn.test)

filtered_data <- subset(data, Faktorstufe %in% c(1, 2, 3, 4))

dunn_test <- dunn.test(filtered_data\$`Auswirkung der Faktorstufe [n]`, g = filtered_data\$Faktorstufe, method = "bonferroni")

print(dunn_test)

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.