Publication-Quality Barplots for Two Factors with ggplot - Two-Way ANOVA with R - tutorial 3

แชร์
ฝัง
  • เผยแพร่เมื่อ 8 ก.ค. 2024
  • R code: statdoe.com/barplot-for-two-f...
    Packages: ggplot2
    Main functions: ggplot, geom_bar, geom_errorbar, position_dodge, theme_bw, panel.grid.major, panel.grid.minor, element_blank, legend.position, geom_text, vjust, hjust=-0.5, show.legend, scale_fill_brewer, scale_color_brewer.
    Description:
    Welcome to the series of tutorials on Two-way ANOVA with R.
    In this series of videos, we are going to perform a complete analysis of a two-factor factorial design.
    We are going to cover the following steps :
    Video tutorial 1 ( • Two-Way ANOVA with R -... ):
    - build a simple plot for data visualisation;
    - perform the analysis of variance;
    Video tutorial 2 ( • Tukey's Test and Lette... ):
    - create a table with the mean and standard deviation of each treatment;
    - compare the means by Tukey’s test;
    - use the compact letter display to indicate significant differences;
    Video tutorial 3:
    - build a high-quality publication-grade bar plot,
    - letters indicating significant differences
    - grey-scale and colour-blind friendly
    Video tutorial 4 ( • Publication-Quality Sc... ):
    - build a high-quality publication-grade scatter plot. .
    www.statdoe.com
  • วิทยาศาสตร์และเทคโนโลยี

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

  • @PiaRxxxx
    @PiaRxxxx ปีที่แล้ว +1

    Thank you so much for your efforts, Rosane! Your videos are a huge help for me in order to write my bachelor's thesis in psychology! :)

  •  3 ปีที่แล้ว +1

    Great tutorial, as always!! Thanks so much!

  • @iot3136
    @iot3136 3 ปีที่แล้ว

    Thank you Rosane. Looking forward to a Four factor ☺️ Your approach to solve the problem.

  • @edwinmaingi5195
    @edwinmaingi5195 3 ปีที่แล้ว +1

    The Tutorial was really helpful, great work!

    • @RosaneRech
      @RosaneRech  3 ปีที่แล้ว

      Glad you liked it!

  • @agethananape1429
    @agethananape1429 2 ปีที่แล้ว +1

    Thank you very much. Your tutorial is clear and easy to follow through

  • @bkarim7349
    @bkarim7349 2 ปีที่แล้ว +1

    very useful,thanks

  • @kulwakan
    @kulwakan 2 ปีที่แล้ว

    Thanks Rosane, very useful indeed. Wondering how to change the order of the bars from major to minor?

  • @rajendraregmi5407
    @rajendraregmi5407 11 หลายเดือนก่อน

    Thank you very much for the very informative video. If you transform data, we have to prepare the bar plot on real data so how can we add labels to the graph.

  • @kohinoorbegum2880
    @kohinoorbegum2880 ปีที่แล้ว

    Thank you so much

    • @RosaneRech
      @RosaneRech  ปีที่แล้ว

      You're most welcome :)

  • @Aesthetics10000
    @Aesthetics10000 8 หลายเดือนก่อน

    hi! i am trying to ad error bars of mean and sd from data but could not find any result

  • @t.n.strijker5114
    @t.n.strijker5114 3 ปีที่แล้ว

    Thank you very much for this helpful tutorial Dr. Rech. The lower-case letters compare [glass] within one specific [temperature]. Could you show how to run a second LSD-test and compare if the light output is significantly different *between* the temperatures for [1] specific glass type, with upper-case letters? (That would be instead of the legend uppercase A,B,C). In my case, I am looking at the concentration of anti-oxidants in 16 bell pepper cultivars, with a Treatment and a Control group. So I would like to see the significant differences between varieties for treatment and control separately, and also within the variety if the treatment significantly increased the level of anti-oxidants, like you already showed in this tutorial for temperature. Lastly, I have seen publications use (NS = not significant) written on top of the treatment and control bars for a variety where that was the case. Is this also possible in R? I'd appreciate any lead to achieve the above. Thanks in advance for your reply.

    • @RosaneRech
      @RosaneRech  3 ปีที่แล้ว +1

      Depending on the specifics of what you are trying to do, there are several ways of solving it.
      About the LSD-test, I don't believe there is a command to break the letters, I would guess you have to do it manually. The LSD is the same, you need only change the letters,. Then you can add a new column to your data with the specific information you would like to add (letters, NS, or a blank cell for nothing) and use the geom_text to add the information.

  • @gabrielapingarron8221
    @gabrielapingarron8221 3 ปีที่แล้ว

    Thank you very much! It's very clear tutorial, I spent so much time trying to do that before I found it! However, I would like to use boxplot instead, and when I plot the letters they are in the wrong order. Could you help me?
    Thank you.

    • @RosaneRech
      @RosaneRech  3 ปีที่แล้ว

      I am finishing a tutorial on box-plots. About the order, if you are building a table with the summarised data, it is essential to have the means arranged in decreasing order, because the letters are generated in decreasing order.

  • @owaisaliwani9095
    @owaisaliwani9095 3 ปีที่แล้ว

    Thank you very much for this tutorial and can please make vedio on 3 factorial barplot.
    Thanks in Advance

    • @RosaneRech
      @RosaneRech  3 ปีที่แล้ว

      Sure, I will do it.

    • @owaisaliwani9095
      @owaisaliwani9095 3 ปีที่แล้ว

      @@RosaneRech thank you very much, can i get your email ID.

    • @RosaneRech
      @RosaneRech  3 ปีที่แล้ว

      For safety purposes, I am not typing the e-mail address here in the comments, but you can get my e-mail in the ABOUT section of the YT channel, or feel free to connect with me using LinkedIn www.linkedin.com/in/rosane-rech-0a185514a/

  • @VenSensei
    @VenSensei 3 ปีที่แล้ว +1

    I feel the legend is somewhat redundant after you've integrated the legend's information within the plot.

    • @RosaneRech
      @RosaneRech  3 ปีที่แล้ว

      You are right, the legend could be removed.

    • @VenSensei
      @VenSensei 3 ปีที่แล้ว +1

      @@RosaneRech I will concede that in some instances, redundancy may be helpful for those who are not familiar with a plot or the plot's topic.

  • @endalewassefa8872
    @endalewassefa8872 3 ปีที่แล้ว

    Thank you for this interesting video. I have question. when add +geom_text(aes(label=Tukey),position_dodge(0.9), size = 3,
    vjust= -0.8, hjust= -0.5, color="gray25"), the error is like this, "Error: ggplot2 doesn't know how to deal with data of class PositionDodge/Position/ggproto". can you help me to correct it?

    • @RosaneRech
      @RosaneRech  3 ปีที่แล้ว +1

      Hi, instead of 'position_dodge(0.90)' try 'position = position_dodge(0.90)'.

    • @endalewassefa8872
      @endalewassefa8872 3 ปีที่แล้ว

      @@RosaneRech Thank you so much. Everything ok right now.

  • @KN-tx7sd
    @KN-tx7sd 2 ปีที่แล้ว

    Can you please show how to add statistical significance within each group e.g., ANOVA/Kruskal Wallis test as either numerical or asterisk above each group. Thank you

    • @RosaneRech
      @RosaneRech  2 ปีที่แล้ว +1

      Thanks for the suggestion, I will try to add it in some of my next videos.

  • @Fly_maggot
    @Fly_maggot ปีที่แล้ว

    Can I know how to overcome error bar overlapping when producing a stacked bar chart using R?

    • @RosaneRech
      @RosaneRech  ปีที่แล้ว

      It's an interesting question. I will make a video about it...
      Meanwhile, check the following link, I believe it has what you need:
      stackoverflow.com/questions/58603380/how-to-organize-error-bars-to-relevant-bars-in-a-stacked-bar-plot-in-ggplot

    • @Fly_maggot
      @Fly_maggot ปีที่แล้ว

      @@RosaneRech thank you .. waiting for the video 🙂

  • @milenaoliveira2626
    @milenaoliveira2626 2 ปีที่แล้ว

    Hey, thank you!! By the way, você é brasileira?

    • @RosaneRech
      @RosaneRech  2 ปีที่แล้ว

      Olá Milena, sim sou brasileira!

  • @achual1909
    @achual1909 3 ปีที่แล้ว

    Excellent video and good narration. Keep doing more videos. By the by can we change the text from Times New Roman fo Trebuchet M S. Thank you

    • @RosaneRech
      @RosaneRech  3 ปีที่แล้ว +1

      You can do it using the 'extrafont' package:
      install.packages("extrafont") # needs to be done once
      library(extrafont)
      font_import() # needs to be done once
      fonts() # shows the fonts available
      # in the ggplot code add the following line:
      theme(text=element_text(family="Trebuchet MS"))

    • @achual1909
      @achual1909 3 ปีที่แล้ว +1

      @@RosaneRech 😍👌 Thank you Rosane

    • @achual1909
      @achual1909 3 ปีที่แล้ว

      @Rosane Rech could you please provide your email

    • @RosaneRech
      @RosaneRech  3 ปีที่แล้ว

      @@achual1909 I am sorry, but to avoid spam and for security reasons, I will not type my email address. You can get it in the section About of the YT channel, or you can get the contact email in my website statdoe.com .

  • @endalewassefa8872
    @endalewassefa8872 3 ปีที่แล้ว

    How to find the significance and plot the result of three factorial experiment?

    • @RosaneRech
      @RosaneRech  3 ปีที่แล้ว

      Hello Endalew, take a look in the following tutorial: th-cam.com/video/XHG6lbRzaWQ/w-d-xo.html