## ← Statistics by Gender - Data Analysis with R

• 2 Followers
• 19 Lines

### Get Embed Code x Embed video Use the following code to embed this video. See our usage guide for more details on embedding. Paste this in your document somewhere (closest to the closing body tag is preferable): <script type="text/javascript" src='https://amara.org/embedder-iframe'></script> Paste this inside your HTML body, where you want to include the widget: <div class="amara-embed" data-url="http://www.youtube.com/watch?v=VkQwfVQ00EQ" data-team="udacity"></div> 5 Languages

Showing Revision 2 created 05/25/2016 by Udacity Robot.

1. When we run the code, we get this output. And
2. notice how we have friend count split by females, and then
3. by males. And it looks like the median and the mean
4. friend count is greater for females. So here the answer was
5. women. Now the difference between the median friend count for
6. men and women is 22. That's just subtracting these two numbers.
7. Now, something I want to draw your attention to is the
8. mean Notice how the mean for friend count is higher than
9. the median for both females and for males. This should
10. make sense since our data is long tailed. So these
11. higher values out and the higher friend counts our kind of
12. pull our mean to the right. For this last question,
13. the median is a better measure than mean because it's
14. a more robust statistic. A few people with huge friend
15. counts drag the mean upwards which isn't necessarily representative of
16. most users. What's nice is that the median's resistant to change,
17. since it marks the halfway point for all data points. So as long as we trust
18. half of our values, we can report a
19. reliable location of the center of our distribution.