Assignment 5B

Author

Michael Mayne

Assignment 5B

Assignment 5b Approach

The approach for this assignment is collecting the net data from project 1 and adding to the my R interface and then over viewing the data. The original data I.D. have kept the chess player by their performance so I will avoid adjusting the data sets order at first. I found a general calculation of expected value which gave a value of QA/ (QA+QB) where Q is the 10 ^ (Player ELO/400). I will calculate the average opponents that the player had compared to their real pre-performance score. Then by calculating that data we can made a column for the different getting the best best and worst performers will be a matter of using the tail and head functions.

library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr     1.1.4     ✔ readr     2.1.5
✔ forcats   1.0.0     ✔ stringr   1.5.1
✔ ggplot2   4.0.0     ✔ tibble    3.2.1
✔ lubridate 1.9.4     ✔ tidyr     1.3.1
✔ purrr     1.0.4     
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
Chessround <- read_csv("https://raw.githubusercontent.com/Mayneman000/DATA607Assignment/refs/heads/main/PreparedChessinfo.csv")
New names:
Rows: 64 Columns: 5
── Column specification
──────────────────────────────────────────────────────── Delimiter: "," chr
(2): Name, State dbl (3): ...1, ID, Total Points
ℹ 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.
• `` -> `...1`
print(Chessround)
# A tibble: 64 × 5
    ...1    ID Name                State `Total Points`
   <dbl> <dbl> <chr>               <chr>          <dbl>
 1     1     1 GARY HUA            ON               6  
 2     2     2 DAKSHESH DARURI     MI               6  
 3     3     3 ADITYA BAJAJ        MI               6  
 4     4     4 PATRICK H SCHILLING MI               5.5
 5     5     5 HANSHI ZUO          MI               5.5
 6     6     6 HANSEN SONG         OH               5  
 7     7     7 GARY DEE SWATHELL   MI               5  
 8     8     8 EZEKIEL HOUGHTON    MI               5  
 9     9     9 STEFANO LEE         ON               5  
10    10    10 ANVIT RAO           MI               5  
# ℹ 54 more rows
Opponents <- read.csv("https://raw.githubusercontent.com/Mayneman000/DATA607Assignment/refs/heads/main/OppRating.csv")

Code Base

We can organize or data by collect average ratings by average opponent rating and their # of collect points.

Chess_Results <-  bind_cols(Opponents, Chessround)
New names:
• `...1` -> `...3`
Chess_Results <- Chess_Results%>%
  select(`avg_opp_rating`, `Name`,`ID`, `State`, `Total Points`)

Pre-Rating

Pre_Rating <- c(
1794,
1553,
1384,
1716,
1655,
1686,
1649,
1641,
1411,
1365,
1712,
1663,
1666,
1610,
1220,
1604,
1629,
1600,
1564,
1595,
1563,
1555,
1363,
1229,
1745,
1579,
1552,
1507,
1602,
1522,
1494,
1441,
1449,
1399,
1438,
1355,
980,
1423,
1436,
1348,
1403,
1332,
1283,
1199,
1242,
377,
1362,
1382,
1291,
1056,
1011,
935,
1393,
1270,
1186,
1153,
1092,
917,
853,
984,
979,
1530,
1175,
1163)
# adding a column for play ratings
Chess_Results$Player_Rating <- Pre_Rating

Calculating the Ratio

By using our function mentioned in the approach we are able to caculate the expected # of points that each opponent was expected to get. The we can arrange by their expected score, finally using head() and tail() functiuons we can view the top 5 and bottow 5 scorer

Chess_Calc <- Chess_Results %>%
  mutate(
    Win_Probability = 1 / (1 + 10^((as.numeric(avg_opp_rating) - as.numeric(Player_Rating)) / 400)),
    Expected_Points = Win_Probability * as.numeric(`Total Points`),
    Performance_Gap = `Total Points` - Expected_Points,
    .keep = "unused")
Chess_Calc <- arrange(Chess_Calc,Performance_Gap)

Viewing the top 5 impressive performances and the lowest five performances

head(Chess_Calc)
                  Name ID State Win_Probability Expected_Points Performance_Gap
1        ASHWIN BALAJI 62    MI       0.8787050       0.8787050       0.1212950
2     LOREN SCHWIEBERT 25    MI       0.9001569       3.1505490       0.3494510
3   GEORGE AVERY JONES 30    ON       0.8475387       2.9663855       0.5336145
4 THOMAS JOSEPH HOSMER 63    MI       0.2674927       0.2674927       0.7325073
5     CHIEDOZIE OKORIE 29    MI       0.7731399       2.7059897       0.7940103
6               BEN LI 64    MI       0.1934725       0.1934725       0.8065275
tail(Chess_Calc)
                     Name ID State Win_Probability Expected_Points
59        DAKSHESH DARURI  2    MI      0.48848911       2.9309347
60   AMIYATOSH PWNANANDAM 37    MI      0.04986385       0.1745235
61 ZACHARY JAMES HOUGHTON 15    MI      0.17950479       0.8077716
62              ANVIT RAO 10    MI      0.25200046       1.2600023
63            STEFANO LEE  9    ON      0.21594632       1.0797316
64           ADITYA BAJAJ  3    MI      0.16554082       0.9932449
   Performance_Gap
59        3.069065
60        3.325477
61        3.692228
62        3.739998
63        3.920268
64        5.006755

Conclusions

Due to the data show we can assume that the smallest change in performance is for Ashwin Balaji, Loren Schwiebert,George Avery Jone, Thomas Joseph Hosemer & Chiedozie Okorie. Which the biggest changes are for Amiyatosh PWNANANDAM, Zachary J. Houghton, Anvit Rao, Stefano Lee Aditya Bajaj.

End of Report