Creating a jitter plot / stripchart with ggplot2's geom_jitter and stat_summary in R (CC090)

แชร์
ฝัง
  • เผยแพร่เมื่อ 6 ก.ย. 2024

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

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

    For a stripchart/jitter plot, is showing the median enough, or do you want to see more summary information about the shape of distribution embedded in the figure?

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

      I think it also depends on the sample size, as you started to discuss. If I try to look at data from a giant drug trial, too many points=brain jitters. The current data set is at the upper size limit and I have mild jitters. My mental habit of methodically looking at axes/scale, labels, then distribution also hits bumps without the distribution explicitly plotted. I hit the same bumps on your Z-shape because when I went to find the axis labels I couldn't. Retraining my brain is slow, but worth it. Thank you for putting all these videos together. I am learning a ton and able to do a better job looking at my own data. You've also got some great resources to incorporate into teaching literature evaluation, which I appreciate.

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

      @@annazemke493 Thanks Anna - glad you're enjoying the videos!

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

    Thank you so much! I was lost in the code for a homework assignment. My jitter plot looks leagues better now.

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

      Fantastic! Glad to be of help 🤓

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

    'horizontal variation within each category is determined randomly to separate the points'
    -wise man

  • @drjzee
    @drjzee 3 ปีที่แล้ว +2

    I really like these plots and have seen in publications are fusion of these and bar plots which are quite good for those who really like the bars! Have you tried ggbeeswarm? I like that too as it does something similar but shows the density of points at each level on the y axis in a similar way to a violin plot.

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

      Hi drjzee - Thanks for sharing ggbeeswarm, I'll look into it more. Some of the examples in their documentation look a lot like the output from geom_dotplot. I'll talk more about that in Wednesday's video with violin plots

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

    Thank you my great Master Shifu.

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

      Ha! Thanks for watching

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

    Thank you so much for your explanation!!

  • @MrJL-xk5jb
    @MrJL-xk5jb 21 วันที่ผ่านมา

    your videos are so useful, lots of thanks.
    How do you comment (#) more thant one line at the same time?

    • @Riffomonas
      @Riffomonas  18 วันที่ผ่านมา +1

      I highlight the lines and then use the shortcut to comment them. On my mac it's shift-command-c

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

    Hello. How do you put N=155 under the labels (axis "X")

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

      Hey Adolfo - thanks for the question! If you look back two episodes earlier, I went through this. Here is the link to the timestamp where I generate the count and add it to the x-axis label th-cam.com/video/IPey9jk_NOQ/w-d-xo.html

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

    Sir, I have Mailed You a Paper In which I am confused that they Have used Slope Plot or Simple line Plot to Show F/B ratio Throughout childhood

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

      Sorrry but I don’t have the bandwidth to help with individual issues

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

      @@Riffomonas Sir, It's related to your previous video....it also helps others and that paper also have correlation plots and I think you haven't made any video on that correlation plot also. Please Sir check it out once.

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

    I confirm I disagree with you I greatly prefer boxplot, but as always is quite interesting to watch your video.

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

      Thanks Cyrille! Stay tuned for the next episode where I will talks about boxplots. My concerns with boxplots is no one seems to know what the whiskers represent. Also, if you only have a few points, the box seems to be trying to say too much. For this data set, I think the boxes, without whiskers might work well. Keep watching 😊

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

      @@Riffomonas I'm looking forward....
      For me, it seems easier to explain whiskers rather than jitter plot, but I see your point ....

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

    how to add error bars here?

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

      See the episodes on stat_summary

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

      @@Riffomonas Thank you sir

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

    not working in my code

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

      Are you using element_markdown?

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

      @@Riffomonas No I am using only element_text in axis.text.x to make bold the words

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

      @@rishikeshdash12 element_mardown is what you need instead of element_text

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

      @@Riffomonas thank You so much Sir

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

      @@Riffomonas Thank you sir...I did it.

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

    how to increase jitter size?

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

      jitter.width

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

      @@Riffomonas inside the geom_jitter() function?

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

      @@Riffomonas Sir it's not working inside the geom_jitter function