I'm looking at a comparison of percentages pre/during covid and I'm trying to work out how to show if there is a statistical difference between groups. I'm not sure which statistical test to use and/or how to do it (looking to use R)
Here's the data I'm working with in full integer form:
Team | Covid_flag | Wins | Losses | Total |
---|---|---|---|---|
A | Pre | 27 | 140 | 167 |
A | During | 22 | 157 | 179 |
B | Pre | 123 | 636 | 759 |
B | During | 91 | 486 | 577 |
C | Pre | 544 | 2404 | 2948 |
C | During | 428 | 1975 | 2403 |
D | Pre | 18 | 109 | 127 |
D | During: | 15 | 100 | 115 |
or in percentage (Win rate) form:
Team | Pre_Covid | During_Covid |
---|---|---|
A | 0.162 | 0.123 |
B | 0.162 | 0.158 |
C | 0.185 | 0.178 |
D | 0.142 | 0.130 |
Code to create data tables in R:
TestData <- data.frame(Team=c('A','A','B','B','C','C','D','D'),
Covid_flag=c('Pre','During','Pre','During','Pre','During','Pre','During'),
Wins=c(27,22,123,91,544,428,18,15),
Losses=c(140,157,636,486,2404,1975,109,100))
TestDataRate <- data.frame(Team=c('A','B','C','D'),
Pre=c(.162,.162,.185,.142),
During=c(.123,.158,.178,.130))
Now while I can see that Team A has the biggest drop in win rate, I'm trying to figure out how to show if it's a statistically significant drop compared to the other teams.
I want to do a Chi-Square of the win rate table, but with it being percentages that's not an option, I thought about doing a Chi-Square of the number of wins but I'm not sure if that would account for the different totals pre/during covid?
Any help would be greatly appreciated!