Import data

# excel file
revenue <- read_excel("../00_data/myData_charts.xls")
revenue
## # A tibble: 16,383 × 29
##     ...1  year unitid institution_name         city_txt state_cd zip_text
##    <dbl> <dbl>  <dbl> <chr>                    <chr>    <chr>       <dbl>
##  1     1  2015 100654 Alabama A & M University Normal   AL          35762
##  2     2  2015 100654 Alabama A & M University Normal   AL          35762
##  3     3  2015 100654 Alabama A & M University Normal   AL          35762
##  4     4  2015 100654 Alabama A & M University Normal   AL          35762
##  5     5  2015 100654 Alabama A & M University Normal   AL          35762
##  6     6  2015 100654 Alabama A & M University Normal   AL          35762
##  7     7  2015 100654 Alabama A & M University Normal   AL          35762
##  8     8  2015 100654 Alabama A & M University Normal   AL          35762
##  9     9  2015 100654 Alabama A & M University Normal   AL          35762
## 10    10  2015 100654 Alabama A & M University Normal   AL          35762
## # ℹ 16,373 more rows
## # ℹ 22 more variables: classification_code <dbl>, classification_name <chr>,
## #   classification_other <chr>, ef_male_count <dbl>, ef_female_count <dbl>,
## #   ef_total_count <dbl>, sector_cd <dbl>, sector_name <chr>, sportscode <dbl>,
## #   partic_men <chr>, partic_women <chr>, partic_coed_men <chr>,
## #   partic_coed_women <chr>, sum_partic_men <dbl>, sum_partic_women <dbl>,
## #   rev_men <chr>, rev_women <chr>, total_rev_menwomen <chr>, exp_men <chr>, …

State one question

What sport in 2019 at the University of Denver had the biggest men and women combined revenue?

Plot data

library(ggplot2)
library(dplyr)

u <- "University of Denver"

data_u <- revenue %>% 
  filter(institution_name == u)     # or filter(school == u) if your column is 'school'

# plot the revenue distribution using a histogram
ggplot(data_u,
       aes(x = reorder(sports, total_rev_menwomen),
           y = total_rev_menwomen)) +
  geom_col() +
  coord_flip() +
  labs(
    title = paste0("Total revenue (men & women combined) by sport — ", u),
    x = "Sport",
    y = "Total revenue") +
  theme_minimal()

Interpret

There seems to be preliminary evidence that for the University of Denver, the men and women combined revenues are concentrated in a small number of sports. Basketball generates the largest combined revenue, followed by Lacrosse and Ice Hockey. This graph also shows that Soccer and Swimming & Diving are relatively high. The sports that have the lowest combined revenue are Golf, Volleyball and Gymnastics. As a whole, however, the distribution of combined revenue at University of Denver is uneven.