Creating bar plot with error bars using ggplot2's stat_summary in R (CC318)

  Рет қаралды 593

Riffomonas Project

Riffomonas Project

Күн бұрын

Пікірлер: 12
@luckybarrel7829
@luckybarrel7829 Ай бұрын
There is an inbuilt function for sd. It's called mean_sdl. The default is mean +/- 2SD, so you need to pass on arguments to get mean +/- 1SD. So the function will look like: stat_summary(fun.data = "mean_sdl", fun.args = list(mult = 1), geom = "errorbar", width = 0.4) That list(mult = 1) is the multiples of SD that should be computed, and by default it is kept to 2 since looking at overlap of errorbars plotted with 2SD gives a good indication whether a result is significantly different or not by a t-test.
@zgl9764
@zgl9764 Ай бұрын
Great video, I really enjoy watching you code!
@Riffomonas
@Riffomonas Ай бұрын
My pleasure - thanks for watching!
@erikp6614
@erikp6614 6 күн бұрын
Very nice video!!! As an alternative to changing the y axis (around 25:40) one can use the expansion function. The expansion function let you choose multiplicative and additive expansion of the y axis.
@Riffomonas
@Riffomonas 6 күн бұрын
Thanks - I personally find expansion() not super intuitive. I'll have to keep working with it
@lucasamoroso92
@lucasamoroso92 Ай бұрын
Great video! I wish patterns within graphs were more natural to ggplot syntax, there are cases where they can be very useful (not in this case though haha)
@Riffomonas
@Riffomonas Ай бұрын
Thanks! Stay tuned for Wednesday's video 🤓
@ColinDdd
@ColinDdd Ай бұрын
the whole thing where error bars sometimes are standard error and sometimes standard deviation is so weird to me. what is the story with that! i ran into this trying to see what geom_errorbar(stat="summary") was doing, i think it is +/- one standard error, similar to what you saw with it defaulting to mean_se(). i guess sometimes good to see the underlying distribution vs the simple bar :) also pretty odd that you have to manually place the error bar, i wonder if there is a more natural way to get it to the right center position. but as always, great video!
@Riffomonas
@Riffomonas Ай бұрын
Thanks for watching! It seems everyone has a different opinion on SD/SE 🤣
@zgl9764
@zgl9764 Ай бұрын
Great video, I really enjoy watching you code!
@Riffomonas
@Riffomonas Ай бұрын
Glad to hear it! 🤓
Adding patterns to barplots with ggpattern and ggplot2 in R (CC319)
38:52
Cat mode and a glass of water #family #humor #fun
00:22
Kotiki_Z
Рет қаралды 42 МЛН
Mom Hack for Cooking Solo with a Little One! 🍳👶
00:15
5-Minute Crafts HOUSE
Рет қаралды 23 МЛН
Sigma Kid Mistake #funny #sigma
00:17
CRAZY GREAPA
Рет қаралды 30 МЛН
Going for simple with ggplot2 and dplyr (CC320)
30:58
Riffomonas Project
Рет қаралды 1,1 М.
Hardy's Integral
13:47
Michael Penn
Рет қаралды 18 М.
Adding log-scaled tick marks to an axis with ggplot2 in R (CC325)
36:50
Cat mode and a glass of water #family #humor #fun
00:22
Kotiki_Z
Рет қаралды 42 МЛН