Rstudio ggplot tutorial (Geom Boxplot with ANOVA)

Поделиться
HTML-код
  • Опубликовано: 23 окт 2024

Комментарии • 17

  • @aselefechful
    @aselefechful Год назад +1

    I appreciate your teaching method and it is very interesting.

    • @ecomattp
      @ecomattp  Год назад

      Thank you! I appreciate hearing that!

  • @KarinaMartinez-e3f
    @KarinaMartinez-e3f Год назад

    ahh man you explained this so nicely!

  • @imthatnggruponthatnag7784
    @imthatnggruponthatnag7784 Год назад +1

    Thanks for the excellent video. How do you activate that green line that appears when you run the code eg at 5:05?

    • @ecomattp
      @ecomattp  Год назад

      If you highlight the section of code you want to run and press control + enter it should appear to show the progress of running your code. If there are errors it would become red. Good question!

  • @THeSKyRimMaStER80
    @THeSKyRimMaStER80 2 года назад

    Hi thanks for the video, greatly helped. I was just wondering if it would be possible to add the Tukey's test as well in the code using the stat_compare_means?

    • @ecomattp
      @ecomattp  2 года назад

      Hello! You should be able to add it into stat_compare_means. It might be that you add it in as a t.test rather than an ANOVA. It would look something like this: stat_compare_means(method="t.test").
      I hope this helps. If not here is a link to break down the components of adding comparisons in ggplot:
      rpkgs.datanovia.com/ggpubr/reference/stat_compare_means.html

    • @rajendraregmi2892
      @rajendraregmi2892 2 года назад

      Very nice video, how can I do for two factors anova?

    • @ecomattp
      @ecomattp  2 года назад

      @@rajendraregmi2892 Great question. You would need to run ggplot through a series of pipes "%>%" leading with your data frame, in this case DN_Master_Data %>% (insert the ggplot script to create your boxplot). Then after you create your plot you can do a summary function of "anova" as such anova(lm(pH ~ Treatment, DN_Master_Data)). This creates a linear model and you can further detail interactions within this function. To avoid being too long winded, here's a link to a detailed explanation of how you can achieve this! I hope this helps: publish.illinois.edu/liangf/teaching/stat-424/rcode-two-way-anova/

    • @rajendraregmi2892
      @rajendraregmi2892 2 года назад

      @@ecomattp Thank you. I will go through this link and let you know if I need more help. Thanks

  • @nayabfatima4709
    @nayabfatima4709 Год назад

    Hi, i keep getting an "R code execution error" every time i type in the stat_compare_means command. I have installed the package

    • @ecomattp
      @ecomattp  Год назад

      This could be anything from network connection to needing another package installed. Without seeing the code I cannot fully assess what the issue might be. If you copy and paste the error into google that may help.

  • @galkain7685
    @galkain7685 3 года назад

    can you pls explain to me what each thing mean in the plot? Is the line showing the mean or the median ?
    for example

    • @ecomattp
      @ecomattp  3 года назад

      Sorry for not seeing this until now! A box and whisker plot (which is what is shown in the video) shows the full range of the data. The box itself represents the interquartile range of the data. What I mean by this is that the lower end of the box is the 25th percentile, the middle line is the 50th percentile (better known as the mean), and the upper end of the box is the 75th percentile.
      Additionally, the whiskers (the lines extending above and below the box) represent the sample error of the data and can expose outliers in your data as well. This is why some of the whiskers are longer than others. This is because it depends on the treatment.

  • @galkain7685
    @galkain7685 3 года назад

    i tried using the Start_comapre function, but it doesn't work (I installed and library the ggpubr package), can you pls help?

    • @ecomattp
      @ecomattp  3 года назад +1

      Hello! You want to make sure you use stat_compare not start_compare. Minor difference in syntax, but will be the difference for the script working versus not in this instance. Hope this helps!

    • @galkain7685
      @galkain7685 3 года назад

      @@ecomattp thank you!!