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

แชร์
ฝัง
  • เผยแพร่เมื่อ 8 ก.ค. 2024
  • #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 Dis...
    part 2: Two way Anova and CLD : • 2 Compact letter displ...
    part 3: Three way Anova and CLD : • 3 Compact letter displ...
    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:
    rajuchoure@gmail.com
    youtube playlist:
    • R programming tutorials

ความคิดเห็น • 9

  • @i-Veloger
    @i-Veloger 6 หลายเดือนก่อน +1

    My expectations were blown to smithereens (in the best way possible)! Your analysis surpassed every metric and redefined what 'great' means in statistics, Thanks for outstanding analysis.

  • @minayooo
    @minayooo 7 หลายเดือนก่อน

    Thanks!

    • @DevResearch
      @DevResearch  7 หลายเดือนก่อน +1

      It's part 2 of the tutorial. Do watch part I also.

    • @minayooo
      @minayooo 7 หลายเดือนก่อน +2

      @@DevResearch for some reason this section of code did not work for me: emmean = emmeans(mod2,specs = c("species","sex"))
      emmean_cld = cld(emmean,alpha=0.05,Letters=letters)
      so I had to change this section to : emmean = emmeans (mod2 , ~ species | sex)) for my own data and then I got the cld results.

  • @minayooo
    @minayooo 7 หลายเดือนก่อน

    Thanks again for the video: is there any way we do separate mean comparison for sexes per each species? in terms of showing CLDs?!

    • @DevResearch
      @DevResearch  7 หลายเดือนก่อน +1

      I am trying to wirte a script for this. But am short opf time. Will compile it soon.

    • @minayooo
      @minayooo 7 หลายเดือนก่อน

      @@DevResearch Thanks! you are the best

  • @adamavip
    @adamavip 9 หลายเดือนก่อน

    Thank you so much for sharing such kind of content. Is it possible to have a p-value in emmean table? And how to interpret the differences based on the distinct letters?

    • @DevResearch
      @DevResearch  9 หลายเดือนก่อน

      I will look for the code or possible modification to get p-values in emmean table.
      Regrading interpretation of cld: the bars or boxes sharing letters are not statistically significant. When letters are different, there is a significant difference.