Homework 04: Summaries and Plots By Group

Due date: 2022-10-03

We’ll use the dataset donkeys, that I store online. Use the following code at the top of your Quarto document for this lab to load this data set.

finches <-

Read the help file about donkeys, to better understand the data set.

Please submit a folder containing your Quarto input (qmd) and output (html) documents for this homework, named Homework 04, to our shared Google Drive folder when you are finished.

  1. Use the dplyr functions summarise and group_by to calculate the following summary statistics on a numeric variable of your choice grouped by the variable Sex: mean, standard deviation, median, first quartile, third quartile, minimum, and maximum (use the functions min and max, respectively).

  2. Using your calculations in 1., what type of skew, if any, does your numerical variable have for each Sex? Why?

  3. Explain, in the context of these data, two of your summary statistics.

  4. Make multiple histograms (in one plot) of your numerical variable, where the histograms are split on the variable Sex.

  5. Make box plots of your numerical variable split by the variable Sex.

  6. Use the dplyr function mutate to create a new ratio variable using any two numerical variables of your choice.

  7. Make box plots or histograms, whichever you prefer, split by the variable Sex of your new ratio variable. Explain one interesting aspect of this new numeric variable in context of the data.