Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit


DS5110 Homework 2

2022

 

Instructions

Your solutions should include all of the code necessary to answer the problems. All of your code should run (assuming the data is available). All plots should be generated using ggplot2. Make sure that you answer all parts of the problem.

Submit your solutions on Canvas by the deadline displayed online.  For full credit, your submission must include exactly two files:

●  R Markdown (.Rmd)

●  Knitted PDF report (.pdf)

Problems must appear in order, and problem numbers must be clearly marked. Any written responses should appear outside of code blocks and use Markdown for text formatting. Code comments are encouraged, but will be ignored for grading purposes. Solutions that are especially difficult to grade due to poor formatting will not receive full credit.

All solutions to the given problems must be your own work. If you use third-party code for ancillary tasks, you must cite them.

 

Part A

Problems 1–2 correspond to the “Miniposter” assignment on Canvas, and ask you to provide the code that you used to import, tidy, and visualize the dataset that you used for your “Miniposter”.

 

Problem 1

Find a dataset that is personally interesting to you. It may be a publicly-available dataset, or a dataset for which you have permission to use and share results. There are many places online to find publicly-available dataset, and simply searching Google for your preferred topic plus “public dataset” may provide many hits. Here some additional resources to get you started:

●  US Government datasets (https://catalog.data.gov/dataset)

●  Center for Disease Control (CDC) data (https://data.cdc.gov)

●  Bureau of Labor Statistics (https://www.bls.gov/data/)

●  NASA datasets (https://nssdc.gsfc.nasa.gov)

● World Bank Open Data (https://data.worldbank.org)

●  Kaggle Datasets (https://www.kaggle.com/datasets)

This should be the same dataset that you use for the  “Miniposter assignment.  It does not have to be the same dataset you will use for your team project later in the semester.

Import the dataset into R, tidy the dataset (if necessary), and print the first several lines of the dataset.


Describe the dataset and its variables. Comment on whether you had to tidy the dataset, and how you tidied the data (if you did).

 

Problem 2

Use ggplot2 to create visualizations to identify interesting or unexpected relationships in the dataset.

After performing your analysis, present your results by creating an attractive “Miniposter” slide using PowerPoint, Keynote, or similar program. Submit your slide to the “Miniposter” assignment on Canvas.

In your homework solutions, reproduce the plots from your “Miniposter” figures, and provide your interpreta- tions of them.

 

Part B

Problems 3–5 use data on NCAA student-athlete academic performance.  Download the data files from “NCAA-D1-APR-2003-14.zip ” on Piazza. The files include the codebook and tab-delimited data for team-level Academic Progress Rates (APRs) of Division I student-athletes from 2003-2014.

A team’s APR is calculated out of a maximum score of 1000 points, and takes into account a team’s academic eligibility and retention, to derive an overall cohort rate of academic progress.

Import the dataset into R using the readr package, making sure that any missing data codes are imported

as NAs.

 

Problem 3

Create a tidy data frame that includes columns for:

●  School ID

●  School name

●  Sport code

●  Sport name

● Year

●  APR

All other columns can be discarded.

Use your tidied dataset to visualize the distributions of APRs over time. How does the distribution of APRs change year-to-year from 2004 to 2014?

Hint:  The t4byr))st:rts  u4th() and str4nfr))str  sua functions may be useful.


Problem 4

We would like to compare APRs between men’s and women’s sports. Transform your tidied dataset to remove mixed sports, and create a column indicating the gender division of each sport.  (You may assume sport codes 1-18 are men’s, and 19-37 are women’s.)

Visualize the distributions of APRs over time again, but broken down by gender division. How do the average APRs compare between men’s and women’s sports? Does this relationship hold true across each year from 2004 to 2014?

Hint:  The 4ealsa( function may be useful.



Problem 5

We would like to further investigate the APRs of different men’s teams. Filter your tidied dataset to include only men’s sports. Then visualize the distribution of APRs for each sport. Which sports tend to have higher and lower APRs on average?