Need help with your Discussion

Get a timely done, PLAGIARISM-FREE paper
from our highly-qualified writers!

glass
pen
clip
papers
heaphones

University of Missouri Columbia Methods in Sport Analytics Statistics Questions

University of Missouri Columbia Methods in Sport Analytics Statistics Questions

University of Missouri Columbia Methods in Sport Analytics Statistics Questions

Question Description

Lab 4

Your Name HereDate Here

library(tidyverse)
## — Attaching packages ——————————————————————————

## v ggplot2 3.3.2## v tibble 3.0.3## v tidyr 1.1.2## v readr 1.3.1

v purrr 0.3.4v dplyr 1.0.2v stringr 1.4.0v forcats 0.5.0

## — Conflicts —————————————————————————————## x dplyr::filter() masks stats::filter()
## x dplyr::lag() masks stats::lag()

library(lubridate)##

## Attaching package: 'lubridate'
## The following objects are masked from 'package:base':####     date, intersect, setdiff, union

Question 1

You need to load in the two data sets, GPS_Month_deidentified.csv and Wellness_Month_deidentified.csv,and do a little bit of preprocessing. The column names of both data sets contain spaces and forward slashesthat we don’t want in our column names. Additionally, each data set has a column denoting the date onwhich the observation occurs, but they are not recognized as dates. We want to fix this two issues. Below,you need to fill in the code where asked.

                                                                                          unction makes

gps = read_csv() #### FILL INwell = read_csv() #### FILL IN

well = %>% #### FILL IN
rename_all( ~str_replace_all() ) %>% #### FILL IN
rename_all( ~str_replace_all() ) %>% #### FILL IN
mutate(Timestamp = mdy(str_split(, ” “, simplify = T)[,1])) #### FILL IN, note the mdy f

gps = %>% #### FILL IN
rename_all( ~str_replace_all() ) %>% #### FILL INrename_all( ~str_replace_all() ) %>% #### FILL INmutate(Date = mdy()) #### FILL IN

1

Answer

Question 2

We want to look at the wellness data, and determine how the average of all of the wellness metric are changingover time by position. As a general outline,

1. Select the appropriate columns (or remove the unneeded column(s), whichever is easier),2. Group by time and position,
3. Summarize the variables,
4. Pivot to long format,

5. Plot the data.

However, there are two obvious ways to visualize the data. The first possibility is to color each line by thewellness metric and create a different plot for each position. The second is to color each line by the positionand create a different plot for each wellness metric. You will need to create both of these plots, and then givea short explanation, no more than 1 paragraph, as to why one plot is better at visualizing the data than theother (or perhaps you need both to properly visualize the data).

well_plt = %>% #### FILL INselect() %>% #### FILL INgroup_by() %>% #### FILL INsummarise_at() %>% #### FILL INungroup() %>%

pivot_longer(, values_to = “Rating”, names_to = “Metric”)#### FILL IN

ggplot(well_plt, aes(x = , y = , color = )) + #### FILL INgeom_line(size = 1) +
scale_x_date() + #### FILL IN – you can find this in a previous lab!facet_wrap() + #### FILL IN

theme(axis.text.x = element_text(angle = 45, vjust = 0.5, size = 10),axis.text.y = element_text(size = 10),legend.position=”bottom”,
legend.title=element_blank())

ggplot(well_plt, aes(x = , y = , color = )) + #### FILL INgeom_line(size = 1) +
scale_x_date() + #### FILL IN- you can find this in a previous lab!facet_wrap() + #### FILL IN

theme(axis.text.x = element_text(angle = 45, vjust = 0.5, size = 10),axis.text.y = element_text(size = 10),legend.position=”bottom”,
legend.title=element_blank())

Answer

Question 3

For this question, we want to plot PlayerLoad_per_Min., intensity, IMALeft, and IMARIght by positionby date from the GPS data, adding an vertical line that indicates if a game was played on that day. However,

2

