2 Compact letter display(CLD):Two way anova and visualistion using ggplot2

Опубликовано: 20 Октябрь 2024
на канале: Rajendra Choure
2,022
29

#rprogramming #rprogramming #anovaplot #ggplot2 #emmeans #cld #compactletterdisplay

In this tutorial, you will learn how to effectively apply Two-Way ANOVA to analyze your data and then compute the Critical Difference (CLD) values. We will dive into the world of R programming and utilize the powerful ggplot2 library to create stunning visualizations of the CLD results. Join us to unlock the secrets of statistical analysis and take your data interpretation skills to the next level!

This is a 3 part video tutorial
part 1 : one way ANOVA and CLD :    • I - Compact Letter Display (CLD) One-...  
part 2: Two way Anova and CLD :    • 2 Compact letter display(CLD):Two way...  
part 3: Three way Anova and CLD :    • 3 Compact letter display(CLD) three w...  

code

library(emmeans)
library(multcomp)
library(multcompView)


library(palmerpenguins)
head(penguins)
summary(penguins)
str(penguins)

two way factorial anova

mod2 = aov(bill_length_mm~species+sex,penguins)
summary(mod2)
emmean = emmeans(mod2,specs = c("species","sex"))
emmean_cld = cld(emmean,alpha=0.05,Letters=letters)

library(ggplot2)
ggplot(emmean_cld,aes(species , emmean,label=.group, fill=sex))+
geom_col(position="dodge")+
geom_errorbar(aes(ymin=emmean-SE, ymax=emmean+SE),
position = position_dodge(width=0.9),
width=0.1, size=0.7)+
geom_text(vjust=-0.5,
position = position_dodge(width=0.9))+
theme_classic()

Facebook page:
  / rajendrachoureisc  

Mail Id:
[email protected]

youtube playlist:
   • R programming tutorials