You are simply fantastic! I thoroughly enjoy each and every one of your videos and have applied several tips into graphics within my PhD chapters. Thank you for being such an influential resource. I hope this channel rewards you with lots of compensation and opportunity. After a while I will have to acknowledge you in the thesis. xx
indeed, that is the difference between statistical difference and practical difference. It would be more informative to report p-value and effect size (Cohen's d, squared êta, etc.). It already done linear regression with the p value and the R² as the effect size.
I've seen plots with these type of "significance annotations" quite often when it comes to group differences but as you pointed out they look kinda messy if you're looking at more than say four groups. I think a more eye-pleasing solution is the use of (if necessary, bootstrapped) CIs. Slap them in the backgroud with geom_errorbar() and if some group's CIs overlap, there is no statistically significant difference in means or medians or whatever you've constructed them around. Just don't use theme_minimal or void because some horizontal gridlines come in handy if you're looking at a multitude of CIs.
These videos are really useful! The problem I'm grappling with at the moment is positioning text in a plot relative to the axes and relative to data. I would like an automated way rather than doing it manually for each plot. One case is putting significance stars (or single star! :) a fixed distance above the top bar of an errorbar (mean+-SE). Here both x and y depend on the data. The other case is placing annotations a fixed fraction up/down from the bottom/top of the plot, e.g. 5%, independent of plot size. Here the x position depends on the data, but the y position varies with the y-axis limits. I don't know if you "do requests", but if you have time to cover this in a future video I would be extremely grateful!
@@Riffomonas Thanks! Update: I have discovered that nudging in the y direction is a good solution to the errorbar part. Regarding the plot proportion challenge, I can get partway there using +Inf/-Inf positioning plus y nudges. The unit of the nudge looks like it's relative to the size of a character but I couldn't find where that is documented. What would be great is if the units could be set to other things too: inches, cm, normalized plot units. Initially, I 'solved' the problem by finding the actual plot limits in data units via ggplot_build() and rummaging in the resulting list, then using them to position at fixed fraction of the plot. Unfortunately, the code to do that kept breaking with ggplot2 updates. Sorry for the long reply.
Hey Pat, thanks for the great video! I tried it and it worked very well. Can you maybe explain how this works with the function facet_grid? I want to add one line for all grids. This would be very helpful! :)
Great suggestion! I think that would require adding a column to the tibble with the variable that you are faceting on. Let me see if I can't add this to a future episode
Hi Pat, Thanks. If we want to do the same for multifactor grouped bar plots can you please describe how to add ANOVA significance (either as numerical values or as asterisks) like the one you showed for this plot?
Thanks for the question - It would be the same idea as was covered in this episode. The difference would be that instead of adding the stars and bars to a jittered plot, you would be doing it over a bar plot
Thanks, Pat, but in case if you have a multi-faceted plot, say more than 15 plots it might be difficult to add the stars for each plot separately. In this case, will it is recommended to use ggpubr package to add the stars e.g., using the command state_compare_means(method = "anova"). And if it is how can we add the ref.group. Thank you for your reply.
Hello great video, I am trying to be it presently but I keep an error Error: unexpected ',' in: "hypopre + geom_line(data= hypopre(x=c(2, 3), y=(16," when I remove the "," Error: unexpected symbol in: "hypopre + geom_line(data= hypopre(x=c(2, 3) y" is it because I have categorical names as my x labels and not numerical ?
Hey Pat, what do you do when the factor is significant but none of the levels differ in the pair wise tests due to the correction for multiple comparison?
I suspect the effect size would be pretty small. I’d probably say that there was an experiment wise difference but non of the pair wise comparison were significant
Excelent video. Professor, I have a little problem, look at the maximum value of y in your graph (30) and the respective divisions of it (intervals of 10 units). Additionally, in your graph you have a blank space at the top that allows you to add the line to compare the categories without modifying the maximum value of y, and the division of the same. In my case, since I don't have that upper blank space, when I add the line to compare the box plots, it distorts the scale of the y axis and increases my value on the y axis. If I set the y-limits, then it removes the comparison lines from the boxplot and doesn't show them. Any ideas to fix it. I just want some extra white space at the top of the chart that allows me to insert the lines without changing my max y value.
Thank you so much! As usual, your video was useful. I have à little problem writing automatically normality test result (Shapiro test) onto qqplot graphic. any help please. thinks
Anyone figure out the challenge I gave in the video?
yeap!! Do you think we can add in the paper acknowledgments the Riffomonas project for figures improvements? I am using it a lot! thank you so much
Yess!!
strip_chart +
geom_line(data = tibble(x=c(2,3), y=c(23,23)),
aes(x=x, y=y),
inherit.aes = FALSE) +
geom_line(data = tibble(x=c(2,2), y=c(22,23)),
aes(x=x, y=y),
inherit.aes = FALSE) +
geom_line(data = tibble(x=c(3,3), y=c(22,23)),
aes(x=x, y=y),
inherit.aes = FALSE) +
geom_line(data = tibble(x=c(1,2.5), y=c(33,33)),
aes(x=x, y=y),
inherit.aes = FALSE) +
geom_line(data = tibble(x=c(1,1), y=c(32,33)),
aes(x=x, y=y),
inherit.aes = FALSE) +
geom_line(data = tibble(x=c(2.5,2.5), y=c(32,33)),
aes(x=x, y=y),
inherit.aes = FALSE) +
geom_text(data = tibble(x=2.5, y=24),
aes(x=x, y=y, label = "n.s."),
inherit.aes = FALSE) +
geom_text(data = tibble(x=1.75, y=33.5),
aes(x=x, y=y, label = "*"),
size = 8,
inherit.aes = FALSE)
Thank you for making the video, very helpful!
Yeah, thank you for your learn! I wanted to show the result produced with my data, it was wonderful! :D
You are simply fantastic! I thoroughly enjoy each and every one of your videos and have applied several tips into graphics within my PhD chapters. Thank you for being such an influential resource. I hope this channel rewards you with lots of compensation and opportunity. After a while I will have to acknowledge you in the thesis. xx
Ah, thanks! 🤓 all the best in finishing your dissertation
Sir, I learned a lot about ggplot from you today, thanks a lot!
Wonderful Ahmad - thanks for tuning in!
I think there's a useful distinction between P
indeed, that is the difference between statistical difference and practical difference. It would be more informative to report p-value and effect size (Cohen's d, squared êta, etc.). It already done linear regression with the p value and the R² as the effect size.
I've seen plots with these type of "significance annotations" quite often when it comes to group differences but as you pointed out they look kinda messy if you're looking at more than say four groups. I think a more eye-pleasing solution is the use of (if necessary, bootstrapped) CIs. Slap them in the backgroud with geom_errorbar() and if some group's CIs overlap, there is no statistically significant difference in means or medians or whatever you've constructed them around. Just don't use theme_minimal or void because some horizontal gridlines come in handy if you're looking at a multitude of CIs.
Interesting idea - thanks for watching!
Thanks a lot, this video was super helpful and to the point! :)
Wonderful! Thanks for watching 🤓
These videos are really useful! The problem I'm grappling with at the moment is positioning text in a plot relative to the axes and relative to data. I would like an automated way rather than doing it manually for each plot. One case is putting significance stars (or single star! :) a fixed distance above the top bar of an errorbar (mean+-SE). Here both x and y depend on the data. The other case is placing annotations a fixed fraction up/down from the bottom/top of the plot, e.g. 5%, independent of plot size. Here the x position depends on the data, but the y position varies with the y-axis limits. I don't know if you "do requests", but if you have time to cover this in a future video I would be extremely grateful!
Thanks for watching and for the suggestion! I'll keep that in mind the next time I add some annotation to a figure
@@Riffomonas Thanks! Update: I have discovered that nudging in the y direction is a good solution to the errorbar part. Regarding the plot proportion challenge, I can get partway there using +Inf/-Inf positioning plus y nudges. The unit of the nudge looks like it's relative to the size of a character but I couldn't find where that is documented. What would be great is if the units could be set to other things too: inches, cm, normalized plot units. Initially, I 'solved' the problem by finding the actual plot limits in data units via ggplot_build() and rummaging in the resulting list, then using them to position at fixed fraction of the plot. Unfortunately, the code to do that kept breaking with ggplot2 updates. Sorry for the long reply.
Hey fburton8 - check out today's episode. I place the bars and stars dependent on the location of the data. ruclips.net/video/-DfCitMqdUc/видео.html
Thank you! Very helpful!
very helpful :)
Wonderful! I'm so glad you've gotten something out of the video 🤓
Thanks
My pleasure!
congratulations on the Oscar!
ha! ruclips.net/video/TK4xJlNbXLE/видео.html&lc=UgwUORClq4-zus99pol4AaABAg.9LrqhRMSMzY9LsQLzIWEo3
great!
Hey Pat, thanks for the great video! I tried it and it worked very well. Can you maybe explain how this works with the function facet_grid? I want to add one line for all grids. This would be very helpful! :)
Great suggestion! I think that would require adding a column to the tibble with the variable that you are faceting on. Let me see if I can't add this to a future episode
@@Riffomonas Superrrr cool!!! In fact, I used your hack for inserting the bar in a boxplot, and I am struggling to do it with facet_grid!
Thanks again for the question! I liked it so much that I just posted a video answering it :) ruclips.net/video/ibB-MnIEUJ0/видео.html
@@Riffomonas Thanks for the quick post!! it solved my problem! at least one of them... ;)
@@janarigonato I'm so glad to hear it - thanks for letting me know!
Hi Pat, Thanks. If we want to do the same for multifactor grouped bar plots can you please describe how to add ANOVA significance (either as numerical values or as asterisks) like the one you showed for this plot?
Thanks for the question - It would be the same idea as was covered in this episode. The difference would be that instead of adding the stars and bars to a jittered plot, you would be doing it over a bar plot
Thanks, Pat, but in case if you have a multi-faceted plot, say more than 15 plots it might be difficult to add the stars for each plot separately. In this case, will it is recommended to use ggpubr package to add the stars e.g., using the command state_compare_means(method = "anova"). And if it is how can we add the ref.group. Thank you for your reply.
Would be interesting to see how you make this reproducible and in a way that would adjust automatically to different data :)
:) Check this out... ruclips.net/video/-DfCitMqdUc/видео.html
Hello great video, I am trying to be it presently but I keep an error
Error: unexpected ',' in:
"hypopre +
geom_line(data= hypopre(x=c(2, 3), y=(16,"
when I remove the ","
Error: unexpected symbol in:
"hypopre +
geom_line(data= hypopre(x=c(2, 3) y"
is it because I have categorical names as my x labels and not numerical ?
Hey Erika - thanks for watching! I think you're missing a c before your parentheses - geom_line(data= hypopre(x=c(2, 3), y=c(16,
Hey Pat, what do you do when the factor is significant but none of the levels differ in the pair wise tests due to the correction for multiple comparison?
I suspect the effect size would be pretty small. I’d probably say that there was an experiment wise difference but non of the pair wise comparison were significant
Excelent video. Professor, I have a little problem, look at the maximum value of y in your graph (30) and the respective divisions of it (intervals of 10 units). Additionally, in your graph you have a blank space at the top that allows you to add the line to compare the categories without modifying the maximum value of y, and the division of the same. In my case, since I don't have that upper blank space, when I add the line to compare the box plots, it distorts the scale of the y axis and increases my value on the y axis. If I set the y-limits, then it removes the comparison lines from the boxplot and doesn't show them. Any ideas to fix it. I just want some extra white space at the top of the chart that allows me to insert the lines without changing my max y value.
Thank you so much!
As usual, your video was useful.
I have à little problem writing automatically normality test result (Shapiro test) onto qqplot graphic. any help please.
thinks
You would want to convert the output to a data frame and then add it with a geom_text to geom_qqplot
@@Riffomonas I appreciate your note. I'll try practicing on that approach.
Hey Pat, this link doesn't work. www.riffomonas.org/code_club/....
Ack sorry! Try the new link in the description or this: riffomonas.org/code_club/2021-04-16-testing-significance