STAC32 Assignment 2

You are expected to complete this assignment on your own: that is, you may discuss general ideas with others, but the writeup of the work must be entirely your own. If your assignment is unreasonably similar to that of another student, you can expect to be asked to explain yourself.

If you run into problems on this assignment, it is up to you to figure out what to do. The only exception is if it is impossible for you to complete this assignment, for example a data file cannot be read. (There is a difference between you not knowing how to do something, which you have to figure out, and something being impossible, which you are allowed to contact me about.)

You must hand in a rendered document that shows your code, the output that the code produces, and your answers to the questions. This should be a file with .html on the end of its name. There is no credit for handing in your unrendered document (ending in .qmd), because the grader cannot then see whether the code in it runs properly. After you have handed in your file, you should be able to see (in Attempts) what file you handed in, and you should make a habit of checking that you did indeed hand in what you intended to, and that it displays as you expect.

Hint: render your document frequently, and solve any problems as they come up, rather than trying to do so at the end (when you may be close to the due date). If your document will not successfully render, it is because of an error in your code that you will have to find and fix. The error message will tell you where the problem is, but it is up to you to sort out what the problem is.

1 The Cherry Blossom Run

The Cherry Blossom Run is a running race that takes place every year on the streets of Washington, DC. In 2012, over sixteen thousand runners participated. Information about each of the runners is in http://ritsokiguess.site/datafiles/run12.csv. In this question, we are concerned with these variables:

  • gender M or F (for male or female, in terms of eligibility to run in running races for that gender)

  • time time taken to complete the race, in fractional minutes.

(a) (2) Read in and display (a little of) the data.

The file is a .csv, so read_csv will do it:

my_url <- "http://ritsokiguess.site/datafiles/run12.csv"
run12 <- read_csv(my_url)
Rows: 16924 Columns: 9
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr (3): gender, location, state
dbl (6): place, time, pace, age, div_place, div_tot

ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
run12