For our experiment, we are looking into what factors could affect the race time of an individual.
For this study, 4 different players were chosen:
Cali
Lexi
Stephanie
Lauren
Each of these Players raced the different vehicles. We used 4 different Tracks:
Paris Promenade
Dolphin Shoals
Yoshi Island
Rainbow Road
Two weight class of the digital racer were randomly chosen for each run:
Light
Heavy
Two different vehicle types were chosen for each run:
Kart
Motorcycle
For the vehicles we all used the Standard Motorcylce and the Standard Kart.
Our outcome for this analysis should show us which factors have a significant impact on our race time.
For the design setup, we made sure the controls for each player were the same. We used the 100cc team races and all were on the same team. We each had to be responsible recording our own time which probably added some inconsistency in the recording of the time. All players raced at the same time. The track could not be randomized with the weight class and vehicle type but we did randomize the order in which we played the tracks. Each weight class and vehicle type were then weighted for each individual. So while we all played the same track and at the same time, we randomized the light and heavy characters and the kart and motorcycle vehicle types.
No replications were made. For that we will pool the 3 way interactions into the residuals.
Our data was recorded in minutes and seconds in separate columns but later combined in seconds to the time column.
y_{ijkm} represents the level i of factor \alpha, level j of factor factor \beta, level k of factor \gamma, and level m of factor \delta
\mu is the grand mean of every observation
\epsilon_{ijkm} is the error term. There are 64 observations with 1 observation in each 4-way factor combo.
\alpha_i is the effect of the individuals
1 = Cali
2 = Lexi
3 = Stephanie
4 = Lauren
\beta_j is the effect of the race track
1 = Paris Promenade
2 = Dolphin Shoals
3 = Yoshi Island
4 = Rainbow Road
\gamma_k is the effect of the weight class of chosen racer
1 = Light
2 = Heavy
\delta_m is the effect of the vehicle type
1 = Kart
2 = Motorcycle
EFFECT HYPOTHESES
H_0: \text{Person} (\alpha_\text{i}) = 0 \text{ for all } i \\
H_a: \text{Person} (\alpha_\text{i}) \ne 0 \text{ for some } i
—-
H_0: \text{Track}(\beta_\text{j}) = 0 \text{ for all } j \\
H_a: \text{Track}(\beta_\text{j}) \ne 0 \text{ for some } j
—-
H_0: \text{Weight}(\gamma_k) = 0 \text{ for all } k \\
H_a: \text{Weight}(\gamma_k) \ne 0 \text{ for some } k
—-
H_0: \text{VehicleType}(\delta_m) = 0 \text{ for all } m \\
H_a: \text{VehicleType}(\delta_m) \ne 0 \text{ for some } m
—-
H_0: \text{Person x RaceTrack}((\alpha\beta)_{ij}) = 0 \text{ for all } ij \\
H_a: \text{Person x RaceTrack}((\alpha\beta)_{ij}) \ne 0 \text{ for some } ij
—-
H_0: \text{Person x VehicleType}((\alpha\delta)_{im}) = 0 \text{ for all } im \\
H_a: \text{Person x VehicleType}((\alpha\delta)_{im}) \ne 0 \text{ for some } im
—-
H_0: \text{Weight x VehicleType}((\gamma\delta)_{km}) = 0 \text{ for all } km \\
H_a: \text{Weight x VehicleType}((\gamma\delta)_{km}) \ne 0 \text{ for some } km
—-
H_0: \text{Person x Weight}((\alpha\gamma)_{ik}) = 0 \text{ for all } ik \\
H_a: \text{Person x Weight}((\alpha\gamma)_{ik}) \ne 0 \text{ for some } ik
—-
H_0: \text{Race Track x Weight}((\beta\gamma)_{jk}) = 0 \text{ for all } jk \\
H_a: \text{Race Track x Weight}((\beta\gamma)_{jk}) \ne 0 \text{ for some } jk
—-
H_0: \text{Race Track x VehicleType}((\beta\delta)_{jm}) = 0 \text{ for all } jm \\
H_a: \text{Race Track x VehicleType}((\beta\delta)_{jm}) \ne 0 \text{ for some } jm
Significance level is
\alpha = 0.05
Show the code
mario.aov <-aov(time ~ person + track + weight + kart + person:weight + person:kart + track:weight + track:kart + weight:kart, data = mario)summary(mario.aov) %>% pander
Analysis of Variance Model
Df
Sum Sq
Mean Sq
F value
Pr(>F)
person
3
211.3
70.42
0.1177
0.9492
track
3
18776
6259
10.46
2.891e-05
weight
1
3535
3535
5.907
0.01944
kart
1
90.77
90.77
0.1517
0.6989
person:weight
3
921.3
307.1
0.5132
0.6754
person:kart
3
1167
388.9
0.6499
0.5874
track:weight
3
9535
3178
5.311
0.003401
track:kart
3
2364
787.9
1.317
0.2817
weight:kart
1
28.97
28.97
0.04841
0.8269
Residuals
42
25133
598.4
NA
NA
The analysis revealed that track was the only main effect that reached statistical significance (p = 0.031), suggesting that the choice of track has a meaningful impact on the outcome. The main effects of person (p = 0.972), weight (p = 0.056), and kart (p = 0.755) were not statistically significant at the α = 0.05 level, though weight approached significance and may warrant further investigation. Among the two-way interactions, only the track:weight interaction was statistically significant (p = 0.024), indicating that the effect of track on the response depends on the weight category. The remaining two-way interactions; person:weight, person:kart, track:kart, and weight:kart were all non-significant (all p-values > 0.13), suggesting that these factors do not interact in meaningful ways to influence the outcome. Overall, the results suggest that track selection is the primary factor driving differences in the response variable, with this effect being moderated by weight.
Nintendo Switch MarioKart Racing Person Graph
Show the code
library(ggplot2)library(dplyr)ggplot(mario, aes(x=person, y=time)) +geom_boxplot(aes(fill = person)) +theme_minimal() +scale_fill_manual(values =c("#FE0002", "#fBD000", "#0001FC", "#43B047")) +labs(title ="Nintendo Switch MarioKart Racing Racers' Time To Finish",fill ="Person aka Racer",x ="Person",y ="Time to Finish (seconds)")
When we look at the race times by individual, we notice that there isn’t much variation. The person doesn’t seem to have a huge effect on the race time.
Nintendo Switch MarioKart Racing Person Numerical Summary
Show the code
mario %>%group_by(person) %>%summarise(Average =mean(time, na.rm =TRUE),Min =min(time, na.rm =TRUE), Med =median(time, na.rm =TRUE), Max =max(time, na.rm =TRUE),StDev =sd(time, na.rm =TRUE), SampleSize =n() ) %>%pander()
person
Average
Min
Med
Max
StDev
SampleSize
Cali
174
114.2
183.1
221
31.88
16
Lauren
174.2
114.1
178.7
227.8
31.74
16
Lexi
169.9
110
176
227.2
32.5
16
Stephanie
171.4
116.5
178
226.9
31.98
16
Nintendo Switch MarioKart Racing RaceTrack Mass Graph
Show the code
## lets go a ggplot that's real sexy likelibrary(ggplot2)library(dplyr)mario$track <-as.factor(mario$track)ggplot(mario, aes(x=track, y=time)) +geom_boxplot(aes(fill = track)) +theme_bw() +scale_fill_manual(values =c("azure", "cyan2", "chartreuse2", "darkslateblue")) +labs(title ="Nintendo Switch MarioKart Racing Times per Track ",fill ="Racetrack",x ="Track",y ="Time to Finish (seconds)")
The race tracks definitely have more variation. It appears that Track Number 3, Yoshi Island, has the least amount of variation. Track 4, Rainbow Road, shows a lot of difference in the race time. It could be due to the fact that we each got better as we played it.
RaceTrack Numerical Summary
Show the code
mario %>%group_by(track) %>%summarise(Average =mean(time, na.rm =TRUE),Min =min(time, na.rm =TRUE), Med =median(time, na.rm =TRUE), Max =max(time, na.rm =TRUE),StDev =sd(time, na.rm =TRUE), SampleSize =n() ) %>%pander()
track
Average
Min
Med
Max
StDev
SampleSize
1
151.1
126
145.7
183.7
22.79
16
2
172.1
153
169.4
193.5
14.61
16
3
198.8
184
192.8
225.8
12.91
16
4
167.4
110
166.3
227.8
44.34
16
Nintendo Switch MarioKart Racing Weight Graph
Show the code
## lets go a ggplot that's real sexy likelibrary(ggplot2)library(dplyr)mario$weight <-as.factor(mario$weight)ggplot(mario, aes(x=weight, y=time)) +geom_boxplot(aes(fill = weight)) +theme_bw() +scale_fill_manual(values =c("#FF7810", "seagreen")) +labs(title ="Nintendo Switch MarioKart Racing Time That Each Class Took to Finish",fill ="Character Weight Class",x ="Weight Class",y ="Time to Finish (seconds)")
The mass of the racer does show more difference than we expected to see. In fact, we would have assumed that the lighter character would have been faster, but in fact the heavy character has less variability.
Nintendo Switch MarioKart Racing Weight Numerical Summary
Show the code
mario %>%group_by(weight) %>%summarise(Average =mean(time, na.rm =TRUE),Min =min(time, na.rm =TRUE), Med =median(time, na.rm =TRUE), Max =max(time, na.rm =TRUE),StDev =sd(time, na.rm =TRUE), SampleSize =n() ) %>%pander()
weight
Average
Min
Med
Max
StDev
SampleSize
Heavy
179.8
129.5
184.2
227.8
29.36
32
Light
164.9
110
169.9
225.8
31.88
32
Nintendo Switch MarioKart Racing Kart Mass Graph
Show the code
## lets go a ggplot that's real sexy likelibrary(ggplot2)library(dplyr)mario$weight <-as.factor(mario$weight)ggplot(mario, aes(x=kart, y=time)) +geom_boxplot(aes(fill = kart)) +theme_bw() +scale_fill_manual(values =c("green3", "firebrick2")) +labs(title ="Nintendo Switch MarioKart Racing Time That Each Kart Took to Finish",fill ="Kart Type",x ="Vehicle Type",y ="Time to Finish (seconds)")
The Kart and Motorcylce didn’t seem to affect the race time, however we only used one type of Kart and one type of Motorcycle. Changing the Kart and Motorcycle to have faster acceleration or speed could affect race time but that was not a aprt of this study.
Nintendo Switch MarioKart Racing Kart Numerical Summary
Show the code
mario %>%group_by(kart) %>%summarise(Average =mean(time, na.rm =TRUE),Min =min(time, na.rm =TRUE), Med =median(time, na.rm =TRUE), Max =max(time, na.rm =TRUE),StDev =sd(time, na.rm =TRUE), SampleSize =n() ) %>%pander()
kart
Average
Min
Med
Max
StDev
SampleSize
Kart
173.5
114.1
179
227.8
33.65
32
Motorcycle
171.2
110
179.1
227.2
29.27
32
Nintendo Switch MarioKart Racing Person x Racetrack Interaction Graph
Show the code
library(ggplot2)ggplot(mario, aes(x = track, y = time, color = person, group = person)) +geom_jitter(alpha =0.3, width =0.1) +stat_summary(fun = mean, geom ="point", size =3, shape =18) +stat_summary(fun = mean, geom ="line", size =1) +theme_minimal() +scale_color_manual(values =c("#FE0002", "#fBD000", "#0001FC", "#43B047")) +labs(title ="Nintendo Switch MarioKart Racing Interaction Plot: Track vs. Person",subtitle ="Dots show raw times; Lines show the average time",y ="Time to Complete (seconds)",x ="Track",color ="Racer")
We can see that the race track times by person are consistent, this plot is not showing any obvious differences in the people based on track.
Nintendo Switch MarioKart Racing Person x Racetrack Interaction Numerical Summary
Show the code
mario %>%group_by(person, track) %>%summarise(Average =mean(time, na.rm =TRUE),Min =min(time, na.rm =TRUE), Med =median(time, na.rm =TRUE), Max =max(time, na.rm =TRUE),StDev =sd(time, na.rm =TRUE), SampleSize =n() ) %>%pander()
person
track
Average
Min
Med
Max
StDev
SampleSize
Cali
1
151.5
126.6
149
181.5
27.11
4
Cali
2
174.4
155.8
175.6
190.7
16.17
4
Cali
3
201.9
193.4
198.5
217.3
10.55
4
Cali
4
168.1
114.2
168.6
221
47.08
4
Lauren
1
154.5
134.3
151.5
180.8
23.27
4
Lauren
2
172.3
158
170.2
190.8
14.54
4
Lauren
3
201.2
191
194
225.8
16.54
4
Lauren
4
168.6
114.1
166.3
227.8
49.76
4
Lexi
1
147.6
128
142.7
177.3
23.57
4
Lexi
2
171.1
153
169.4
192.8
16.94
4
Lexi
3
194.9
184
190.2
215.4
14
4
Lexi
4
165.7
110
162.8
227.2
52.17
4
Stephanie
1
150.7
126
146.5
183.7
27.07
4
Stephanie
2
170.7
153
168.1
193.5
17.19
4
Stephanie
3
196.9
187.4
191
218.4
14.4
4
Stephanie
4
167.2
116.5
162.7
226.9
49.1
4
We’ll take a closer look with the post hocs but even in the numerical summary, obvious differences are not easily shown.
Nintendo Switch MarioKart Racing Weight x Kart Interaction Graph
Show the code
library(ggplot2)ggplot(mario, aes(x = kart, y = time, color =factor(weight), group = weight)) +geom_jitter(alpha =0.4, width =0.1) +stat_summary(fun = mean, geom ="point", size =3) +stat_summary(fun = mean, geom ="line", size =1.2) +theme_minimal() +scale_color_manual(values =c("#FF7810", "seagreen")) +labs(title ="Nintendo Switch MarioKart Racing Impact of Weight and Kart on Performance",x ="Kart",y ="Completion Time (seconds)",color ="Weight Class" )
The linear trend between kart type is nearly identical. Light class is almost exactly the same with a kart or a motorcycle but Heavy shows a little bit of a difference with a kart or a motorcycle.
Weight x Kart Interaction Numerical Summary
Show the code
mario %>%group_by(weight, kart) %>%summarise(Average =mean(time, na.rm =TRUE),Min =min(time, na.rm =TRUE), Med =median(time, na.rm =TRUE), Max =max(time, na.rm =TRUE),StDev =sd(time, na.rm =TRUE), SampleSize =n() ) %>%pander()
weight
kart
Average
Min
Med
Max
StDev
SampleSize
Heavy
Kart
181.6
129.5
184.7
227.8
29.3
16
Heavy
Motorcycle
177.9
130.7
184.2
227.2
30.27
16
Light
Kart
165.4
114.1
171.9
225.8
36.64
16
Light
Motorcycle
164.4
110
169.9
193.4
27.52
16
There’s the 1 point difference in the averages for light kart vs motorcycle. Heavy shows a little bit more variation but we’ll take a look at the post hoc to really see.
Nintendo Switch MarioKart Racing Weight x Track Interaction Graph
Show the code
library(ggplot2)ggplot(mario, aes(x = track, y = time, color =factor(weight), group = weight)) +geom_jitter(alpha =0.4, width =0.1) +stat_summary(fun = mean, geom ="point", size =3) +stat_summary(fun = mean, geom ="line", size =1.2) +theme_minimal() +scale_color_manual(values =c("#FF7810", "seagreen")) +labs(title ="Nintendo Switch MarioKart Racing Impact of Track and Weight on Performance",x ="Track",y ="Completion Time (seconds)",color ="Weight Class" )
This is the most interesting interaction plot. There is a steep drop in time for the light weight class when we get to track 4 (Rainbow Road) from the heavy weight class for rainbow road.
Nintendo Switch MarioKart Racing Weight x Track Interaction Numerical Summary
Show the code
mario %>%group_by(weight, track) %>%summarise(Average =mean(time, na.rm =TRUE),Min =min(time, na.rm =TRUE), Med =median(time, na.rm =TRUE), Max =max(time, na.rm =TRUE),StDev =sd(time, na.rm =TRUE), SampleSize =n() ) %>%pander()
weight
track
Average
Min
Med
Max
StDev
SampleSize
Heavy
1
154.3
129.5
148.7
183.7
24.23
8
Heavy
2
169.4
153
165.2
190.8
13.05
8
Heavy
3
199.7
189
196.8
218.4
11.21
8
Heavy
4
195.7
139.7
204.5
227.8
36.43
8
Light
1
147.9
126
143.5
180.8
22.42
8
Light
2
174.8
153
174.5
193.5
16.43
8
Light
3
197.8
184
191.6
225.8
15.14
8
Light
4
139.2
110
127.1
190.2
32.59
8
This numerical summary shows the individual differences for each weight class and each track.
In the Residuals vs Fitted chart there are some outliers, but each of the dots are mostly evenly spread which means constant variance. The Q-Q plot has a few outliers as well but most of the points fall on, or close to the line so we can conclude the residuals look normal. In the Residuals chart there doesn’t appear to be any trends so we can assume independence.
Since a significant interaction between weight and track was observed, along with significant main effects for both factors, Tukey’s Honestly Significant Difference (HSD) post-hoc tests were conducted to examine pairwise differences between tracks and the weight × track interaction. No post-hoc test was performed for weight alone, as it contained only two levels.
A Tukey post-hoc comparison revealed that the Heavy condition differed significantly from the Light condition only on Track 4 (p < 0.001). No significant differences were found between Heavy and Light conditions on Tracks 1, 2, or 3 (all p > 0.05). This confirms what we could see earlier on the interaction plot when looking at the track and weight of the characters.
There appears to be a statistically significant difference between the track 3 and all other tracks. No other tracks seem to differ.
Conclusion & Follow Up
In this analysis we learned that out of our factors, track was the only one to impact race time, which as we played 4 different tracks that were not the same length, this made sense. We also learned that heavy vs light characters had slightly different mean race times, but not enough to be significant at the 0.05 significance level.
In the future it would be interesting to test different types of karts and motorcycles to see if they affect the race time. We could also consider removing person as a fixed factor and randomizing a larger sample of people while using their experience level for our blocking factor.