I have a large set of biological data in a data frame, as below. Each row has the condition, identifier (plate and well) and 3 replicates of Expected Phenotype (EP) and Observed Phenotype (OP).
I want to add a column with the p value of a Wilcoxon rank sum test, testing whether EP and OP are significantly different from each other for each row/Well.
head(df)
Temp Plate Well EP1 EP2 EP3 OP1 OP2 OP3
1 30°C 31 A01 1.395874 1.323633 1.130804 0.1352 0.1632 0.1130
2 30°C 31 A02 1.449596 1.501810 1.111663 1.1474 1.1314 1.0628
3 30°C 31 A03 1.332983 1.416245 1.081833 1.0604 1.0947 1.0790
4 30°C 31 A04 1.333371 1.556057 1.091200 0.9786 1.0009 1.0127
5 30°C 31 A05 1.362556 1.343878 1.042433 1.0152 1.0534 1.0143
6 30°C 31 A06 1.542448 1.430897 1.031030 1.0266 1.0076 0.9785
I've found these posts: Run a wilcox function for each row in each group and Trying to run many anovas and get an F value for each row but I can't seem to put them together and make a script that works. I'm finding the mapply()
function completely impenetrable in the first link, and I can't work out how to get the Wilcox test instead of the f.stat in the second link.
Any help would be so appreciated. Thanks!