biometryhub / biometryassist

A package to aid in teaching experimental design and analysis through easy access and documentation of helper functions. Renaming of previous BiometryTraining package.
https://biometryhub.github.io/biometryassist
Other
8 stars 1 forks source link

How to make comparism between lines and check #71

Open BB1464 opened 10 months ago

BB1464 commented 10 months ago

Good day all,

I know when working with the emmeans package I can make comparism between many lines and check variety. that is the aim is to select all lines that out perform the check. But I don't know how to achieve this using your pacakge. Thank you very much for writing this package. Merry Christmas and Happy New Year in Advance.

Here is an example of what I want to achieve:

Load Packages

library(tidyverse) library(agridat) # To get the omer.sorghum dataset library(lmerTest) library(emmeans) library(biometryassist)

Model

model <- lmer(yield ~ gen + env+(1 | rep), data = omer.sorghum)

summary(model) test <- anova(model, ddf = "Kenward-Roger", type = 3) test

Post Hoc Test

comparisons.G18 <- emmeans(model, specs = trt.vs.ctrl ~ gen, ref = 18)

str(comparisons.G18)

names(comparisons.G18)

comparisons.G18

comparisons.G18$contrasts # Get the contrast

comparisons.G18$contrasts %>% as_tibble() %>% arrange(desc(estimate))

This does not work

multiple_comparisons(model.obj = model,classify = 'gen',specs = trt.vs.ctrl ~ gen, ref = 18)

rogerssam commented 10 months ago

Good day all,

I know when working with the emmeans package I can make comparism between many lines and check variety. that is the aim is to select all lines that out perform the check. But I don't know how to achieve this using your pacakge. Thank you very much for writing this package. Merry Christmas and Happy New Year in Advance.

Here is an example of what I want to achieve:

Load Packages

library(tidyverse) library(agridat) # To get the omer.sorghum dataset library(lmerTest) library(emmeans) library(biometryassist)

Model

model <- lmer(yield ~ gen + env+(1 | rep), data = omer.sorghum)

summary(model) test <- anova(model, ddf = "Kenward-Roger", type = 3) test

Post Hoc Test

comparisons.G18 <- emmeans(model, specs = trt.vs.ctrl ~ gen, ref = 18)

str(comparisons.G18)

names(comparisons.G18)

comparisons.G18

comparisons.G18$contrasts # Get the contrast

comparisons.G18$contrasts %>% as_tibble() %>% arrange(desc(estimate))

This does not work

multiple_comparisons(model.obj = model,classify = 'gen',specs = trt.vs.ctrl ~ gen, ref = 18)

Hi @BB1464, this isn't currently implemented, but I will add it as a feature request and see what I can do to make it happen.

BB1464 commented 10 months ago

Thanks @rogerssam, I will be looking forward to it.