if you look at the GPS data set, you will notice that PlayerLoad_per_Min. has entries #DIV/0! thatcorrespond to no training that day – we will need to handle these! As a general outline, we will

  1. Select the 4 metrics along with Date, Position, and Type,
  2. Filter out the rows corresponding to the unwanted PlayerLoad_per_Min. entries,
  3. Change Type to an indicator column where 1 means game day and 0 means not game day,
  4. Change PlayerLoad_per_Min. to numeric (it was a character column b/c of the #DIV/0! entriesoriginally),
  5. Group by date and position,
  6. Summarize the variables of interest,
  7. Change to long format,
  8. Plot the data.

As with the previous problem, there are two ways to visualize the data. One is coloring the lines by positionand creating individual plots for the metrics, and the other is coloring the lines by metrics and creatingindividual plots for the positions. You will need to create both of these plots, and then give a short explanation,no more than 1 paragraph, as to why one plot is better at visualizing the data than the other (or perhaps youneed both to properly visualize the data). Additionally, why might this type of figure be useful for coachesand trainers?

3

# creates a v

# creates a v

gps_plt = %>% #### FILL IN
select() %>% #### FILL IN
filter() %>% #### FILL IN
mutate(Type = ifelse(Type == “Games”, 1, 0)) %>%mutate() %>% #### FILL IN

group_by() %>% #### FILL IN
summarise_at() %>% #### FILL IN
ungroup() %>%
pivot_longer(, names_to = “Metric”, values_to = “Value”)#### FILL IN

ggplot() + #### FILL IN
geom_line(size = 1) +
geom_vline(aes(xintercept = Date), data = gps_plt %>% filter(Type == 1), alpha = 0.75) +scale_x_date() + #### FILL IN – you can find this in a previous lab!
facet_wrap(, scales = “free_y”) + #### FILL IN
xlab(“”) +
theme(axis.text.x = element_text(angle = 45, vjust = 0.5, size = 10),

axis.text.y = element_text(size = 10),legend.position=”bottom”,legend.title=element_blank())

ggplot() + #### FILL IN
geom_line(size = 1) +
geom_vline(aes(xintercept = Date), data = gps_plt %>% filter(Type == 1), alpha = 0.75) +scale_x_date() + #### FILL IN – you can find this in a previous lab!
facet_wrap(, scales = “free_y”) + #### FILL IN
xlab(“”) +
theme(axis.text.x = element_text(angle = 45, vjust = 0.5, size = 10),

axis.text.y = element_text(size = 10),legend.position=”bottom”,legend.title=element_blank())

Answer

4

Have a similar assignment? "Place an order for your assignment and have exceptional work written by our team of experts, guaranteeing you A results."

Order Solution Now

Our Service Charter


1. Professional & Expert Writers: Eminence Papers only hires the best. Our writers are specially selected and recruited, after which they undergo further training to perfect their skills for specialization purposes. Moreover, our writers are holders of masters and Ph.D. degrees. They have impressive academic records, besides being native English speakers.

2. Top Quality Papers: Our customers are always guaranteed of papers that exceed their expectations. All our writers have +5 years of experience. This implies that all papers are written by individuals who are experts in their fields. In addition, the quality team reviews all the papers before sending them to the customers.

3. Plagiarism-Free Papers: All papers provided by Eminence Papers are written from scratch. Appropriate referencing and citation of key information are followed. Plagiarism checkers are used by the Quality assurance team and our editors just to double-check that there are no instances of plagiarism.

4. Timely Delivery: Time wasted is equivalent to a failed dedication and commitment. Eminence Papers are known for the timely delivery of any pending customer orders. Customers are well informed of the progress of their papers to ensure they keep track of what the writer is providing before the final draft is sent for grading.

5. Affordable Prices: Our prices are fairly structured to fit in all groups. Any customer willing to place their assignments with us can do so at very affordable prices. In addition, our customers enjoy regular discounts and bonuses.

6. 24/7 Customer Support: At Eminence Papers, we have put in place a team of experts who answer all customer inquiries promptly. The best part is the ever-availability of the team. Customers can make inquiries anytime.

We Can Write It for You! Enjoy 20% OFF on This Order. Use Code SAVE20

Stuck with your Assignment?

Enjoy 20% OFF Today
Use code SAVE20