knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(USFSAevents)
set.seed(1234)

Motivation for this Package

Figure Skating Competitions occur periodically in the US, and it is difficult to keep up with the constant increase in data, especially looking at how skaters are doing overall, trends of changes in the sport (such as attempting more difficult elements as years go by), and simple summaries of competition events, since we usually just look at each individual score separately. After/during every competition, the media and competition release each skater's individual protocol for each event they skated at, which includes exact scores for elements, deductions, and various sums in addition to a list of each skater's totals in rank order. However, currently there is no widely used tool to put together each of the skater's data and visualize it or even provide summary statistics. This package is a simple way to be able to input your USFSA event of choice, and look at it from an overall point of view through visualizations and summaries or even look at preinstalled events on the included Shiny app. Specifically, there are 2 functions to create summary tables for a single event, another function to combine the data of two events to be able to compare a skater's scores, and 2 comparison functions to compare specific scores between 2 events to look at if the variation has changed, in addition to others.

Using the Package

This document introduces the basic tools of USFSAevents and the included Shiny app.

Getting the Data

To use any of the other functions in the package, it is important to use anycomp() to read in the html url of the specific USFSA event you would like to look at. As en example, we will be using the Senior Mens Freeskate event from the 2018 US National Championships as Event 1 and the Senior Mens Freeskate event from the 2019 US National Championships as Event 2.

Event1 = anycomp('https://ijs.usfigureskating.org/leaderboard/results/2018/26192/SEGM036.html')
Event2 = anycomp('https://ijs.usfigureskating.org/leaderboard/results/2019/27958/SEGM040.html')
Event1

Summary Tables

Looking at only Event 1, we can produce 2 different summary tables, one for quantitative variables and another for qualitative variables. This can be done using compsumQuan() and compsumQual().

compsumQuan() creates a table for the mean and standard deviation values for Techinical Skating Score (TSS), Technical Element Score (TES), Base Value (bv), Technical Component Score (TCS), and Grade of Execution (GOE) scores, while compsumQual() produces a table for the count and frequency for Deduction values.

compsumQuan(Event1)
compsumQual(Event1)

Variable Variation

After looking at summaries of data numerically, it is also important to be able to visualize the variation of the variables.

Variable variation of quantitative variables can be done through varvariationQuan(), which produces boxplots for TSS, TES, bv, TCS, and GOE scores. On the other hand, varvariationQual(), gives a histogram for Deduction scores.

varvariationQuan(Event1)
varvariationQual(Event1)

Comparisons within one Event

There a few functions in this package that compare values within a single competition in a graphical form.

TechinicaL Skating Score Comparison

First, tsscompareSkater() creates a histogram of the Total Segment Scores for each skater. The Total Segment Score is the sum of all of the individual scores that a skater has earned in one event. This is useful in seeing how different each of the scores are in comaprison to each other.

tsscompareSkater(Event1)

Base Value Score Comparison

bvcompareSkater() compares base value scores for each skater. The base value score is a sum of the base values of all of the planned elements in a single program of one event. Regardless of what actually happens during the skate such as falls or other deductions, the base value score is a great way to compare the level that each skater was attempting to skate at.

bvcompareSkater(Event1)

GOE Score Comparison

goecompare() compares GOE scores for each skater. GOE scores are judges scores that are added on to the base value of each of the completed elements in a program. GOE scores depend entirely on how the skater completed the element and are an average of multiple judges scores, each ranging from -5 to +5.

goecompare(Event1)

Combing the Data for Two Events

This package features a few comparison features for 2 events.

First, we can look at the data for all of the skaters who participated in both events using bothcomp(). Scores for Event 1 are indicated by 1 after the each of the score names, and 2 is used for Event 2.

twoevents = bothcomp(Event1, Event2)
twoevents

Two Event Comparison

Total Segment Score Comparison

To compare the Total Segment Scores between the two events, tsscompareComp() produces side-by-side boxplots of the TSS scores for each of the 2 events. This can help visualize the variation differences between the two events.

tsscompareComp(Event1, Event2)

Base Value Comparison

bvcompareComp() is used to look at the variation in base value scores for the two events. Since the base value scores are the sums of the scores of the elements that each of the skaters were planning on completing in that event, we can compare if skaters were going to attempt more difficult programs in one of the events or if the events look fairly similar in that regard.

bvcompareComp(Event1, Event2)

Using the Shiny App

The Shiny app is generated though runEventApp() and is an interactive form of selecting between a few events that are uploaded. The included events are the US Nationals Senior Mens Short Programs and Freeskates for years 2017, 2018, and 2019, creating a total of 6 total options. The app gives users the opportunity to choose 2 events and look at the event's data as well as produce the visuals that the functions in this package are able to produce using Checkbox selections on the left side of the interface. There are separate options for single event summaries and 2-event comparisons.

runEventApp()

Future Work

There is definitely room for improvement in this package, and beyond adding more event options to the Shiny app, we could look into webscraping more specific variables from the provided html page. Currently, most of the variables used in the package are sums to be able to more easily look at the big picture of the event, but if we are able to get more specific variables such as points of specific elements that each skater chose to perform, we could compare things such as the order of elements of each skater (Ex. are there more jumps in the first half of the program or second half, etc.), or who attempted the "most difficult" element by looking for the element with the most points.

Another point to look at would be adding more events to the Shiny app. Then we could look at a single skater's improvements by comparing their performance at multiple competitions (Ex. are they increasing their Base Value Score every competition, are their GOE scores going up, etc.) for perhaps an entire season, not just two USFSA events.

Assessing the Events themselves, it would be helpful to include details on the competition that the event was held at. This could happen through an additional function or perhaps through the anycomp() function and the Shiny app. Details would be information such as the full name, date, where it was held, and the judges/technical panel names. This information would be useful especially in comparisons and looking at the growth of a skater over time.



ayak9/USFSAevents documentation built on March 1, 2023, 11:17 p.m.