r - Mann-Whitney U test with p-value -


i mann-whitney u test comparing columns 2,3,4 against columns 5, 6 , 7 , p-value each row assess significance.

  type  sp1 sp2 sp3 sp4 sp5 sp6       gh1   4   4   4   2   2   0   gh2   7   7   7   4   8   4   gh3   13  17  16  10  16  10   gh5   9   10  10  11  10  6   gh6   0   0   0   0   0   0   gh7   1   1   1   1   1   0   gh9   0   0   1   0   1   0   gh10  3   1   1   0   2   0   gh11  1   1   0   2   1   1   gh12  3   1   2   3   1   2   gh13  11  13  12  12  13  12   gh15  2   1   2   2   1   3   gh16  17  16  16  14  11  13   gh17  7   7   7   8   6   7   gh18  7   9   9   9   9   5   gh20  2   2   2   2   1   2   gh22  0   0   0   0   0   0   gh23  2   1   2   1   0   3   gh24  0   0   0   1   0   0   gh25  1   1   1   1   0   0   gh26  0   0   0   0   0   0 

i did see tutorials comparing 2 sets of values

 wilcox.test(a,b, correct=false) 

but not sure how 2 groups , p value each row know if of types significant across 2 groups. in end

  type  sp1 sp2 sp3 sp4 sp5 sp6 p-value   gh1   4   4   4   2   2   0   0.4   gh2   7   7   7   4   8   4   0.2   gh3   13  17  16  10  16  10  0.01    gh5   9   10  10  11  10  6   0.6 

df$p_values <- apply(df, 1, function(x) {     wilcox.test(as.numeric(x[2:4]), as.numeric(x[5:7]))$p.value })     type sp1 sp2 sp3 sp4 sp5 sp6   p_values 1   gh1   4   4   4   2   2   0 0.05934644 2   gh2   7   7   7   4   8   4 0.63735189 3   gh3  13  17  16  10  16  10 0.26115456 4   gh5   9  10  10  11  10   6 1.00000000 5   gh6   0   0   0   0   0   0        nan 6   gh7   1   1   1   1   1   0 0.50498508 7   gh9   0   0   1   0   1   0 1.00000000 8  gh10   3   1   1   0   2   0 0.36868827 9  gh11   1   1   0   2   1   1 0.30169958 10 gh12   3   1   2   3   1   2 1.00000000 11 gh13  11  13  12  12  13  12 0.81366372 12 gh15   2   1   2   2   1   3 0.81366372 13 gh16  17  16  16  14  11  13 0.07652250 14 gh17   7   7   7   8   6   7 1.00000000 15 gh18   7   9   9   9   9   5 1.00000000 16 gh20   2   2   2   2   1   2 0.50498508 17 gh22   0   0   0   0   0   0        nan 18 gh23   2   1   2   1   0   3 0.82218677 19 gh24   0   0   0   1   0   0 0.50498508 20 gh25   1   1   1   1   0   0 0.18763233 21 gh26   0   0   0   0   0   0        nan 

Comments