Hi gang,
I measured a temporal variable (dur) of several individuals (batid) in 4 different situations (g_type). I dont have data for each individual in each situation. Now I would like to test if the temporal variable is shorter or longer depending on the situation. I wanted to do a Kruscal Wallis test, because the data is not normally distributed. But since its similar individuals in each situation I think I need to correct for that somehow. What would be the best way to do so? Or can I just do the Kruscal Wallis test? (Results of this below) Would be amazing if I can get help here Thanks for you patience!
nuber g_type batid dur
1 lb 1 1.063353
2 lb 2 1.020000
3 lb 4 1.325775
4 lb 5 1.170000
5 lb 7 1.100000
6 lb 8 1.426637
7 lb 9 1.035059
8 mp 1 3.322441
9 mp 2 3.381790
10 mp 3 2.450036
11 mp 4 1.530039
12 mp 5 4.680098
13 mp 6 2.403818
14 mp 7 3.462617
15 mp 8 2.154150
16 mp 9 3.218999
17 mp 10 4.850000
18 mp 11 2.371661
19 mp 12 1.130000
20 mp 13 1.670117
21 tg 1 1.560286
22 tg 2 1.468229
23 tg 3 1.560000
24 tg 4 NA
25 tg 5 1.525176
26 tg 6 1.471191
27 tg 7 1.476790
28 tg 8 1.610000
29 tg 9 1.440869
kruskal.test(df3$dur ~ df3$g_type)
dunnTest(df3$dur ~ df3$g_type,
method="bh")
ยดยดยด
Kruskal-Wallis rank sum test
data: df3$dur by df3$g_type
Kruskal-Wallis chi-squared = 18.731, df = 2, p-value = 8.561e-05
Comparison Z P.unadj P.adj
1 lb - mp -4.277181 1.892751e-05 5.678253e-05
2 lb - tg -1.983965 4.725969e-02 4.725969e-02
3 mp - tg 2.177267 2.946063e-02 4.419094e-02