# Exercise 2. Distributions & Tests
###### tags: `exercise`
## Instructions
- :warning: **Be sure to include your name on your answers!** :warning:
- Below are Problems which should all be achievable using the information in the tutorial. Challenges will require you to find resources or answers on your own. (Hint: Try googling "how to … in R".)
- Create a HackMD note to share your answers to these prompts. Copy the prompts, add your code and explanatory text and images. Use markdown formatting to distinguish the prompts from the code and explanatory text of your answers.
- Please complete this assignment individually. Discussing the problems with others is acceptable. However, keep in mind that your goal here should be to build a skill you can use going forward. Copying code you don't understand will not help you in the long run!
- Submit your answers by sharing the note with Dr. Angelini before Friday at dawn.
---
### Problem 1
Create histograms showing the distribution of flipper lengths for each species and sex in the `palmerpenguins::penguins` dataset. Include a few short sentences offering a biological interpretation of these data.
### Problem 2
Test for differences in the flipper length among these species. Briefly explain why you chose to use the test you did. Interpret the results of the test in biological terms and report them in your text as we described in class.
#### Challenge 1
Write a function to find the median absolute deviation (MAD) for a numeric vector. (Recall from Monday's lecture that this is a non-parametric descriptor of dispersion.) Use your function to find the MAD for body mass and flipper length in each species. (You do not need to distinguish males and females.) This can be done using the "tidy" tools, like `summarize()`. Produce a table of the values for each trait and species combination.
#### Challenge 2
R has a base function, `mad()`, that can also calculate median absolute deviation. Use R's function to cross-check yours. (Warning: you *will* run into a small snag.)
---
**Quick Links** | [BI377 Moodle](https://moodle.colby.edu/course/view.php?id=33250) | [BI377 HackMD](https://hackmd.io/@ColbyBI377/landingpage) | [rstudo.colby.edu](