I have a dataset where I have measured a phenotype across multiple years and multiple varieties of a crop. The first way I have searched for a relationship is a two-way ANOVA, where I ask "Is there an effect of variety on the phenotype, having accounted for the sampling structure?" i.e.
phenotype ~ sampling event + variety
The question I am really interested in, is if any varieties are significantly better or worse than the overall population mean.
I have been struggling to find the appropriate post-hoc test for this, given I get a significant relationship between phenotype and variety. TukeyHSD hasn't been working for me, as I am not interested in comparisons between the different varieties, but rather comparison to the mean.
As a work-around I have been using T tests with a p value adjusted for multiple testing. However, I am not sure whether this is a) valid, and b) possible to do in a more streamlined way in R. At the moment I have to manually create a new column where the variety I am interested in is "a" and everything else is "b", so the T test compares sample "a" to the mean. However, given I have 30 different varieties, and 8 different phenotypes, this will take a long time to do manually!
Any help is more than welcome! I have attached some example data. I have only included one phenotype, for simplicity
variety <- c(A,A,A,A,B,B,B,B,C,C,C,C,D,D,D,D,E,E,E,E,F,F,F,F,G,G,G,G,H,H,H,H)
sampling_event <- c(A1,A1,A2,A2,A1,A1,A2,A2,A1,A1,A2,A2,A1,A1,A2,A2,A1,A1,A2,A2,A1,A1,A2,A2,A1,A1,A2,A2,A1,A1,A2,A2)
phenotype1 <- c(13.86,14.48,15.5,16.22,14.72,14.72,16.6,16.98,16.98,12.34,15.6,17.82,17.6,9.26,13.46,12.24,13.1,16.22,15.94,10.86,12.44,10.58,17.3,13.38,15.2,13.66,18.2,14.9,15.68,18.8,15.94,13.38)
dummydata <-data.frame(variety, sampling_event, phenotype1)
I followed the instructions on https://www.datanovia.com/en/blog/how-to-perform-multiple-t-test-in-r-for-different-variables/. From this, I managed to generate T tests for each variety across all of the phenotypes, which is good, but I would rather have T tests for all the varieties for each phenotype.