Draw Boxplot with Means in R (2 Examples) | Add Mean Values | points, text & stat_summary [ggplot2]

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

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

  • @inaydweller9739
    @inaydweller9739 2 года назад +1

    thanks! was very usefull with my college stuff!!

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

    Took me out of my 2 hours serch! short and just what I needed! Master!

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

    Good continuation

  • @johannafedorovsky4527
    @johannafedorovsky4527 2 года назад +2

    Super clear and useful! How would you do to add Mean+SD as label? Is there a way to add the number of observations for each group? Thanks

    • @StatisticsGlobe
      @StatisticsGlobe  2 года назад +1

      Thank you very much Johanna! Regarding your question: You may also calculate the SD using the aggregate function. Then, you may adjust the labels argument when creating the plot accordingly.

  • @cchen5907
    @cchen5907 2 года назад +1

    Thanks! Do you perhaps know how to show the different means for each boxplot, in the case you add a third binomial variable on the graph (aes= x, y, fill=z)? In this case, the means stay in the middle of both boxplots and are not placed on their own boxplots...

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

    What does the ..y.. accomplish in the round function?

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

      Hey Russtin, without the ..y.. ggplot2 doesn't know that the y corresponds to the input data in the ggplot() function. If you remove the dots, the following error message is returned: "Error in paste("Mean:", round(y, digits = 1)) : object 'y' not found". Regards, Joachim