Overview

The goal of this project is to work on three messy datasets given to us by our classmates in the previous discussion by tidying them and running the requested analysis on them.

For this assignment I have chosen the following three datasets.

  1. My own on NBA Games for the 2020-2021 season (until March, 4, 21), which I ask if there is an advantage to having rest in between games and also if there is a homecourt advantage.
  1. Vic Chan’s Canadian Unemployment chart where there is no explicit analysis, but I will see the provinces unemployment rates for the past year.
  1. Claire Meyer’s IMDB Analysis in which she asks whether age has an impact on a movies rating (older the better)

We will accomplish this project in a series of steps which you can find below.

  1. Downloading the data/copying it into a spreadsheet (as is)
  2. Uploading the spreadsheet to Github for access by anyone
  3. Pull each one in and tidy the data
  4. Run an analysis

Load the Required Packages

library('tidyverse')
library("lubridate")
library("kableExtra")

NBA

nba <- read.csv("https://raw.githubusercontent.com/jhumms/DATA607/main/tidyr/basketball.csv",header = TRUE, sep = ",")

let’s begin!

  1. Date - all we need to use is lubridate to parse the date
nba$Date <- mdy(nba$Date)
  1. Now we need to create a new column based on who won
nba$winner <-  ifelse(nba$PTS > nba$PTS.1, "home", "visitor")
  1. Let’s keep the following columns then add in an id column and split them
nba <- nba %>% select(Date, Visitor.Neutral, PTS, Home.Neutral, PTS.1, winner)
nba$game_id <- seq.int(nrow(nba))

home <- nba %>% select(game_id, Date, PTS, Home.Neutral, winner)
away <- nba %>% select(game_id, Date, PTS.1, Visitor.Neutral,  winner)
  1. Now for each we are going to rename the columns and add in one to say if there were the home team or not.
home <- home %>% rename(date=Date, score=PTS, team = Home.Neutral)
away <- away %>% rename(date=Date, score=PTS.1, team = Visitor.Neutral)

home$court <- "home"
away$court <- "visitor"
  1. Finally, let’s add them back together and add in an id column and reorganize
nba <- rbind(home, away)
nba$id <- seq.int(nrow(nba))

nba_tidy <- nba %>% select(id, date, team, game_id, score, court, winner) 

Finally, Tidy!

kable(nba_tidy, "html") %>% kable_styling("striped") %>% scroll_box(width = "100%", height = "350px")
id date team game_id score court winner
1 2020-12-22 Brooklyn Nets 1 99 home visitor
2 2020-12-22 Los Angeles Lakers 2 116 home home
3 2020-12-23 Cleveland Cavaliers 3 114 home visitor
4 2020-12-23 Indiana Pacers 4 107 home visitor
5 2020-12-23 Orlando Magic 5 107 home visitor
6 2020-12-23 Philadelphia 76ers 6 107 home visitor
7 2020-12-23 Toronto Raptors 7 113 home home
8 2020-12-23 Boston Celtics 8 121 home visitor
9 2020-12-23 Chicago Bulls 9 124 home home
10 2020-12-23 Memphis Grizzlies 10 131 home home
11 2020-12-23 Minnesota Timberwolves 11 101 home visitor
12 2020-12-23 Denver Nuggets 12 124 home home
13 2020-12-23 Portland Trail Blazers 13 120 home home
14 2020-12-23 Phoenix Suns 14 102 home visitor
15 2020-12-25 Miami Heat 15 98 home visitor
16 2020-12-25 Milwaukee Bucks 16 99 home visitor
17 2020-12-25 Boston Celtics 17 123 home home
18 2020-12-25 Los Angeles Lakers 18 115 home visitor
19 2020-12-25 Denver Nuggets 19 121 home home
20 2020-12-26 Memphis Grizzlies 20 122 home home
21 2020-12-26 Charlotte Hornets 21 109 home home
22 2020-12-26 Detroit Pistons 22 128 home home
23 2020-12-26 Washington Wizards 23 130 home home
24 2020-12-26 New York Knicks 24 109 home home
25 2020-12-26 Chicago Bulls 25 125 home home
26 2020-12-26 San Antonio Spurs 26 114 home visitor
27 2020-12-26 Utah Jazz 27 116 home home
28 2020-12-26 Portland Trail Blazers 28 126 home visitor
29 2020-12-26 Sacramento Kings 29 103 home visitor
30 2020-12-27 Los Angeles Clippers 30 124 home home
31 2020-12-27 New Orleans Pelicans 31 95 home visitor
32 2020-12-27 Washington Wizards 32 120 home home
33 2020-12-27 Charlotte Hornets 33 104 home visitor
34 2020-12-27 Cleveland Cavaliers 34 94 home visitor
35 2020-12-27 New York Knicks 35 110 home visitor
36 2020-12-27 Indiana Pacers 36 107 home visitor
37 2020-12-27 Chicago Bulls 37 129 home home
38 2020-12-27 Sacramento Kings 38 116 home home
39 2020-12-27 Los Angeles Lakers 39 91 home visitor
40 2020-12-28 Brooklyn Nets 40 116 home home
41 2020-12-28 Atlanta Hawks 41 120 home visitor
42 2020-12-28 Oklahoma City Thunder 42 110 home home
43 2020-12-28 Denver Nuggets 43 111 home visitor
44 2020-12-28 Los Angeles Lakers 44 115 home home
45 2020-12-29 Cleveland Cavaliers 45 95 home home
46 2020-12-29 Detroit Pistons 46 116 home home
47 2020-12-29 Indiana Pacers 47 116 home home
48 2020-12-29 Washington Wizards 48 115 home home
49 2020-12-29 Philadelphia 76ers 49 93 home visitor
50 2020-12-29 Miami Heat 50 144 home home
51 2020-12-29 Oklahoma City Thunder 51 118 home home
52 2020-12-29 Phoenix Suns 52 86 home visitor
53 2020-12-29 Sacramento Kings 53 115 home visitor
54 2020-12-29 Los Angeles Clippers 54 101 home visitor
55 2020-12-30 Miami Heat 55 108 home visitor
56 2020-12-30 Brooklyn Nets 56 141 home visitor
57 2020-12-30 Boston Celtics 57 107 home visitor
58 2020-12-30 Dallas Mavericks 58 118 home home
59 2020-12-30 San Antonio Spurs 59 121 home home
60 2020-12-30 Los Angeles Clippers 60 105 home visitor
61 2020-12-31 Indiana Pacers 61 99 home visitor
62 2020-12-31 Washington Wizards 62 133 home home
63 2020-12-31 Orlando Magic 63 116 home home
64 2020-12-31 Houston Rockets 64 119 home visitor
65 2020-12-31 Toronto Raptors 65 83 home visitor
66 2020-12-31 Oklahoma City Thunder 66 113 home home
67 2020-12-31 Utah Jazz 67 106 home home
68 2021-01-01 Charlotte Hornets 68 108 home home
69 2021-01-01 Dallas Mavericks 69 83 home visitor
70 2021-01-01 Detroit Pistons 70 93 home visitor
71 2021-01-01 Brooklyn Nets 71 114 home home
72 2021-01-01 Milwaukee Bucks 72 96 home visitor
73 2021-01-01 Minnesota Timberwolves 73 130 home home
74 2021-01-01 San Antonio Spurs 74 109 home home
75 2021-01-01 Denver Nuggets 75 106 home home
76 2021-01-01 Utah Jazz 76 100 home visitor
77 2021-01-01 Golden State Warriors 77 123 home home
78 2021-01-02 Houston Rockets 78 94 home visitor
79 2021-01-02 Indiana Pacers 79 106 home home
80 2021-01-02 Orlando Magic 80 108 home home
81 2021-01-02 Philadelphia 76ers 81 112 home visitor
82 2021-01-02 Atlanta Hawks 82 96 home home
83 2021-01-02 New Orleans Pelicans 83 116 home visitor
84 2021-01-03 Detroit Pistons 84 122 home home
85 2021-01-03 Brooklyn Nets 85 123 home home
86 2021-01-03 Memphis Grizzlies 86 108 home home
87 2021-01-03 Minnesota Timberwolves 87 124 home home
88 2021-01-03 San Antonio Spurs 88 130 home home
89 2021-01-03 Chicago Bulls 89 108 home visitor
90 2021-01-03 Phoenix Suns 90 112 home home
91 2021-01-03 Golden State Warriors 91 122 home visitor
92 2021-01-04 Orlando Magic 92 83 home visitor
93 2021-01-04 Philadelphia 76ers 93 101 home visitor
94 2021-01-04 Atlanta Hawks 94 113 home home
95 2021-01-04 Miami Heat 95 90 home visitor
96 2021-01-04 Toronto Raptors 96 126 home home
97 2021-01-04 Houston Rockets 97 113 home home
98 2021-01-04 Milwaukee Bucks 98 115 home visitor
99 2021-01-04 New Orleans Pelicans 99 118 home home
100 2021-01-04 Golden State Warriors 100 106 home visitor
101 2021-01-05 Brooklyn Nets 101 96 home visitor
102 2021-01-05 Memphis Grizzlies 102 94 home home
103 2021-01-05 Denver Nuggets 103 116 home visitor
104 2021-01-05 Los Angeles Clippers 104 116 home home
105 2021-01-05 Portland Trail Blazers 105 111 home home
106 2021-01-06 Indiana Pacers 106 107 home visitor
107 2021-01-06 Orlando Magic 107 94 home visitor
108 2021-01-06 Philadelphia 76ers 108 136 home visitor
109 2021-01-06 Atlanta Hawks 109 102 home home
110 2021-01-06 Miami Heat 110 107 home home
111 2021-01-06 New York Knicks 111 100 home visitor
112 2021-01-06 Milwaukee Bucks 112 115 home visitor
113 2021-01-06 New Orleans Pelicans 113 111 home home
114 2021-01-06 Phoenix Suns 114 115 home visitor
115 2021-01-06 Golden State Warriors 115 108 home home
116 2021-01-06 Sacramento Kings 116 124 home visitor
117 2021-01-07 Brooklyn Nets 117 109 home visitor
118 2021-01-07 Memphis Grizzlies 118 94 home home
119 2021-01-07 Denver Nuggets 119 124 home home
120 2021-01-07 Los Angeles Lakers 120 118 home home
121 2021-01-07 Portland Trail Blazers 121 117 home visitor
122 2021-01-08 Detroit Pistons 122 105 home visitor
123 2021-01-08 Boston Celtics 123 107 home visitor
124 2021-01-08 New Orleans Pelicans 124 118 home home
125 2021-01-08 New York Knicks 125 101 home home
126 2021-01-08 Houston Rockets 126 90 home visitor
127 2021-01-08 Memphis Grizzlies 127 110 home visitor
128 2021-01-08 Milwaukee Bucks 128 131 home home
129 2021-01-08 Golden State Warriors 129 105 home visitor
130 2021-01-08 Los Angeles Lakers 130 115 home visitor
131 2021-01-08 Sacramento Kings 131 144 home home
132 2021-01-09 Philadelphia 76ers 132 115 home home
133 2021-01-09 Charlotte Hornets 133 105 home visitor
134 2021-01-09 Indiana Pacers 134 125 home home
135 2021-01-09 Washington Wizards 135 128 home home
136 2021-01-09 Milwaukee Bucks 136 90 home visitor
137 2021-01-09 Minnesota Timberwolves 137 125 home home
138 2021-01-09 Dallas Mavericks 138 98 home visitor
139 2021-01-09 Sacramento Kings 139 125 home home
140 2021-01-10 Detroit Pistons 140 96 home home
141 2021-01-10 Los Angeles Clippers 141 127 home visitor
142 2021-01-10 Brooklyn Nets 142 129 home home
143 2021-01-10 New York Knicks 143 114 home home
144 2021-01-10 Houston Rockets 144 120 home home
145 2021-01-10 Minnesota Timberwolves 145 88 home visitor
146 2021-01-10 Golden State Warriors 146 105 home visitor
147 2021-01-11 Charlotte Hornets 147 88 home visitor
148 2021-01-11 Cleveland Cavaliers 148 101 home home
149 2021-01-11 Orlando Magic 149 121 home home
150 2021-01-11 Washington Wizards 150 107 home visitor
151 2021-01-11 Atlanta Hawks 151 94 home visitor
152 2021-01-11 Portland Trail Blazers 152 111 home visitor
153 2021-01-11 Sacramento Kings 153 122 home visitor
154 2021-01-12 Philadelphia 76ers 154 134 home visitor
155 2021-01-12 Brooklyn Nets 155 116 home visitor
156 2021-01-12 Cleveland Cavaliers 156 117 home home
157 2021-01-12 Houston Rockets 157 117 home home
158 2021-01-12 Oklahoma City Thunder 158 112 home home
159 2021-01-12 Golden State Warriors 159 104 home home
160 2021-01-13 Charlotte Hornets 160 104 home home
161 2021-01-13 Detroit Pistons 161 110 home home
162 2021-01-13 New York Knicks 162 116 home home
163 2021-01-13 Minnesota Timberwolves 163 118 home home
164 2021-01-13 Oklahoma City Thunder 164 128 home home
165 2021-01-13 Los Angeles Clippers 165 106 home visitor
166 2021-01-13 Sacramento Kings 166 132 home home
167 2021-01-14 Philadelphia 76ers 167 108 home visitor
168 2021-01-14 San Antonio Spurs 168 109 home home
169 2021-01-14 Toronto Raptors 169 108 home visitor
170 2021-01-14 Denver Nuggets 170 104 home visitor
171 2021-01-14 Portland Trail Blazers 171 111 home home
172 2021-01-15 Boston Celtics 172 97 home visitor
173 2021-01-15 Cleveland Cavaliers 173 103 home visitor
174 2021-01-15 Milwaukee Bucks 174 109 home visitor
175 2021-01-15 Oklahoma City Thunder 175 125 home visitor
176 2021-01-15 Utah Jazz 176 92 home visitor
177 2021-01-15 Los Angeles Lakers 177 95 home visitor
178 2021-01-15 Sacramento Kings 178 138 home home
179 2021-01-16 San Antonio Spurs 179 91 home visitor
180 2021-01-16 Brooklyn Nets 180 115 home visitor
181 2021-01-16 Toronto Raptors 181 113 home visitor
182 2021-01-16 Memphis Grizzlies 182 104 home visitor
183 2021-01-16 Miami Heat 183 120 home home
184 2021-01-16 Portland Trail Blazers 184 106 home visitor
185 2021-01-17 Boston Celtics 185 105 home home
186 2021-01-17 Dallas Mavericks 186 117 home home
187 2021-01-17 Denver Nuggets 187 109 home home
188 2021-01-17 Sacramento Kings 188 128 home home
189 2021-01-17 Los Angeles Clippers 189 96 home visitor
190 2021-01-18 New York Knicks 190 84 home visitor
191 2021-01-18 Atlanta Hawks 191 97 home visitor
192 2021-01-18 Portland Trail Blazers 192 125 home home
193 2021-01-18 Memphis Grizzlies 193 104 home visitor
194 2021-01-18 Brooklyn Nets 194 123 home visitor
195 2021-01-18 Toronto Raptors 195 93 home visitor
196 2021-01-18 Chicago Bulls 196 120 home visitor
197 2021-01-18 Miami Heat 197 107 home visitor
198 2021-01-18 Los Angeles Lakers 198 115 home home
199 2021-01-19 Denver Nuggets 199 101 home visitor
200 2021-01-19 Utah Jazz 200 102 home visitor
201 2021-01-20 Cleveland Cavaliers 201 135 home visitor
202 2021-01-20 Indiana Pacers 202 124 home home
203 2021-01-20 Philadelphia 76ers 203 109 home visitor
204 2021-01-20 Atlanta Hawks 204 115 home visitor
205 2021-01-20 Toronto Raptors 205 111 home home
206 2021-01-20 Minnesota Timberwolves 206 97 home home
207 2021-01-20 Houston Rockets 207 109 home home
208 2021-01-20 Golden State Warriors 208 99 home visitor
209 2021-01-20 Los Angeles Clippers 209 96 home visitor
210 2021-01-21 Milwaukee Bucks 210 113 home home
211 2021-01-21 Golden State Warriors 211 119 home home
212 2021-01-21 Utah Jazz 212 118 home visitor
213 2021-01-22 Charlotte Hornets 213 123 home home
214 2021-01-22 Detroit Pistons 214 103 home home
215 2021-01-22 Indiana Pacers 215 118 home visitor
216 2021-01-22 Cleveland Cavaliers 216 113 home visitor
217 2021-01-22 Philadelphia 76ers 217 110 home visitor
218 2021-01-22 Toronto Raptors 218 81 home visitor
219 2021-01-22 Minnesota Timberwolves 219 116 home home
220 2021-01-22 San Antonio Spurs 220 122 home home
221 2021-01-22 Los Angeles Clippers 221 106 home visitor
222 2021-01-22 Phoenix Suns 222 130 home home
223 2021-01-22 Sacramento Kings 223 94 home visitor
224 2021-01-23 Brooklyn Nets 224 124 home visitor
225 2021-01-23 Detroit Pistons 225 114 home home
226 2021-01-23 Minnesota Timberwolves 226 110 home visitor
227 2021-01-23 Chicago Bulls 227 101 home home
228 2021-01-23 Dallas Mavericks 228 133 home home
229 2021-01-23 Phoenix Suns 229 120 home home
230 2021-01-23 Utah Jazz 230 108 home visitor
231 2021-01-24 Indiana Pacers 231 107 home home
232 2021-01-24 Los Angeles Clippers 232 100 home visitor
233 2021-01-24 Boston Celtics 233 103 home visitor
234 2021-01-24 Orlando Magic 234 107 home home
235 2021-01-24 Milwaukee Bucks 235 115 home visitor
236 2021-01-24 San Antonio Spurs 236 101 home visitor
237 2021-01-24 Portland Trail Blazers 237 113 home visitor
238 2021-01-25 Detroit Pistons 238 104 home visitor
239 2021-01-25 Indiana Pacers 239 114 home visitor
240 2021-01-25 Orlando Magic 240 108 home visitor
241 2021-01-25 Brooklyn Nets 241 85 home visitor
242 2021-01-25 Cleveland Cavaliers 242 115 home home
243 2021-01-25 Dallas Mavericks 243 117 home home
244 2021-01-25 Chicago Bulls 244 119 home home
245 2021-01-25 Golden State Warriors 245 108 home visitor
246 2021-01-25 Portland Trail Blazers 246 125 home home
247 2021-01-26 Atlanta Hawks 247 99 home visitor
248 2021-01-26 Houston Rockets 248 88 home visitor
249 2021-01-26 Utah Jazz 249 94 home visitor
250 2021-01-27 Charlotte Hornets 250 116 home home
251 2021-01-27 Cleveland Cavaliers 251 107 home visitor
252 2021-01-27 Orlando Magic 252 121 home home
253 2021-01-27 Atlanta Hawks 253 132 home home
254 2021-01-27 Miami Heat 254 109 home home
255 2021-01-27 Philadelphia 76ers 255 106 home visitor
256 2021-01-27 Toronto Raptors 256 115 home home
257 2021-01-27 San Antonio Spurs 257 106 home visitor
258 2021-01-27 New Orleans Pelicans 258 106 home visitor
259 2021-01-27 Phoenix Suns 259 102 home home
260 2021-01-27 Utah Jazz 260 104 home visitor
261 2021-01-27 Golden State Warriors 261 111 home visitor
262 2021-01-28 Houston Rockets 262 101 home visitor
263 2021-01-28 Detroit Pistons 263 92 home visitor
264 2021-01-28 Miami Heat 264 109 home home
265 2021-01-28 Phoenix Suns 265 93 home visitor
266 2021-01-29 Charlotte Hornets 266 105 home visitor
267 2021-01-29 Washington Wizards 267 116 home home
268 2021-01-29 New Orleans Pelicans 268 126 home visitor
269 2021-01-29 New York Knicks 269 81 home visitor
270 2021-01-29 Toronto Raptors 270 126 home home
271 2021-01-29 Minnesota Timberwolves 271 118 home home
272 2021-01-29 Oklahoma City Thunder 272 147 home home
273 2021-01-29 Orlando Magic 273 116 home home
274 2021-01-29 San Antonio Spurs 274 109 home visitor
275 2021-01-29 Utah Jazz 275 101 home visitor
276 2021-01-30 Chicago Bulls 276 123 home home
277 2021-01-30 Charlotte Hornets 277 114 home visitor
278 2021-01-30 Miami Heat 278 104 home visitor
279 2021-01-30 New Orleans Pelicans 279 126 home home
280 2021-01-30 Boston Celtics 280 96 home home
281 2021-01-30 San Antonio Spurs 281 129 home home
282 2021-01-30 Dallas Mavericks 282 111 home home
283 2021-01-30 Golden State Warriors 283 91 home visitor
284 2021-01-31 New York Knicks 284 129 home home
285 2021-01-31 Denver Nuggets 285 117 home visitor
286 2021-01-31 Indiana Pacers 286 119 home home
287 2021-01-31 Toronto Raptors 287 102 home visitor
288 2021-01-31 Washington Wizards 288 146 home visitor
289 2021-01-31 Minnesota Timberwolves 289 104 home visitor
290 2021-02-01 Atlanta Hawks 290 107 home home
291 2021-02-01 Miami Heat 291 129 home home
292 2021-02-01 Chicago Bulls 292 102 home visitor
293 2021-02-01 Cleveland Cavaliers 293 98 home visitor
294 2021-02-01 Milwaukee Bucks 294 106 home visitor
295 2021-02-01 New Orleans Pelicans 295 118 home home
296 2021-02-01 Oklahoma City Thunder 296 136 home home
297 2021-02-01 Dallas Mavericks 297 109 home home
298 2021-02-01 San Antonio Spurs 298 133 home home
299 2021-02-02 Orlando Magic 299 123 home home
300 2021-02-02 Brooklyn Nets 300 120 home visitor
301 2021-02-02 Indiana Pacers 301 116 home visitor
302 2021-02-02 Washington Wizards 302 132 home home
303 2021-02-02 Golden State Warriors 303 111 home home
304 2021-02-02 Utah Jazz 304 105 home visitor
305 2021-02-03 Charlotte Hornets 305 118 home home
306 2021-02-03 Milwaukee Bucks 306 110 home visitor
307 2021-02-03 Atlanta Hawks 307 122 home home
308 2021-02-03 Chicago Bulls 308 107 home home
309 2021-02-03 Cleveland Cavaliers 309 121 home home
310 2021-02-03 Miami Heat 310 103 home home
311 2021-02-03 Oklahoma City Thunder 311 87 home visitor
312 2021-02-03 San Antonio Spurs 312 108 home visitor
313 2021-02-03 New Orleans Pelicans 313 101 home visitor
314 2021-02-03 Sacramento Kings 314 111 home visitor
315 2021-02-04 Atlanta Hawks 315 112 home home
316 2021-02-04 Dallas Mavericks 316 147 home home
317 2021-02-04 Philadelphia 76ers 317 121 home home
318 2021-02-04 Memphis Grizzlies 318 115 home home
319 2021-02-04 Los Angeles Lakers 319 93 home visitor
320 2021-02-05 Indiana Pacers 320 114 home home
321 2021-02-05 Orlando Magic 321 119 home visitor
322 2021-02-05 Brooklyn Nets 322 123 home home
323 2021-02-05 Cleveland Cavaliers 323 123 home home
324 2021-02-05 Charlotte Hornets 324 138 home home
325 2021-02-05 Miami Heat 325 95 home visitor
326 2021-02-05 Oklahoma City Thunder 326 106 home home
327 2021-02-05 Phoenix Suns 327 92 home visitor
328 2021-02-05 Los Angeles Clippers 328 119 home home
329 2021-02-06 New York Knicks 329 99 home visitor
330 2021-02-06 Sacramento Kings 330 114 home visitor
331 2021-02-06 Orlando Magic 331 118 home home
332 2021-02-06 Atlanta Hawks 332 121 home visitor
333 2021-02-06 Cleveland Cavaliers 333 124 home home
334 2021-02-06 Houston Rockets 334 111 home home
335 2021-02-06 Oklahoma City Thunder 335 118 home visitor
336 2021-02-06 Philadelphia 76ers 336 108 home visitor
337 2021-02-06 Dallas Mavericks 337 132 home visitor
338 2021-02-06 New Orleans Pelicans 338 109 home visitor
339 2021-02-06 Los Angeles Lakers 339 129 home visitor
340 2021-02-07 Charlotte Hornets 340 97 home visitor
341 2021-02-07 Indiana Pacers 341 103 home home
342 2021-02-07 New York Knicks 342 109 home home
343 2021-02-07 Phoenix Suns 343 91 home visitor
344 2021-02-07 Los Angeles Clippers 344 113 home home
345 2021-02-08 Charlotte Hornets 345 94 home visitor
346 2021-02-08 Chicago Bulls 346 105 home home
347 2021-02-08 Memphis Grizzlies 347 128 home home
348 2021-02-08 Dallas Mavericks 348 122 home visitor
349 2021-02-08 San Antonio Spurs 349 100 home visitor
350 2021-02-08 Phoenix Suns 350 113 home visitor
351 2021-02-08 Denver Nuggets 351 125 home home
352 2021-02-08 Los Angeles Lakers 352 112 home visitor
353 2021-02-09 Detroit Pistons 353 111 home visitor
354 2021-02-09 Miami Heat 354 96 home visitor
355 2021-02-09 New Orleans Pelicans 355 101 home visitor
356 2021-02-09 San Antonio Spurs 356 114 home home
357 2021-02-09 Portland Trail Blazers 357 97 home visitor
358 2021-02-09 Sacramento Kings 358 119 home home
359 2021-02-09 Utah Jazz 359 108 home visitor
360 2021-02-10 Washington Wizards 360 137 home home
361 2021-02-10 Dallas Mavericks 361 117 home visitor
362 2021-02-10 Brooklyn Nets 362 94 home visitor
363 2021-02-10 Memphis Grizzlies 363 114 home visitor
364 2021-02-10 Minnesota Timberwolves 364 119 home home
365 2021-02-10 Chicago Bulls 365 116 home visitor
366 2021-02-10 Denver Nuggets 366 95 home visitor
367 2021-02-10 Los Angeles Lakers 367 113 home visitor
368 2021-02-10 Phoenix Suns 368 124 home visitor
369 2021-02-11 Boston Celtics 369 106 home visitor
370 2021-02-11 Houston Rockets 370 101 home home
371 2021-02-11 Detroit Pistons 371 111 home home
372 2021-02-11 Golden State Warriors 372 105 home visitor
373 2021-02-11 Portland Trail Blazers 373 114 home visitor
374 2021-02-12 Charlotte Hornets 374 114 home visitor
375 2021-02-12 Washington Wizards 375 109 home home
376 2021-02-12 Atlanta Hawks 376 125 home home
377 2021-02-12 Dallas Mavericks 377 130 home visitor
378 2021-02-12 Boston Celtics 378 108 home home
379 2021-02-12 Chicago Bulls 379 125 home home
380 2021-02-12 Denver Nuggets 380 95 home visitor
381 2021-02-12 Utah Jazz 381 115 home visitor
382 2021-02-12 Los Angeles Lakers 382 105 home visitor
383 2021-02-12 Portland Trail Blazers 383 110 home visitor
384 2021-02-12 Sacramento Kings 384 123 home home
385 2021-02-13 Phoenix Suns 385 111 home visitor
386 2021-02-13 Atlanta Hawks 386 125 home home
387 2021-02-13 New York Knicks 387 99 home visitor
388 2021-02-13 Golden State Warriors 388 134 home home
389 2021-02-13 Utah Jazz 389 94 home visitor
390 2021-02-14 Washington Wizards 390 91 home visitor
391 2021-02-14 Charlotte Hornets 391 122 home home
392 2021-02-14 Detroit Pistons 392 112 home visitor
393 2021-02-14 Toronto Raptors 393 116 home home
394 2021-02-14 Dallas Mavericks 394 121 home home
395 2021-02-14 Oklahoma City Thunder 395 109 home visitor
396 2021-02-14 Phoenix Suns 396 90 home visitor
397 2021-02-14 Denver Nuggets 397 105 home visitor
398 2021-02-14 Los Angeles Clippers 398 111 home visitor
399 2021-02-14 Sacramento Kings 399 124 home home
400 2021-02-15 Indiana Pacers 400 120 home home
401 2021-02-15 Washington Wizards 401 119 home visitor
402 2021-02-15 New York Knicks 402 112 home visitor
403 2021-02-15 Utah Jazz 403 123 home visitor
404 2021-02-15 Golden State Warriors 404 98 home visitor
405 2021-02-15 Los Angeles Clippers 405 118 home visitor
406 2021-02-15 Sacramento Kings 406 136 home home
407 2021-02-16 Boston Celtics 407 99 home visitor
408 2021-02-16 Memphis Grizzlies 408 144 home home
409 2021-02-16 Milwaukee Bucks 409 124 home home
410 2021-02-16 Minnesota Timberwolves 410 112 home home
411 2021-02-16 Oklahoma City Thunder 411 115 home home
412 2021-02-16 Phoenix Suns 412 128 home home
413 2021-02-17 Orlando Magic 413 89 home visitor
414 2021-02-17 Boston Celtics 414 122 home home
415 2021-02-17 Philadelphia 76ers 415 113 home visitor
416 2021-02-17 Chicago Bulls 416 102 home visitor
417 2021-02-17 Minnesota Timberwolves 417 134 home home
418 2021-02-17 Washington Wizards 418 128 home visitor
419 2021-02-17 Memphis Grizzlies 419 113 home visitor
420 2021-02-17 New Orleans Pelicans 420 126 home home
421 2021-02-17 Golden State Warriors 421 112 home visitor
422 2021-02-17 Los Angeles Clippers 422 114 home home
423 2021-02-18 Milwaukee Bucks 423 110 home home
424 2021-02-18 Los Angeles Lakers 424 109 home home
425 2021-02-18 Sacramento Kings 425 118 home home
426 2021-02-19 Cleveland Cavaliers 426 120 home home
427 2021-02-19 Orlando Magic 427 120 home visitor
428 2021-02-19 Boston Celtics 428 109 home visitor
429 2021-02-19 Philadelphia 76ers 429 105 home visitor
430 2021-02-19 Memphis Grizzlies 430 95 home visitor
431 2021-02-19 Milwaukee Bucks 431 85 home visitor
432 2021-02-19 New Orleans Pelicans 432 132 home home
433 2021-02-19 Minnesota Timberwolves 433 86 home home
434 2021-02-19 Los Angeles Clippers 434 112 home visitor
435 2021-02-20 Charlotte Hornets 435 100 home visitor
436 2021-02-20 Los Angeles Lakers 436 96 home home
437 2021-02-20 Chicago Bulls 437 114 home visitor
438 2021-02-20 Memphis Grizzlies 438 128 home home
439 2021-02-20 Portland Trail Blazers 439 118 home home
440 2021-02-21 New Orleans Pelicans 440 115 home visitor
441 2021-02-21 Cleveland Cavaliers 441 117 home home
442 2021-02-21 New York Knicks 442 99 home visitor
443 2021-02-21 Orlando Magic 443 96 home visitor
444 2021-02-21 Toronto Raptors 444 103 home visitor
445 2021-02-21 Atlanta Hawks 445 115 home visitor
446 2021-02-21 Los Angeles Clippers 446 112 home home
447 2021-02-21 Milwaukee Bucks 447 115 home visitor
448 2021-02-22 Houston Rockets 448 120 home home
449 2021-02-22 Dallas Mavericks 449 92 home visitor
450 2021-02-22 Oklahoma City Thunder 450 108 home home
451 2021-02-22 Phoenix Suns 451 100 home visitor
452 2021-02-22 Utah Jazz 452 110 home visitor
453 2021-02-22 Los Angeles Lakers 453 127 home home
454 2021-02-23 Cleveland Cavaliers 454 111 home visitor
455 2021-02-23 Orlando Magic 455 105 home home
456 2021-02-23 Brooklyn Nets 456 118 home visitor
457 2021-02-23 Dallas Mavericks 457 107 home visitor
458 2021-02-23 New York Knicks 458 114 home home
459 2021-02-23 Toronto Raptors 459 109 home home
460 2021-02-23 Milwaukee Bucks 460 112 home visitor
461 2021-02-23 Denver Nuggets 461 106 home visitor
462 2021-02-23 Los Angeles Clippers 462 116 home visitor
463 2021-02-24 Atlanta Hawks 463 112 home visitor
464 2021-02-24 Cleveland Cavaliers 464 96 home visitor
465 2021-02-24 Indiana Pacers 465 111 home home
466 2021-02-24 Chicago Bulls 466 126 home visitor
467 2021-02-24 Miami Heat 467 108 home visitor
468 2021-02-24 New Orleans Pelicans 468 118 home visitor
469 2021-02-24 Oklahoma City Thunder 469 99 home visitor
470 2021-02-24 Phoenix Suns 470 124 home home
471 2021-02-24 Utah Jazz 471 89 home visitor
472 2021-02-25 Philadelphia 76ers 472 97 home visitor
473 2021-02-25 Brooklyn Nets 473 92 home visitor
474 2021-02-25 New York Knicks 474 121 home visitor
475 2021-02-25 Memphis Grizzlies 475 94 home visitor
476 2021-02-25 Denver Nuggets 476 112 home home
477 2021-02-25 Milwaukee Bucks 477 125 home visitor
478 2021-02-26 Boston Celtics 478 112 home visitor
479 2021-02-26 Toronto Raptors 479 111 home visitor
480 2021-02-26 Chicago Bulls 480 106 home home
481 2021-02-26 Detroit Pistons 481 110 home home
482 2021-02-26 Memphis Grizzlies 482 119 home home
483 2021-02-26 Miami Heat 483 116 home visitor
484 2021-02-26 Oklahoma City Thunder 484 109 home visitor
485 2021-02-26 Golden State Warriors 485 121 home visitor
486 2021-02-26 Los Angeles Lakers 486 93 home visitor
487 2021-02-27 Philadelphia 76ers 487 112 home home
488 2021-02-27 Washington Wizards 488 112 home visitor
489 2021-02-27 New York Knicks 489 107 home visitor
490 2021-02-27 Oklahoma City Thunder 490 126 home home
491 2021-02-27 Orlando Magic 491 124 home home
492 2021-02-27 San Antonio Spurs 492 114 home visitor
493 2021-02-27 Brooklyn Nets 493 115 home home
494 2021-02-28 Milwaukee Bucks 494 100 home visitor
495 2021-02-28 Boston Celtics 495 110 home visitor
496 2021-02-28 Detroit Pistons 496 109 home home
497 2021-02-28 Houston Rockets 497 133 home home
498 2021-02-28 Los Angeles Lakers 498 91 home visitor
499 2021-02-28 Miami Heat 499 99 home visitor
500 2021-02-28 Minnesota Timberwolves 500 118 home home
501 2021-02-28 Sacramento Kings 501 127 home home
502 2021-03-01 Orlando Magic 502 130 home home
503 2021-03-01 Philadelphia 76ers 503 114 home visitor
504 2021-03-01 Chicago Bulls 504 118 home home
505 2021-03-01 New Orleans Pelicans 505 124 home visitor
506 2021-03-01 San Antonio Spurs 506 124 home home
507 2021-03-01 Houston Rockets 507 101 home home
508 2021-03-01 Portland Trail Blazers 508 111 home visitor
509 2021-03-02 Washington Wizards 509 125 home home
510 2021-03-02 Boston Celtics 510 112 home visitor
511 2021-03-02 Miami Heat 511 94 home home
512 2021-03-02 San Antonio Spurs 512 93 home visitor
513 2021-03-02 Milwaukee Bucks 513 128 home home
514 2021-03-02 Los Angeles Lakers 514 114 home home
515 2021-03-03 Cleveland Cavaliers 515 114 home home
516 2021-03-03 Philadelphia 76ers 516 123 home visitor
517 2021-03-03 Toronto Raptors 517 129 home home
518 2021-03-03 Houston Rockets 518 132 home home
519 2021-03-03 Minnesota Timberwolves 519 135 home home
520 2021-03-03 New Orleans Pelicans 520 128 home home
521 2021-03-03 Orlando Magic 521 115 home home
522 2021-03-03 Dallas Mavericks 522 78 home visitor
523 2021-03-03 Portland Trail Blazers 523 106 home visitor
524 2021-03-03 Sacramento Kings 524 120 home visitor
525 2021-03-04 Boston Celtics 525 125 home visitor
526 2021-03-04 Washington Wizards 526 117 home visitor
527 2021-03-04 New York Knicks 527 104 home visitor
528 2021-03-04 Indiana Pacers 528 113 home home
529 2021-03-04 Memphis Grizzlies 529 112 home home
530 2021-03-04 New Orleans Pelicans 530 103 home home
531 2021-03-04 San Antonio Spurs 531 107 home home
532 2021-03-04 Phoenix Suns 532 98 home visitor
533 2021-03-04 Portland Trail Blazers 533 119 home visitor
534 2020-12-22 Golden State Warriors 1 125 visitor visitor
535 2020-12-22 Los Angeles Clippers 2 109 visitor home
536 2020-12-23 Charlotte Hornets 3 121 visitor visitor
537 2020-12-23 New York Knicks 4 121 visitor visitor
538 2020-12-23 Miami Heat 5 113 visitor visitor
539 2020-12-23 Washington Wizards 6 113 visitor visitor
540 2020-12-23 New Orleans Pelicans 7 99 visitor home
541 2020-12-23 Milwaukee Bucks 8 122 visitor visitor
542 2020-12-23 Atlanta Hawks 9 104 visitor home
543 2020-12-23 San Antonio Spurs 10 119 visitor home
544 2020-12-23 Detroit Pistons 11 111 visitor visitor
545 2020-12-23 Sacramento Kings 12 122 visitor home
546 2020-12-23 Utah Jazz 13 100 visitor home
547 2020-12-23 Dallas Mavericks 14 106 visitor visitor
548 2020-12-25 New Orleans Pelicans 15 111 visitor visitor
549 2020-12-25 Golden State Warriors 16 138 visitor visitor
550 2020-12-25 Brooklyn Nets 17 95 visitor home
551 2020-12-25 Dallas Mavericks 18 138 visitor visitor
552 2020-12-25 Los Angeles Clippers 19 108 visitor home
553 2020-12-26 Atlanta Hawks 20 112 visitor home
554 2020-12-26 Oklahoma City Thunder 21 107 visitor home
555 2020-12-26 Cleveland Cavaliers 22 119 visitor home
556 2020-12-26 Orlando Magic 23 120 visitor home
557 2020-12-26 Philadelphia 76ers 24 89 visitor home
558 2020-12-26 Indiana Pacers 25 106 visitor home
559 2020-12-26 Toronto Raptors 26 119 visitor visitor
560 2020-12-26 Minnesota Timberwolves 27 111 visitor home
561 2020-12-26 Houston Rockets 28 128 visitor visitor
562 2020-12-26 Phoenix Suns 29 106 visitor visitor
563 2020-12-27 Dallas Mavericks 30 73 visitor home
564 2020-12-27 San Antonio Spurs 31 98 visitor visitor
565 2020-12-27 Orlando Magic 32 113 visitor home
566 2020-12-27 Brooklyn Nets 33 106 visitor visitor
567 2020-12-27 Philadelphia 76ers 34 118 visitor visitor
568 2020-12-27 Milwaukee Bucks 35 130 visitor visitor
569 2020-12-27 Boston Celtics 36 108 visitor visitor
570 2020-12-27 Golden State Warriors 37 128 visitor home
571 2020-12-27 Phoenix Suns 38 100 visitor home
572 2020-12-27 Minnesota Timberwolves 39 127 visitor visitor
573 2020-12-28 Memphis Grizzlies 40 111 visitor home
574 2020-12-28 Detroit Pistons 41 128 visitor visitor
575 2020-12-28 Utah Jazz 42 109 visitor home
576 2020-12-28 Houston Rockets 43 124 visitor visitor
577 2020-12-28 Portland Trail Blazers 44 107 visitor home
578 2020-12-29 New York Knicks 45 86 visitor home
579 2020-12-29 Golden State Warriors 46 106 visitor home
580 2020-12-29 Boston Celtics 47 111 visitor home
581 2020-12-29 Chicago Bulls 48 107 visitor home
582 2020-12-29 Toronto Raptors 49 100 visitor visitor
583 2020-12-29 Milwaukee Bucks 50 97 visitor home
584 2020-12-29 Orlando Magic 51 107 visitor home
585 2020-12-29 New Orleans Pelicans 52 111 visitor visitor
586 2020-12-29 Denver Nuggets 53 125 visitor visitor
587 2020-12-29 Minnesota Timberwolves 54 124 visitor visitor
588 2020-12-30 Milwaukee Bucks 55 119 visitor visitor
589 2020-12-30 Atlanta Hawks 56 145 visitor visitor
590 2020-12-30 Memphis Grizzlies 57 126 visitor visitor
591 2020-12-30 Charlotte Hornets 58 99 visitor home
592 2020-12-30 Los Angeles Lakers 59 107 visitor home
593 2020-12-30 Portland Trail Blazers 60 128 visitor visitor
594 2020-12-31 Cleveland Cavaliers 61 119 visitor visitor
595 2020-12-31 Chicago Bulls 62 130 visitor home
596 2020-12-31 Philadelphia 76ers 63 92 visitor home
597 2020-12-31 Sacramento Kings 64 122 visitor visitor
598 2020-12-31 New York Knicks 65 100 visitor visitor
599 2020-12-31 New Orleans Pelicans 66 80 visitor home
600 2020-12-31 Phoenix Suns 67 95 visitor home
601 2021-01-01 Memphis Grizzlies 68 93 visitor home
602 2021-01-01 Miami Heat 69 93 visitor visitor
603 2021-01-01 Boston Celtics 70 96 visitor visitor
604 2021-01-01 Atlanta Hawks 71 96 visitor home
605 2021-01-01 Chicago Bulls 72 126 visitor visitor
606 2021-01-01 Washington Wizards 73 109 visitor home
607 2021-01-01 Los Angeles Lakers 74 103 visitor home
608 2021-01-01 Phoenix Suns 75 103 visitor home
609 2021-01-01 Los Angeles Clippers 76 106 visitor visitor
610 2021-01-01 Portland Trail Blazers 77 98 visitor home
611 2021-01-02 Sacramento Kings 78 102 visitor visitor
612 2021-01-02 New York Knicks 79 102 visitor home
613 2021-01-02 Oklahoma City Thunder 80 99 visitor home
614 2021-01-02 Charlotte Hornets 81 127 visitor visitor
615 2021-01-02 Cleveland Cavaliers 82 91 visitor home
616 2021-01-02 Toronto Raptors 83 120 visitor visitor
617 2021-01-03 Boston Celtics 84 120 visitor home
618 2021-01-03 Washington Wizards 85 122 visitor home
619 2021-01-03 Los Angeles Lakers 86 94 visitor home
620 2021-01-03 Denver Nuggets 87 109 visitor home
621 2021-01-03 Utah Jazz 88 109 visitor home
622 2021-01-03 Dallas Mavericks 89 118 visitor visitor
623 2021-01-03 Los Angeles Clippers 90 107 visitor home
624 2021-01-03 Portland Trail Blazers 91 137 visitor visitor
625 2021-01-04 Cleveland Cavaliers 92 103 visitor visitor
626 2021-01-04 Charlotte Hornets 93 118 visitor visitor
627 2021-01-04 New York Knicks 94 108 visitor home
628 2021-01-04 Oklahoma City Thunder 95 118 visitor visitor
629 2021-01-04 Boston Celtics 96 114 visitor home
630 2021-01-04 Dallas Mavericks 97 100 visitor home
631 2021-01-04 Detroit Pistons 98 125 visitor visitor
632 2021-01-04 Indiana Pacers 99 116 visitor home
633 2021-01-04 Sacramento Kings 100 137 visitor visitor
634 2021-01-05 Utah Jazz 101 130 visitor visitor
635 2021-01-05 Los Angeles Lakers 102 92 visitor home
636 2021-01-05 Minnesota Timberwolves 103 123 visitor visitor
637 2021-01-05 San Antonio Spurs 104 113 visitor home
638 2021-01-05 Chicago Bulls 105 108 visitor home
639 2021-01-06 Houston Rockets 106 114 visitor visitor
640 2021-01-06 Cleveland Cavaliers 107 105 visitor visitor
641 2021-01-06 Washington Wizards 108 141 visitor visitor
642 2021-01-06 Charlotte Hornets 109 94 visitor home
643 2021-01-06 Boston Celtics 110 105 visitor home
644 2021-01-06 Utah Jazz 111 112 visitor visitor
645 2021-01-06 Detroit Pistons 112 130 visitor visitor
646 2021-01-06 Oklahoma City Thunder 113 110 visitor home
647 2021-01-06 Toronto Raptors 114 123 visitor visitor
648 2021-01-06 Los Angeles Clippers 115 101 visitor home
649 2021-01-06 Chicago Bulls 116 128 visitor visitor
650 2021-01-07 Philadelphia 76ers 117 122 visitor visitor
651 2021-01-07 Cleveland Cavaliers 118 90 visitor home
652 2021-01-07 Dallas Mavericks 119 117 visitor home
653 2021-01-07 San Antonio Spurs 120 109 visitor home
654 2021-01-07 Minnesota Timberwolves 121 135 visitor visitor
655 2021-01-08 Phoenix Suns 122 110 visitor visitor
656 2021-01-08 Washington Wizards 123 116 visitor visitor
657 2021-01-08 Charlotte Hornets 124 110 visitor home
658 2021-01-08 Oklahoma City Thunder 125 89 visitor home
659 2021-01-08 Orlando Magic 126 132 visitor visitor
660 2021-01-08 Brooklyn Nets 127 115 visitor visitor
661 2021-01-08 Utah Jazz 128 118 visitor home
662 2021-01-08 Los Angeles Clippers 129 115 visitor visitor
663 2021-01-08 Chicago Bulls 130 117 visitor visitor
664 2021-01-08 Toronto Raptors 131 123 visitor home
665 2021-01-09 Denver Nuggets 132 103 visitor home
666 2021-01-09 Atlanta Hawks 133 113 visitor visitor
667 2021-01-09 Phoenix Suns 134 117 visitor home
668 2021-01-09 Miami Heat 135 124 visitor home
669 2021-01-09 Cleveland Cavaliers 136 100 visitor visitor
670 2021-01-09 San Antonio Spurs 137 122 visitor home
671 2021-01-09 Orlando Magic 138 112 visitor visitor
672 2021-01-09 Portland Trail Blazers 139 99 visitor home
673 2021-01-10 Utah Jazz 140 86 visitor home
674 2021-01-10 Chicago Bulls 141 130 visitor visitor
675 2021-01-10 Oklahoma City Thunder 142 116 visitor home
676 2021-01-10 Denver Nuggets 143 89 visitor home
677 2021-01-10 Los Angeles Lakers 144 102 visitor home
678 2021-01-10 San Antonio Spurs 145 96 visitor visitor
679 2021-01-10 Toronto Raptors 146 106 visitor visitor
680 2021-01-11 New York Knicks 147 109 visitor visitor
681 2021-01-11 Memphis Grizzlies 148 91 visitor home
682 2021-01-11 Milwaukee Bucks 149 99 visitor home
683 2021-01-11 Phoenix Suns 150 128 visitor visitor
684 2021-01-11 Philadelphia 76ers 151 112 visitor visitor
685 2021-01-11 Toronto Raptors 152 112 visitor visitor
686 2021-01-11 Indiana Pacers 153 127 visitor visitor
687 2021-01-12 Miami Heat 154 137 visitor visitor
688 2021-01-12 Denver Nuggets 155 122 visitor visitor
689 2021-01-12 Utah Jazz 156 87 visitor home
690 2021-01-12 Los Angeles Lakers 157 100 visitor home
691 2021-01-12 San Antonio Spurs 158 102 visitor home
692 2021-01-12 Indiana Pacers 159 95 visitor home
693 2021-01-13 Dallas Mavericks 160 93 visitor home
694 2021-01-13 Milwaukee Bucks 161 101 visitor home
695 2021-01-13 Brooklyn Nets 162 109 visitor home
696 2021-01-13 Memphis Grizzlies 163 107 visitor home
697 2021-01-13 Los Angeles Lakers 164 99 visitor home
698 2021-01-13 New Orleans Pelicans 165 111 visitor visitor
699 2021-01-13 Portland Trail Blazers 166 126 visitor home
700 2021-01-14 Miami Heat 167 125 visitor visitor
701 2021-01-14 Houston Rockets 168 105 visitor home
702 2021-01-14 Charlotte Hornets 169 111 visitor visitor
703 2021-01-14 Golden State Warriors 170 114 visitor visitor
704 2021-01-14 Indiana Pacers 171 87 visitor home
705 2021-01-15 Orlando Magic 172 124 visitor visitor
706 2021-01-15 New York Knicks 173 106 visitor visitor
707 2021-01-15 Dallas Mavericks 174 112 visitor visitor
708 2021-01-15 Chicago Bulls 175 127 visitor visitor
709 2021-01-15 Atlanta Hawks 176 116 visitor visitor
710 2021-01-15 New Orleans Pelicans 177 112 visitor visitor
711 2021-01-15 Los Angeles Clippers 178 100 visitor home
712 2021-01-16 Houston Rockets 179 103 visitor visitor
713 2021-01-16 Orlando Magic 180 122 visitor visitor
714 2021-01-16 Charlotte Hornets 181 116 visitor visitor
715 2021-01-16 Philadelphia 76ers 182 106 visitor visitor
716 2021-01-16 Detroit Pistons 183 100 visitor home
717 2021-01-16 Atlanta Hawks 184 112 visitor visitor
718 2021-01-17 New York Knicks 185 75 visitor home
719 2021-01-17 Chicago Bulls 186 101 visitor home
720 2021-01-17 Utah Jazz 187 105 visitor home
721 2021-01-17 New Orleans Pelicans 188 123 visitor home
722 2021-01-17 Indiana Pacers 189 129 visitor visitor
723 2021-01-18 Orlando Magic 190 91 visitor visitor
724 2021-01-18 Minnesota Timberwolves 191 108 visitor visitor
725 2021-01-18 San Antonio Spurs 192 104 visitor home
726 2021-01-18 Phoenix Suns 193 108 visitor visitor
727 2021-01-18 Milwaukee Bucks 194 125 visitor visitor
728 2021-01-18 Dallas Mavericks 195 116 visitor visitor
729 2021-01-18 Houston Rockets 196 125 visitor visitor
730 2021-01-18 Detroit Pistons 197 113 visitor visitor
731 2021-01-18 Golden State Warriors 198 113 visitor home
732 2021-01-19 Oklahoma City Thunder 199 119 visitor visitor
733 2021-01-19 New Orleans Pelicans 200 118 visitor visitor
734 2021-01-20 Brooklyn Nets 201 147 visitor visitor
735 2021-01-20 Dallas Mavericks 202 112 visitor home
736 2021-01-20 Boston Celtics 203 117 visitor visitor
737 2021-01-20 Detroit Pistons 204 123 visitor visitor
738 2021-01-20 Miami Heat 205 102 visitor home
739 2021-01-20 Orlando Magic 206 96 visitor home
740 2021-01-20 Phoenix Suns 207 103 visitor home
741 2021-01-20 San Antonio Spurs 208 121 visitor visitor
742 2021-01-20 Sacramento Kings 209 115 visitor visitor
743 2021-01-21 Los Angeles Lakers 210 106 visitor home
744 2021-01-21 New York Knicks 211 104 visitor home
745 2021-01-21 New Orleans Pelicans 212 129 visitor visitor
746 2021-01-22 Chicago Bulls 213 110 visitor home
747 2021-01-22 Houston Rockets 214 102 visitor home
748 2021-01-22 Orlando Magic 215 120 visitor visitor
749 2021-01-22 Brooklyn Nets 216 125 visitor visitor
750 2021-01-22 Boston Celtics 217 122 visitor visitor
751 2021-01-22 Miami Heat 218 101 visitor visitor
752 2021-01-22 Atlanta Hawks 219 98 visitor home
753 2021-01-22 Dallas Mavericks 220 117 visitor home
754 2021-01-22 Oklahoma City Thunder 221 120 visitor visitor
755 2021-01-22 Denver Nuggets 222 126 visitor home
756 2021-01-22 New York Knicks 223 103 visitor visitor
757 2021-01-23 Miami Heat 224 128 visitor visitor
758 2021-01-23 Philadelphia 76ers 225 110 visitor home
759 2021-01-23 New Orleans Pelicans 226 120 visitor visitor
760 2021-01-23 Los Angeles Lakers 227 90 visitor home
761 2021-01-23 Houston Rockets 228 108 visitor home
762 2021-01-23 Denver Nuggets 229 112 visitor home
763 2021-01-23 Golden State Warriors 230 127 visitor visitor
764 2021-01-24 Toronto Raptors 231 102 visitor home
765 2021-01-24 Oklahoma City Thunder 232 108 visitor visitor
766 2021-01-24 Cleveland Cavaliers 233 141 visitor visitor
767 2021-01-24 Charlotte Hornets 234 104 visitor home
768 2021-01-24 Atlanta Hawks 235 129 visitor visitor
769 2021-01-24 Washington Wizards 236 121 visitor visitor
770 2021-01-24 New York Knicks 237 116 visitor visitor
771 2021-01-25 Philadelphia 76ers 238 119 visitor visitor
772 2021-01-25 Toronto Raptors 239 129 visitor visitor
773 2021-01-25 Charlotte Hornets 240 117 visitor visitor
774 2021-01-25 Miami Heat 241 98 visitor visitor
775 2021-01-25 Los Angeles Lakers 242 108 visitor home
776 2021-01-25 Denver Nuggets 243 113 visitor home
777 2021-01-25 Boston Celtics 244 103 visitor home
778 2021-01-25 Minnesota Timberwolves 245 130 visitor visitor
779 2021-01-25 Oklahoma City Thunder 246 122 visitor home
780 2021-01-26 Los Angeles Clippers 247 108 visitor visitor
781 2021-01-26 Washington Wizards 248 107 visitor visitor
782 2021-01-26 New York Knicks 249 108 visitor visitor
783 2021-01-27 Indiana Pacers 250 106 visitor home
784 2021-01-27 Detroit Pistons 251 122 visitor visitor
785 2021-01-27 Sacramento Kings 252 107 visitor home
786 2021-01-27 Brooklyn Nets 253 128 visitor home
787 2021-01-27 Denver Nuggets 254 82 visitor home
788 2021-01-27 Los Angeles Lakers 255 107 visitor visitor
789 2021-01-27 Milwaukee Bucks 256 108 visitor home
790 2021-01-27 Boston Celtics 257 110 visitor visitor
791 2021-01-27 Washington Wizards 258 124 visitor visitor
792 2021-01-27 Oklahoma City Thunder 259 97 visitor home
793 2021-01-27 Dallas Mavericks 260 116 visitor visitor
794 2021-01-27 Minnesota Timberwolves 261 123 visitor visitor
795 2021-01-28 Portland Trail Blazers 262 104 visitor visitor
796 2021-01-28 Los Angeles Lakers 263 107 visitor visitor
797 2021-01-28 Los Angeles Clippers 264 105 visitor home
798 2021-01-28 Golden State Warriors 265 114 visitor visitor
799 2021-01-29 Indiana Pacers 266 108 visitor visitor
800 2021-01-29 Atlanta Hawks 267 100 visitor home
801 2021-01-29 Milwaukee Bucks 268 131 visitor visitor
802 2021-01-29 Cleveland Cavaliers 269 102 visitor visitor
803 2021-01-29 Sacramento Kings 270 124 visitor home
804 2021-01-29 Philadelphia 76ers 271 94 visitor home
805 2021-01-29 Brooklyn Nets 272 125 visitor home
806 2021-01-29 Los Angeles Clippers 273 90 visitor home
807 2021-01-29 Denver Nuggets 274 119 visitor visitor
808 2021-01-29 Dallas Mavericks 275 120 visitor visitor
809 2021-01-30 Portland Trail Blazers 276 122 visitor home
810 2021-01-30 Milwaukee Bucks 277 126 visitor visitor
811 2021-01-30 Sacramento Kings 278 105 visitor visitor
812 2021-01-30 Houston Rockets 279 112 visitor home
813 2021-01-30 Los Angeles Lakers 280 95 visitor home
814 2021-01-30 Memphis Grizzlies 281 112 visitor home
815 2021-01-30 Phoenix Suns 282 105 visitor home
816 2021-01-30 Detroit Pistons 283 118 visitor visitor
817 2021-01-31 Los Angeles Clippers 284 115 visitor home
818 2021-01-31 Utah Jazz 285 128 visitor visitor
819 2021-01-31 Philadelphia 76ers 286 110 visitor home
820 2021-01-31 Orlando Magic 287 115 visitor visitor
821 2021-01-31 Brooklyn Nets 288 149 visitor visitor
822 2021-01-31 Cleveland Cavaliers 289 109 visitor visitor
823 2021-02-01 Los Angeles Lakers 290 99 visitor home
824 2021-02-01 Charlotte Hornets 291 121 visitor home
825 2021-02-01 New York Knicks 292 110 visitor visitor
826 2021-02-01 Minnesota Timberwolves 293 100 visitor visitor
827 2021-02-01 Portland Trail Blazers 294 134 visitor visitor
828 2021-02-01 Sacramento Kings 295 109 visitor home
829 2021-02-01 Houston Rockets 296 106 visitor home
830 2021-02-01 Phoenix Suns 297 108 visitor home
831 2021-02-01 Memphis Grizzlies 298 102 visitor home
832 2021-02-02 Toronto Raptors 299 108 visitor home
833 2021-02-02 Los Angeles Clippers 300 124 visitor visitor
834 2021-02-02 Memphis Grizzlies 301 134 visitor visitor
835 2021-02-02 Portland Trail Blazers 302 121 visitor home
836 2021-02-02 Boston Celtics 303 107 visitor home
837 2021-02-02 Detroit Pistons 304 117 visitor visitor
838 2021-02-03 Philadelphia 76ers 305 111 visitor home
839 2021-02-03 Indiana Pacers 306 130 visitor visitor
840 2021-02-03 Dallas Mavericks 307 116 visitor home
841 2021-02-03 New York Knicks 308 103 visitor home
842 2021-02-03 Los Angeles Clippers 309 99 visitor home
843 2021-02-03 Washington Wizards 310 100 visitor home
844 2021-02-03 Houston Rockets 311 104 visitor visitor
845 2021-02-03 Minnesota Timberwolves 312 111 visitor visitor
846 2021-02-03 Phoenix Suns 313 123 visitor visitor
847 2021-02-03 Boston Celtics 314 116 visitor visitor
848 2021-02-04 Utah Jazz 315 91 visitor home
849 2021-02-04 Golden State Warriors 316 116 visitor home
850 2021-02-04 Portland Trail Blazers 317 105 visitor home
851 2021-02-04 Houston Rockets 318 103 visitor home
852 2021-02-04 Denver Nuggets 319 114 visitor visitor
853 2021-02-05 New Orleans Pelicans 320 113 visitor home
854 2021-02-05 Chicago Bulls 321 123 visitor visitor
855 2021-02-05 Toronto Raptors 322 117 visitor home
856 2021-02-05 Milwaukee Bucks 323 105 visitor home
857 2021-02-05 Utah Jazz 324 121 visitor home
858 2021-02-05 Washington Wizards 325 122 visitor visitor
859 2021-02-05 Minnesota Timberwolves 326 103 visitor home
860 2021-02-05 Detroit Pistons 327 109 visitor visitor
861 2021-02-05 Boston Celtics 328 115 visitor home
862 2021-02-06 Portland Trail Blazers 329 110 visitor visitor
863 2021-02-06 Denver Nuggets 330 119 visitor visitor
864 2021-02-06 Chicago Bulls 331 92 visitor home
865 2021-02-06 Toronto Raptors 332 132 visitor visitor
866 2021-02-06 Milwaukee Bucks 333 99 visitor home
867 2021-02-06 San Antonio Spurs 334 106 visitor home
868 2021-02-06 Minnesota Timberwolves 335 120 visitor visitor
869 2021-02-06 Brooklyn Nets 336 124 visitor visitor
870 2021-02-06 Golden State Warriors 337 134 visitor visitor
871 2021-02-06 Memphis Grizzlies 338 118 visitor visitor
872 2021-02-06 Detroit Pistons 339 135 visitor visitor
873 2021-02-07 Washington Wizards 340 119 visitor visitor
874 2021-02-07 Utah Jazz 341 95 visitor home
875 2021-02-07 Miami Heat 342 103 visitor home
876 2021-02-07 Boston Celtics 343 100 visitor visitor
877 2021-02-07 Sacramento Kings 344 110 visitor home
878 2021-02-08 Houston Rockets 345 119 visitor visitor
879 2021-02-08 Washington Wizards 346 101 visitor home
880 2021-02-08 Toronto Raptors 347 113 visitor home
881 2021-02-08 Minnesota Timberwolves 348 127 visitor visitor
882 2021-02-08 Golden State Warriors 349 105 visitor visitor
883 2021-02-08 Cleveland Cavaliers 350 119 visitor visitor
884 2021-02-08 Milwaukee Bucks 351 112 visitor home
885 2021-02-08 Oklahoma City Thunder 352 119 visitor visitor
886 2021-02-09 Brooklyn Nets 353 122 visitor visitor
887 2021-02-09 New York Knicks 354 98 visitor visitor
888 2021-02-09 Houston Rockets 355 130 visitor visitor
889 2021-02-09 Golden State Warriors 356 91 visitor home
890 2021-02-09 Orlando Magic 357 106 visitor visitor
891 2021-02-09 Philadelphia 76ers 358 111 visitor home
892 2021-02-09 Boston Celtics 359 122 visitor visitor
893 2021-02-10 Toronto Raptors 360 115 visitor home
894 2021-02-10 Atlanta Hawks 361 118 visitor visitor
895 2021-02-10 Indiana Pacers 362 104 visitor visitor
896 2021-02-10 Charlotte Hornets 363 130 visitor visitor
897 2021-02-10 Los Angeles Clippers 364 112 visitor home
898 2021-02-10 New Orleans Pelicans 365 129 visitor visitor
899 2021-02-10 Cleveland Cavaliers 366 133 visitor visitor
900 2021-02-10 Oklahoma City Thunder 367 114 visitor visitor
901 2021-02-10 Milwaukee Bucks 368 125 visitor visitor
902 2021-02-11 Toronto Raptors 369 120 visitor visitor
903 2021-02-11 Miami Heat 370 94 visitor home
904 2021-02-11 Indiana Pacers 371 95 visitor home
905 2021-02-11 Orlando Magic 372 111 visitor visitor
906 2021-02-11 Philadelphia 76ers 373 118 visitor visitor
907 2021-02-12 Minnesota Timberwolves 374 120 visitor visitor
908 2021-02-12 New York Knicks 375 91 visitor home
909 2021-02-12 San Antonio Spurs 376 114 visitor home
910 2021-02-12 New Orleans Pelicans 377 143 visitor visitor
911 2021-02-12 Detroit Pistons 378 102 visitor home
912 2021-02-12 Los Angeles Clippers 379 106 visitor home
913 2021-02-12 Oklahoma City Thunder 380 97 visitor visitor
914 2021-02-12 Milwaukee Bucks 381 129 visitor visitor
915 2021-02-12 Memphis Grizzlies 382 115 visitor visitor
916 2021-02-12 Cleveland Cavaliers 383 129 visitor visitor
917 2021-02-12 Orlando Magic 384 112 visitor home
918 2021-02-13 Philadelphia 76ers 385 120 visitor visitor
919 2021-02-13 Indiana Pacers 386 113 visitor home
920 2021-02-13 Houston Rockets 387 121 visitor visitor
921 2021-02-13 Brooklyn Nets 388 117 visitor home
922 2021-02-13 Miami Heat 389 112 visitor visitor
923 2021-02-14 Boston Celtics 390 104 visitor visitor
924 2021-02-14 San Antonio Spurs 391 110 visitor home
925 2021-02-14 New Orleans Pelicans 392 123 visitor visitor
926 2021-02-14 Minnesota Timberwolves 393 112 visitor home
927 2021-02-14 Portland Trail Blazers 394 118 visitor home
928 2021-02-14 Milwaukee Bucks 395 114 visitor visitor
929 2021-02-14 Orlando Magic 396 109 visitor visitor
930 2021-02-14 Los Angeles Lakers 397 122 visitor visitor
931 2021-02-14 Cleveland Cavaliers 398 128 visitor visitor
932 2021-02-14 Memphis Grizzlies 399 110 visitor home
933 2021-02-15 Chicago Bulls 400 112 visitor home
934 2021-02-15 Houston Rockets 401 131 visitor visitor
935 2021-02-15 Atlanta Hawks 402 123 visitor visitor
936 2021-02-15 Philadelphia 76ers 403 134 visitor visitor
937 2021-02-15 Cleveland Cavaliers 404 129 visitor visitor
938 2021-02-15 Miami Heat 405 125 visitor visitor
939 2021-02-15 Brooklyn Nets 406 125 visitor home
940 2021-02-16 Denver Nuggets 407 112 visitor visitor
941 2021-02-16 New Orleans Pelicans 408 113 visitor home
942 2021-02-16 Toronto Raptors 409 113 visitor home
943 2021-02-16 Los Angeles Lakers 410 104 visitor home
944 2021-02-16 Portland Trail Blazers 411 104 visitor home
945 2021-02-16 Brooklyn Nets 412 124 visitor home
946 2021-02-17 New York Knicks 413 107 visitor visitor
947 2021-02-17 Atlanta Hawks 414 114 visitor home
948 2021-02-17 Houston Rockets 415 118 visitor visitor
949 2021-02-17 Detroit Pistons 416 105 visitor visitor
950 2021-02-17 Indiana Pacers 417 128 visitor home
951 2021-02-17 Denver Nuggets 418 130 visitor visitor
952 2021-02-17 Oklahoma City Thunder 419 122 visitor visitor
953 2021-02-17 Portland Trail Blazers 420 124 visitor home
954 2021-02-17 Miami Heat 421 120 visitor visitor
955 2021-02-17 Utah Jazz 422 96 visitor home
956 2021-02-18 Toronto Raptors 423 96 visitor home
957 2021-02-18 Brooklyn Nets 424 98 visitor home
958 2021-02-18 Miami Heat 425 110 visitor home
959 2021-02-19 Denver Nuggets 426 103 visitor home
960 2021-02-19 Golden State Warriors 427 124 visitor visitor
961 2021-02-19 Atlanta Hawks 428 121 visitor visitor
962 2021-02-19 Chicago Bulls 429 112 visitor visitor
963 2021-02-19 Detroit Pistons 430 109 visitor visitor
964 2021-02-19 Oklahoma City Thunder 431 98 visitor visitor
965 2021-02-19 Phoenix Suns 432 114 visitor home
966 2021-02-19 Toronto Raptors 433 81 visitor home
967 2021-02-19 Utah Jazz 434 116 visitor visitor
968 2021-02-20 Golden State Warriors 435 102 visitor visitor
969 2021-02-20 Miami Heat 436 94 visitor home
970 2021-02-20 Sacramento Kings 437 122 visitor visitor
971 2021-02-20 Phoenix Suns 438 97 visitor home
972 2021-02-20 Washington Wizards 439 111 visitor home
973 2021-02-21 Boston Celtics 440 120 visitor visitor
974 2021-02-21 Oklahoma City Thunder 441 101 visitor home
975 2021-02-21 Minnesota Timberwolves 442 103 visitor visitor
976 2021-02-21 Detroit Pistons 443 105 visitor visitor
977 2021-02-21 Philadelphia 76ers 444 110 visitor visitor
978 2021-02-21 Denver Nuggets 445 123 visitor visitor
979 2021-02-21 Brooklyn Nets 446 108 visitor home
980 2021-02-21 Sacramento Kings 447 128 visitor visitor
981 2021-02-22 Chicago Bulls 448 100 visitor home
982 2021-02-22 Memphis Grizzlies 449 102 visitor visitor
983 2021-02-22 Miami Heat 450 94 visitor home
984 2021-02-22 Portland Trail Blazers 451 132 visitor visitor
985 2021-02-22 Charlotte Hornets 452 132 visitor visitor
986 2021-02-22 Washington Wizards 453 124 visitor home
987 2021-02-23 Atlanta Hawks 454 112 visitor visitor
988 2021-02-23 Detroit Pistons 455 93 visitor home
989 2021-02-23 Sacramento Kings 456 127 visitor visitor
990 2021-02-23 Boston Celtics 457 110 visitor visitor
991 2021-02-23 Golden State Warriors 458 106 visitor home
992 2021-02-23 Philadelphia 76ers 459 102 visitor home
993 2021-02-23 Minnesota Timberwolves 460 139 visitor visitor
994 2021-02-23 Portland Trail Blazers 461 111 visitor visitor
995 2021-02-23 Washington Wizards 462 135 visitor visitor
996 2021-02-24 Boston Celtics 463 127 visitor visitor
997 2021-02-24 Houston Rockets 464 112 visitor visitor
998 2021-02-24 Golden State Warriors 465 107 visitor home
999 2021-02-24 Minnesota Timberwolves 466 133 visitor visitor
1000 2021-02-24 Toronto Raptors 467 116 visitor visitor
1001 2021-02-24 Detroit Pistons 468 128 visitor visitor
1002 2021-02-24 San Antonio Spurs 469 102 visitor visitor
1003 2021-02-24 Charlotte Hornets 470 121 visitor home
1004 2021-02-24 Los Angeles Lakers 471 114 visitor visitor
1005 2021-02-25 Dallas Mavericks 472 111 visitor visitor
1006 2021-02-25 Orlando Magic 473 129 visitor visitor
1007 2021-02-25 Sacramento Kings 474 140 visitor visitor
1008 2021-02-25 Los Angeles Clippers 475 122 visitor visitor
1009 2021-02-25 Washington Wizards 476 110 visitor home
1010 2021-02-25 New Orleans Pelicans 477 129 visitor visitor
1011 2021-02-26 Indiana Pacers 478 118 visitor visitor
1012 2021-02-26 Houston Rockets 479 122 visitor visitor
1013 2021-02-26 Phoenix Suns 480 97 visitor home
1014 2021-02-26 Sacramento Kings 481 107 visitor home
1015 2021-02-26 Los Angeles Clippers 482 99 visitor home
1016 2021-02-26 Utah Jazz 483 124 visitor visitor
1017 2021-02-26 Atlanta Hawks 484 118 visitor visitor
1018 2021-02-26 Charlotte Hornets 485 130 visitor visitor
1019 2021-02-26 Portland Trail Blazers 486 102 visitor visitor
1020 2021-02-27 Cleveland Cavaliers 487 109 visitor home
1021 2021-02-27 Minnesota Timberwolves 488 128 visitor visitor
1022 2021-02-27 Indiana Pacers 489 110 visitor visitor
1023 2021-02-27 Denver Nuggets 490 96 visitor home
1024 2021-02-27 Utah Jazz 491 109 visitor home
1025 2021-02-27 New Orleans Pelicans 492 117 visitor visitor
1026 2021-02-27 Dallas Mavericks 493 98 visitor home
1027 2021-02-28 Los Angeles Clippers 494 105 visitor visitor
1028 2021-02-28 Washington Wizards 495 111 visitor visitor
1029 2021-02-28 New York Knicks 496 90 visitor home
1030 2021-02-28 Memphis Grizzlies 497 84 visitor home
1031 2021-02-28 Golden State Warriors 498 117 visitor visitor
1032 2021-02-28 Atlanta Hawks 499 109 visitor visitor
1033 2021-02-28 Phoenix Suns 500 99 visitor home
1034 2021-02-28 Charlotte Hornets 501 126 visitor home
1035 2021-03-01 Dallas Mavericks 502 124 visitor home
1036 2021-03-01 Indiana Pacers 503 130 visitor visitor
1037 2021-03-01 Denver Nuggets 504 112 visitor home
1038 2021-03-01 Utah Jazz 505 129 visitor visitor
1039 2021-03-01 Brooklyn Nets 506 113 visitor home
1040 2021-03-01 Cleveland Cavaliers 507 90 visitor home
1041 2021-03-01 Charlotte Hornets 508 123 visitor visitor
1042 2021-03-02 Memphis Grizzlies 509 111 visitor home
1043 2021-03-02 Los Angeles Clippers 510 117 visitor visitor
1044 2021-03-02 Atlanta Hawks 511 80 visitor home
1045 2021-03-02 New York Knicks 512 119 visitor visitor
1046 2021-03-02 Denver Nuggets 513 97 visitor home
1047 2021-03-02 Phoenix Suns 514 104 visitor home
1048 2021-03-03 Indiana Pacers 515 111 visitor home
1049 2021-03-03 Utah Jazz 516 131 visitor visitor
1050 2021-03-03 Detroit Pistons 517 105 visitor home
1051 2021-03-03 Brooklyn Nets 518 114 visitor home
1052 2021-03-03 Charlotte Hornets 519 102 visitor home
1053 2021-03-03 Chicago Bulls 520 124 visitor home
1054 2021-03-03 Atlanta Hawks 521 112 visitor home
1055 2021-03-03 Oklahoma City Thunder 522 87 visitor visitor
1056 2021-03-03 Golden State Warriors 523 108 visitor visitor
1057 2021-03-03 Los Angeles Lakers 524 123 visitor visitor
1058 2021-03-04 Toronto Raptors 525 132 visitor visitor
1059 2021-03-04 Los Angeles Clippers 526 119 visitor visitor
1060 2021-03-04 Detroit Pistons 527 114 visitor visitor
1061 2021-03-04 Denver Nuggets 528 103 visitor home
1062 2021-03-04 Milwaukee Bucks 529 111 visitor home
1063 2021-03-04 Miami Heat 530 93 visitor home
1064 2021-03-04 Oklahoma City Thunder 531 102 visitor home
1065 2021-03-04 Golden State Warriors 532 120 visitor visitor
1066 2021-03-04 Sacramento Kings 533 123 visitor visitor

And it looks much more tidy now! It’s time for the analyses.
1. Find out if there was a homecourt advantage
2. Find out if rest in between games gave an advantage

Homecourt Advantage

Let’s find out if there is such a thing as the homecourt advantage.

nba$winner <- as.factor(nba$winner)
kable(nba %>% count(court = nba$winner), "html") %>% kable_styling("striped") %>% scroll_box(width = "100%", height = "350px")
court n
home 496
visitor 570

The data shows that there is not any homecourt advantage, but, since this is 2020-2021 season and there are very few fans in the audience, maybe it was the fan-base that motivated extra performance. For this I would download all the NBA games from the past ~20 years and see if it makes a difference.

Rest Advantage

This analysis is a bit more complicated, for it we need to measure the time in between games and then see if that helped them win. 1. We need to create a table for all the teams 2. We need to calculate the time in between games and then match it back to the main table

In my opinion the easiest way to do this is create a loop for each team that subtracts the days from each other.

Thanks to greghk for the tip on subtracting rows

nba_time <- data.frame()


for (i in unique(nba$team)) 
{
  team_name <- nba %>% 
    select(id, date) %>% 
    filter(nba$team == i) %>% 
    arrange(desc(date))
  
  team_name <- within(team_name, rest_days <- c(0,diff(date)))
  team_name$rest_days <- abs(team_name$rest_days) 
  
  nba_time <- rbind(nba_time, team_name)
}

nba_time <- nba_time %>% select('id', 'rest_days')

nba <- inner_join(nba_time, nba, by = c('id'))

And now it is time for an analysis!
First, let’s see what typical days off look like.

kable(nba %>% count(court = nba$rest_days), "html") %>% kable_styling("striped") %>% scroll_box(width = "100%", height = "350px")
court n
0 30
1 197
2 681
3 125
4 15
5 8
6 3
7 3
8 1
10 1
12 1
13 1

It looks like very few teams have more than three days of rest. So we will clump everyone over three days as 3 and also add in something to show it they won or lost.

nba$rest <- ifelse(nba$rest_days == 0 & nba$winner == nba$court, "won_zero", 
                   ifelse(nba$rest_days == 1 & nba$winner == nba$court, "won_one", 
                   ifelse(nba$rest_days == 2 & nba$winner == nba$court, "won_two",
                   ifelse(nba$rest_days > 2 & nba$winner == nba$court, "won_three",
                   ifelse(nba$rest_days == 0 & nba$winner != nba$court, "lost_zero", 
                   ifelse(nba$rest_days == 1 & nba$winner != nba$court, "lost_one", 
                   ifelse(nba$rest_days == 2 & nba$winner != nba$court, "lost_two",
                   ifelse(nba$rest_days > 2 & nba$winner != nba$court, "lost_three",
                   NA))))))))


kable(nba %>% count(court = nba$rest)%>% arrange((court)), "html") %>% kable_styling("striped") %>% scroll_box(width = "100%", height = "350px")
court n
lost_one 98
lost_three 74
lost_two 346
lost_zero 15
won_one 99
won_three 84
won_two 335
won_zero 15

There are some minor differences between having two and three days off, but overall, it does not seem like it would be a factor that determines who wins the game.

Canada Unemployment

canada <- read.csv("https://raw.githubusercontent.com/jhumms/DATA607/main/tidyr/canada_unemplyment.csv",header = TRUE, sep = ",")

This is truly an ugly data set, but fortunately, looking at all the columns, all we need are the date, location, the value, and the labor type (in this dataframe, the unemployment rate is already determined, we just have to pull it out).

canada_un <- canada %>% select(1,2,VALUE,Labour.force.characteristics)

And that should make it Tidy!

kable(canada_un, "html") %>% kable_styling("striped") %>% scroll_box(width = "100%", height = "350px")
ï..REF_DATE GEO VALUE Labour.force.characteristics
2020-09 Canada 31114.6 Population
2020-10 Canada 31138.8 Population
2020-11 Canada 31161.3 Population
2020-12 Canada 31177.5 Population
2021-01 Canada 31191.2 Population
2020-09 Canada 20246.7 Labour force
2020-10 Canada 20316.2 Labour force
2020-11 Canada 20279.9 Labour force
2020-12 Canada 20258.8 Labour force
2021-01 Canada 20171.0 Labour force
2020-09 Canada 18388.5 Employment
2020-10 Canada 18482.9 Employment
2020-11 Canada 18537.5 Employment
2020-12 Canada 18484.8 Employment
2021-01 Canada 18272.0 Employment
2020-09 Canada 14909.2 Full-time employment
2020-10 Canada 14967.3 Full-time employment
2020-11 Canada 15077.0 Full-time employment
2020-12 Canada 15119.7 Full-time employment
2021-01 Canada 15132.3 Full-time employment
2020-09 Canada 3479.3 Part-time employment
2020-10 Canada 3515.6 Part-time employment
2020-11 Canada 3460.5 Part-time employment
2020-12 Canada 3365.1 Part-time employment
2021-01 Canada 3139.7 Part-time employment
2020-09 Canada 1858.2 Unemployment
2020-10 Canada 1833.2 Unemployment
2020-11 Canada 1742.5 Unemployment
2020-12 Canada 1773.9 Unemployment
2021-01 Canada 1899.0 Unemployment
2020-09 Canada 9.2 Unemployment rate
2020-10 Canada 9.0 Unemployment rate
2020-11 Canada 8.6 Unemployment rate
2020-12 Canada 8.8 Unemployment rate
2021-01 Canada 9.4 Unemployment rate
2020-09 Canada 65.1 Participation rate
2020-10 Canada 65.2 Participation rate
2020-11 Canada 65.1 Participation rate
2020-12 Canada 65.0 Participation rate
2021-01 Canada 64.7 Participation rate
2020-09 Canada 59.1 Employment rate
2020-10 Canada 59.4 Employment rate
2020-11 Canada 59.5 Employment rate
2020-12 Canada 59.3 Employment rate
2021-01 Canada 58.6 Employment rate
2020-09 Newfoundland and Labrador 445.5 Population
2020-10 Newfoundland and Labrador 445.4 Population
2020-11 Newfoundland and Labrador 445.4 Population
2020-12 Newfoundland and Labrador 445.4 Population
2021-01 Newfoundland and Labrador 445.3 Population
2020-09 Newfoundland and Labrador 256.5 Labour force
2020-10 Newfoundland and Labrador 256.9 Labour force
2020-11 Newfoundland and Labrador 258.6 Labour force
2020-12 Newfoundland and Labrador 257.2 Labour force
2021-01 Newfoundland and Labrador 254.5 Labour force
2020-09 Newfoundland and Labrador 217.4 Employment
2020-10 Newfoundland and Labrador 223.5 Employment
2020-11 Newfoundland and Labrador 226.5 Employment
2020-12 Newfoundland and Labrador 224.8 Employment
2021-01 Newfoundland and Labrador 222.1 Employment
2020-09 Newfoundland and Labrador 182.5 Full-time employment
2020-10 Newfoundland and Labrador 186.4 Full-time employment
2020-11 Newfoundland and Labrador 188.8 Full-time employment
2020-12 Newfoundland and Labrador 188.5 Full-time employment
2021-01 Newfoundland and Labrador 185.4 Full-time employment
2020-09 Newfoundland and Labrador 34.9 Part-time employment
2020-10 Newfoundland and Labrador 37.1 Part-time employment
2020-11 Newfoundland and Labrador 37.7 Part-time employment
2020-12 Newfoundland and Labrador 36.3 Part-time employment
2021-01 Newfoundland and Labrador 36.7 Part-time employment
2020-09 Newfoundland and Labrador 39.1 Unemployment
2020-10 Newfoundland and Labrador 33.5 Unemployment
2020-11 Newfoundland and Labrador 32.2 Unemployment
2020-12 Newfoundland and Labrador 32.4 Unemployment
2021-01 Newfoundland and Labrador 32.5 Unemployment
2020-09 Newfoundland and Labrador 15.2 Unemployment rate
2020-10 Newfoundland and Labrador 13.0 Unemployment rate
2020-11 Newfoundland and Labrador 12.5 Unemployment rate
2020-12 Newfoundland and Labrador 12.6 Unemployment rate
2021-01 Newfoundland and Labrador 12.8 Unemployment rate
2020-09 Newfoundland and Labrador 57.6 Participation rate
2020-10 Newfoundland and Labrador 57.7 Participation rate
2020-11 Newfoundland and Labrador 58.1 Participation rate
2020-12 Newfoundland and Labrador 57.7 Participation rate
2021-01 Newfoundland and Labrador 57.2 Participation rate
2020-09 Newfoundland and Labrador 48.8 Employment rate
2020-10 Newfoundland and Labrador 50.2 Employment rate
2020-11 Newfoundland and Labrador 50.9 Employment rate
2020-12 Newfoundland and Labrador 50.5 Employment rate
2021-01 Newfoundland and Labrador 49.9 Employment rate
2020-09 Prince Edward Island 132.8 Population
2020-10 Prince Edward Island 132.9 Population
2020-11 Prince Edward Island 133.0 Population
2020-12 Prince Edward Island 133.1 Population
2021-01 Prince Edward Island 133.1 Population
2020-09 Prince Edward Island 84.7 Labour force
2020-10 Prince Edward Island 86.1 Labour force
2020-11 Prince Edward Island 87.1 Labour force
2020-12 Prince Edward Island 86.0 Labour force
2021-01 Prince Edward Island 85.1 Labour force
2020-09 Prince Edward Island 76.1 Employment
2020-10 Prince Edward Island 77.1 Employment
2020-11 Prince Edward Island 78.2 Employment
2020-12 Prince Edward Island 77.5 Employment
2021-01 Prince Edward Island 78.4 Employment
2020-09 Prince Edward Island 63.2 Full-time employment
2020-10 Prince Edward Island 65.2 Full-time employment
2020-11 Prince Edward Island 64.9 Full-time employment
2020-12 Prince Edward Island 66.2 Full-time employment
2021-01 Prince Edward Island 66.6 Full-time employment
2020-09 Prince Edward Island 12.9 Part-time employment
2020-10 Prince Edward Island 12.0 Part-time employment
2020-11 Prince Edward Island 13.3 Part-time employment
2020-12 Prince Edward Island 11.3 Part-time employment
2021-01 Prince Edward Island 11.8 Part-time employment
2020-09 Prince Edward Island 8.6 Unemployment
2020-10 Prince Edward Island 9.0 Unemployment
2020-11 Prince Edward Island 8.9 Unemployment
2020-12 Prince Edward Island 8.5 Unemployment
2021-01 Prince Edward Island 6.7 Unemployment
2020-09 Prince Edward Island 10.2 Unemployment rate
2020-10 Prince Edward Island 10.5 Unemployment rate
2020-11 Prince Edward Island 10.2 Unemployment rate
2020-12 Prince Edward Island 9.9 Unemployment rate
2021-01 Prince Edward Island 7.9 Unemployment rate
2020-09 Prince Edward Island 63.8 Participation rate
2020-10 Prince Edward Island 64.8 Participation rate
2020-11 Prince Edward Island 65.5 Participation rate
2020-12 Prince Edward Island 64.6 Participation rate
2021-01 Prince Edward Island 63.9 Participation rate
2020-09 Prince Edward Island 57.3 Employment rate
2020-10 Prince Edward Island 58.0 Employment rate
2020-11 Prince Edward Island 58.8 Employment rate
2020-12 Prince Edward Island 58.2 Employment rate
2021-01 Prince Edward Island 58.9 Employment rate
2020-09 Nova Scotia 815.9 Population
2020-10 Nova Scotia 816.5 Population
2020-11 Nova Scotia 816.9 Population
2020-12 Nova Scotia 817.0 Population
2021-01 Nova Scotia 817.2 Population
2020-09 Nova Scotia 487.5 Labour force
2020-10 Nova Scotia 496.1 Labour force
2020-11 Nova Scotia 495.7 Labour force
2020-12 Nova Scotia 498.7 Labour force
2021-01 Nova Scotia 504.8 Labour force
2020-09 Nova Scotia 448.0 Employment
2020-10 Nova Scotia 451.5 Employment
2020-11 Nova Scotia 462.7 Employment
2020-12 Nova Scotia 454.9 Employment
2021-01 Nova Scotia 462.7 Employment
2020-09 Nova Scotia 356.3 Full-time employment
2020-10 Nova Scotia 367.5 Full-time employment
2020-11 Nova Scotia 377.2 Full-time employment
2020-12 Nova Scotia 377.4 Full-time employment
2021-01 Nova Scotia 381.1 Full-time employment
2020-09 Nova Scotia 91.6 Part-time employment
2020-10 Nova Scotia 84.0 Part-time employment
2020-11 Nova Scotia 85.5 Part-time employment
2020-12 Nova Scotia 77.5 Part-time employment
2021-01 Nova Scotia 81.7 Part-time employment
2020-09 Nova Scotia 39.6 Unemployment
2020-10 Nova Scotia 44.7 Unemployment
2020-11 Nova Scotia 33.1 Unemployment
2020-12 Nova Scotia 43.8 Unemployment
2021-01 Nova Scotia 42.1 Unemployment
2020-09 Nova Scotia 8.1 Unemployment rate
2020-10 Nova Scotia 9.0 Unemployment rate
2020-11 Nova Scotia 6.7 Unemployment rate
2020-12 Nova Scotia 8.8 Unemployment rate
2021-01 Nova Scotia 8.3 Unemployment rate
2020-09 Nova Scotia 59.7 Participation rate
2020-10 Nova Scotia 60.8 Participation rate
2020-11 Nova Scotia 60.7 Participation rate
2020-12 Nova Scotia 61.0 Participation rate
2021-01 Nova Scotia 61.8 Participation rate
2020-09 Nova Scotia 54.9 Employment rate
2020-10 Nova Scotia 55.3 Employment rate
2020-11 Nova Scotia 56.6 Employment rate
2020-12 Nova Scotia 55.7 Employment rate
2021-01 Nova Scotia 56.6 Employment rate
2020-09 New Brunswick 647.6 Population
2020-10 New Brunswick 647.8 Population
2020-11 New Brunswick 648.0 Population
2020-12 New Brunswick 648.2 Population
2021-01 New Brunswick 648.4 Population
2020-09 New Brunswick 397.9 Labour force
2020-10 New Brunswick 399.1 Labour force
2020-11 New Brunswick 401.1 Labour force
2020-12 New Brunswick 398.9 Labour force
2021-01 New Brunswick 396.5 Labour force
2020-09 New Brunswick 354.3 Employment
2020-10 New Brunswick 357.5 Employment
2020-11 New Brunswick 361.5 Employment
2020-12 New Brunswick 360.7 Employment
2021-01 New Brunswick 361.8 Employment
2020-09 New Brunswick 300.4 Full-time employment
2020-10 New Brunswick 305.4 Full-time employment
2020-11 New Brunswick 307.9 Full-time employment
2020-12 New Brunswick 303.1 Full-time employment
2021-01 New Brunswick 300.7 Full-time employment
2020-09 New Brunswick 53.8 Part-time employment
2020-10 New Brunswick 52.1 Part-time employment
2020-11 New Brunswick 53.6 Part-time employment
2020-12 New Brunswick 57.6 Part-time employment
2021-01 New Brunswick 61.1 Part-time employment
2020-09 New Brunswick 43.7 Unemployment
2020-10 New Brunswick 41.6 Unemployment
2020-11 New Brunswick 39.6 Unemployment
2020-12 New Brunswick 38.2 Unemployment
2021-01 New Brunswick 34.7 Unemployment
2020-09 New Brunswick 11.0 Unemployment rate
2020-10 New Brunswick 10.4 Unemployment rate
2020-11 New Brunswick 9.9 Unemployment rate
2020-12 New Brunswick 9.6 Unemployment rate
2021-01 New Brunswick 8.8 Unemployment rate
2020-09 New Brunswick 61.4 Participation rate
2020-10 New Brunswick 61.6 Participation rate
2020-11 New Brunswick 61.9 Participation rate
2020-12 New Brunswick 61.5 Participation rate
2021-01 New Brunswick 61.2 Participation rate
2020-09 New Brunswick 54.7 Employment rate
2020-10 New Brunswick 55.2 Employment rate
2020-11 New Brunswick 55.8 Employment rate
2020-12 New Brunswick 55.6 Employment rate
2021-01 New Brunswick 55.8 Employment rate
2020-09 Quebec 7064.0 Population
2020-10 Quebec 7069.2 Population
2020-11 Quebec 7074.0 Population
2020-12 Quebec 7077.7 Population
2021-01 Quebec 7081.0 Population
2020-09 Quebec 4565.4 Labour force
2020-10 Quebec 4563.0 Labour force
2020-11 Quebec 4543.7 Labour force
2020-12 Quebec 4504.3 Labour force
2021-01 Quebec 4496.7 Labour force
2020-09 Quebec 4223.3 Employment
2020-10 Quebec 4210.8 Employment
2020-11 Quebec 4216.0 Employment
2020-12 Quebec 4200.0 Employment
2021-01 Quebec 4102.1 Employment
2020-09 Quebec 3433.6 Full-time employment
2020-10 Quebec 3447.5 Full-time employment
2020-11 Quebec 3456.8 Full-time employment
2020-12 Quebec 3448.3 Full-time employment
2021-01 Quebec 3442.8 Full-time employment
2020-09 Quebec 789.7 Part-time employment
2020-10 Quebec 763.3 Part-time employment
2020-11 Quebec 759.2 Part-time employment
2020-12 Quebec 751.7 Part-time employment
2021-01 Quebec 659.2 Part-time employment
2020-09 Quebec 342.1 Unemployment
2020-10 Quebec 352.2 Unemployment
2020-11 Quebec 327.7 Unemployment
2020-12 Quebec 304.3 Unemployment
2021-01 Quebec 394.6 Unemployment
2020-09 Quebec 7.5 Unemployment rate
2020-10 Quebec 7.7 Unemployment rate
2020-11 Quebec 7.2 Unemployment rate
2020-12 Quebec 6.8 Unemployment rate
2021-01 Quebec 8.8 Unemployment rate
2020-09 Quebec 64.6 Participation rate
2020-10 Quebec 64.5 Participation rate
2020-11 Quebec 64.2 Participation rate
2020-12 Quebec 63.6 Participation rate
2021-01 Quebec 63.5 Participation rate
2020-09 Quebec 59.8 Employment rate
2020-10 Quebec 59.6 Employment rate
2020-11 Quebec 59.6 Employment rate
2020-12 Quebec 59.3 Employment rate
2021-01 Quebec 57.9 Employment rate
2020-09 Ontario 12245.7 Population
2020-10 Ontario 12256.7 Population
2020-11 Ontario 12267.1 Population
2020-12 Ontario 12274.5 Population
2021-01 Ontario 12280.5 Population
2020-09 Ontario 7927.8 Labour force
2020-10 Ontario 7973.6 Labour force
2020-11 Ontario 7970.0 Labour force
2020-12 Ontario 8011.3 Labour force
2021-01 Ontario 7887.9 Labour force
2020-09 Ontario 7168.9 Employment
2020-10 Ontario 7200.6 Employment
2020-11 Ontario 7238.3 Employment
2020-12 Ontario 7239.0 Employment
2021-01 Ontario 7085.5 Employment
2020-09 Ontario 5885.4 Full-time employment
2020-10 Ontario 5891.9 Full-time employment
2020-11 Ontario 5959.6 Full-time employment
2020-12 Ontario 5966.8 Full-time employment
2021-01 Ontario 5965.9 Full-time employment
2020-09 Ontario 1283.4 Part-time employment
2020-10 Ontario 1308.7 Part-time employment
2020-11 Ontario 1278.7 Part-time employment
2020-12 Ontario 1272.3 Part-time employment
2021-01 Ontario 1119.6 Part-time employment
2020-09 Ontario 758.9 Unemployment
2020-10 Ontario 773.0 Unemployment
2020-11 Ontario 731.7 Unemployment
2020-12 Ontario 772.3 Unemployment
2021-01 Ontario 802.4 Unemployment
2020-09 Ontario 9.6 Unemployment rate
2020-10 Ontario 9.7 Unemployment rate
2020-11 Ontario 9.2 Unemployment rate
2020-12 Ontario 9.6 Unemployment rate
2021-01 Ontario 10.2 Unemployment rate
2020-09 Ontario 64.7 Participation rate
2020-10 Ontario 65.1 Participation rate
2020-11 Ontario 65.0 Participation rate
2020-12 Ontario 65.3 Participation rate
2021-01 Ontario 64.2 Participation rate
2020-09 Ontario 58.5 Employment rate
2020-10 Ontario 58.7 Employment rate
2020-11 Ontario 59.0 Employment rate
2020-12 Ontario 59.0 Employment rate
2021-01 Ontario 57.7 Employment rate
2020-09 Manitoba 1048.4 Population
2020-10 Manitoba 1049.1 Population
2020-11 Manitoba 1049.3 Population
2020-12 Manitoba 1049.4 Population
2021-01 Manitoba 1049.4 Population
2020-09 Manitoba 702.3 Labour force
2020-10 Manitoba 701.3 Labour force
2020-11 Manitoba 684.7 Labour force
2020-12 Manitoba 681.8 Labour force
2021-01 Manitoba 685.9 Labour force
2020-09 Manitoba 652.5 Employment
2020-10 Manitoba 651.9 Employment
2020-11 Manitoba 633.4 Employment
2020-12 Manitoba 625.5 Employment
2021-01 Manitoba 631.0 Employment
2020-09 Manitoba 519.1 Full-time employment
2020-10 Manitoba 518.1 Full-time employment
2020-11 Manitoba 514.3 Full-time employment
2020-12 Manitoba 509.8 Full-time employment
2021-01 Manitoba 525.8 Full-time employment
2020-09 Manitoba 133.4 Part-time employment
2020-10 Manitoba 133.8 Part-time employment
2020-11 Manitoba 119.1 Part-time employment
2020-12 Manitoba 115.7 Part-time employment
2021-01 Manitoba 105.3 Part-time employment
2020-09 Manitoba 49.8 Unemployment
2020-10 Manitoba 49.4 Unemployment
2020-11 Manitoba 51.3 Unemployment
2020-12 Manitoba 56.3 Unemployment
2021-01 Manitoba 54.8 Unemployment
2020-09 Manitoba 7.1 Unemployment rate
2020-10 Manitoba 7.0 Unemployment rate
2020-11 Manitoba 7.5 Unemployment rate
2020-12 Manitoba 8.3 Unemployment rate
2021-01 Manitoba 8.0 Unemployment rate
2020-09 Manitoba 67.0 Participation rate
2020-10 Manitoba 66.8 Participation rate
2020-11 Manitoba 65.3 Participation rate
2020-12 Manitoba 65.0 Participation rate
2021-01 Manitoba 65.4 Participation rate
2020-09 Manitoba 62.2 Employment rate
2020-10 Manitoba 62.1 Employment rate
2020-11 Manitoba 60.4 Employment rate
2020-12 Manitoba 59.6 Employment rate
2021-01 Manitoba 60.1 Employment rate
2020-09 Saskatchewan 888.0 Population
2020-10 Saskatchewan 887.9 Population
2020-11 Saskatchewan 888.0 Population
2020-12 Saskatchewan 888.1 Population
2021-01 Saskatchewan 888.2 Population
2020-09 Saskatchewan 598.9 Labour force
2020-10 Saskatchewan 595.6 Labour force
2020-11 Saskatchewan 593.9 Labour force
2020-12 Saskatchewan 592.3 Labour force
2021-01 Saskatchewan 589.7 Labour force
2020-09 Saskatchewan 556.6 Employment
2020-10 Saskatchewan 555.7 Employment
2020-11 Saskatchewan 551.6 Employment
2020-12 Saskatchewan 545.2 Employment
2021-01 Saskatchewan 547.4 Employment
2020-09 Saskatchewan 455.7 Full-time employment
2020-10 Saskatchewan 450.9 Full-time employment
2020-11 Saskatchewan 451.9 Full-time employment
2020-12 Saskatchewan 446.9 Full-time employment
2021-01 Saskatchewan 446.9 Full-time employment
2020-09 Saskatchewan 100.9 Part-time employment
2020-10 Saskatchewan 104.8 Part-time employment
2020-11 Saskatchewan 99.7 Part-time employment
2020-12 Saskatchewan 98.3 Part-time employment
2021-01 Saskatchewan 100.5 Part-time employment
2020-09 Saskatchewan 42.3 Unemployment
2020-10 Saskatchewan 39.9 Unemployment
2020-11 Saskatchewan 42.2 Unemployment
2020-12 Saskatchewan 47.1 Unemployment
2021-01 Saskatchewan 42.3 Unemployment
2020-09 Saskatchewan 7.1 Unemployment rate
2020-10 Saskatchewan 6.7 Unemployment rate
2020-11 Saskatchewan 7.1 Unemployment rate
2020-12 Saskatchewan 8.0 Unemployment rate
2021-01 Saskatchewan 7.2 Unemployment rate
2020-09 Saskatchewan 67.4 Participation rate
2020-10 Saskatchewan 67.1 Participation rate
2020-11 Saskatchewan 66.9 Participation rate
2020-12 Saskatchewan 66.7 Participation rate
2021-01 Saskatchewan 66.4 Participation rate
2020-09 Saskatchewan 62.7 Employment rate
2020-10 Saskatchewan 62.6 Employment rate
2020-11 Saskatchewan 62.1 Employment rate
2020-12 Saskatchewan 61.4 Employment rate
2021-01 Saskatchewan 61.6 Employment rate
2020-09 Alberta 3515.4 Population
2020-10 Alberta 3518.7 Population
2020-11 Alberta 3522.0 Population
2020-12 Alberta 3524.9 Population
2021-01 Alberta 3527.7 Population
2020-09 Alberta 2459.7 Labour force
2020-10 Alberta 2453.1 Labour force
2020-11 Alberta 2446.1 Labour force
2020-12 Alberta 2430.1 Labour force
2021-01 Alberta 2444.1 Labour force
2020-09 Alberta 2162.7 Employment
2020-10 Alberta 2187.7 Employment
2020-11 Alberta 2173.9 Employment
2020-12 Alberta 2160.6 Employment
2021-01 Alberta 2181.4 Employment
2020-09 Alberta 1751.1 Full-time employment
2020-10 Alberta 1764.5 Full-time employment
2020-11 Alberta 1730.8 Full-time employment
2020-12 Alberta 1767.0 Full-time employment
2021-01 Alberta 1766.7 Full-time employment
2020-09 Alberta 411.6 Part-time employment
2020-10 Alberta 423.2 Part-time employment
2020-11 Alberta 443.1 Part-time employment
2020-12 Alberta 393.6 Part-time employment
2021-01 Alberta 414.7 Part-time employment
2020-09 Alberta 297.0 Unemployment
2020-10 Alberta 265.5 Unemployment
2020-11 Alberta 272.3 Unemployment
2020-12 Alberta 269.5 Unemployment
2021-01 Alberta 262.7 Unemployment
2020-09 Alberta 12.1 Unemployment rate
2020-10 Alberta 10.8 Unemployment rate
2020-11 Alberta 11.1 Unemployment rate
2020-12 Alberta 11.1 Unemployment rate
2021-01 Alberta 10.7 Unemployment rate
2020-09 Alberta 70.0 Participation rate
2020-10 Alberta 69.7 Participation rate
2020-11 Alberta 69.5 Participation rate
2020-12 Alberta 68.9 Participation rate
2021-01 Alberta 69.3 Participation rate
2020-09 Alberta 61.5 Employment rate
2020-10 Alberta 62.2 Employment rate
2020-11 Alberta 61.7 Employment rate
2020-12 Alberta 61.3 Employment rate
2021-01 Alberta 61.8 Employment rate
2020-09 British Columbia 4311.3 Population
2020-10 British Columbia 4314.6 Population
2020-11 British Columbia 4317.5 Population
2020-12 British Columbia 4319.2 Population
2021-01 British Columbia 4320.6 Population
2020-09 British Columbia 2766.0 Labour force
2020-10 British Columbia 2791.3 Labour force
2020-11 British Columbia 2798.9 Labour force
2020-12 British Columbia 2798.2 Labour force
2021-01 British Columbia 2825.8 Labour force
2020-09 British Columbia 2528.8 Employment
2020-10 British Columbia 2566.8 Employment
2020-11 British Columbia 2595.4 Employment
2020-12 British Columbia 2596.8 Employment
2021-01 British Columbia 2599.6 Employment
2020-09 British Columbia 1961.7 Full-time employment
2020-10 British Columbia 1970.1 Full-time employment
2020-11 British Columbia 2024.7 Full-time employment
2020-12 British Columbia 2045.9 Full-time employment
2021-01 British Columbia 2050.4 Full-time employment
2020-09 British Columbia 567.1 Part-time employment
2020-10 British Columbia 596.7 Part-time employment
2020-11 British Columbia 570.7 Part-time employment
2020-12 British Columbia 550.9 Part-time employment
2021-01 British Columbia 549.2 Part-time employment
2020-09 British Columbia 237.2 Unemployment
2020-10 British Columbia 224.5 Unemployment
2020-11 British Columbia 203.5 Unemployment
2020-12 British Columbia 201.4 Unemployment
2021-01 British Columbia 226.2 Unemployment
2020-09 British Columbia 8.6 Unemployment rate
2020-10 British Columbia 8.0 Unemployment rate
2020-11 British Columbia 7.3 Unemployment rate
2020-12 British Columbia 7.2 Unemployment rate
2021-01 British Columbia 8.0 Unemployment rate
2020-09 British Columbia 64.2 Participation rate
2020-10 British Columbia 64.7 Participation rate
2020-11 British Columbia 64.8 Participation rate
2020-12 British Columbia 64.8 Participation rate
2021-01 British Columbia 65.4 Participation rate
2020-09 British Columbia 58.7 Employment rate
2020-10 British Columbia 59.5 Employment rate
2020-11 British Columbia 60.1 Employment rate
2020-12 British Columbia 60.1 Employment rate
2021-01 British Columbia 60.2 Employment rate
colnames(canada_un) <- c("date", "location", "unemployment_rate","characteristics")
canada_un <- canada_un %>% select_all() %>% filter(characteristics == "Unemployment rate")
ggplot(data=canada_un, aes(x=date, y=unemployment_rate, group = location )) +
  geom_line(aes(color=location)) +
  geom_point(aes(color = location))

And here is the graph showing the unemployment across the different provinces and Canada as a whole.

It looks like Canadian unemployment has gone down overall, but it is trending upwards, it will be interesting to see how it turned out once the data up until March is out.

IMDB Top 250

imdb <- read.csv("https://raw.githubusercontent.com/jhumms/DATA607/main/tidyr/imdb_top.csv",header = FALSE, sep = ",")

Another ugly dataframe and this one came without headers, but we will take care of that in a bit.
Here’s the process for this dataframe:

  1. Split the first column into rank, name, and year
  2. Analyze for the decades with highly rated movies.
imdb <- imdb %>% separate(1, into = c("rank", "name"), sep = "(?<=\\d)\\.")
imdb <- imdb %>% separate(2, into = c("name", "year"), sep = "\\(")

Let’s rename the columns, clean up the year column, and then make sure all the columns are the correct data type.

colnames(imdb) <- c("rank", "name", "year", "rating")

imdb <- imdb %>% mutate(year = as.character(gsub(")","",year)))
imdb$year <- ymd(imdb$year, truncated = 2L)
imdb$rank <- as.numeric(imdb$rank)

Finally, Tidy!

kable(imdb, "html") %>% kable_styling("striped") %>% scroll_box(width = "100%", height = "350px")
rank name year rating
1 The Shawshank Redemption 1994-01-01 9.2
2 The Godfather 1972-01-01 9.1
3 The Godfather: Part II 1974-01-01 9.0
4 The Dark Knight 2008-01-01 9.0
5 12 Angry Men 1957-01-01 8.9
6 Schindler’s List 1993-01-01 8.9
7 The Lord of the Rings: The Return of the King 2003-01-01 8.9
8 Pulp Fiction 1994-01-01 8.8
9 The Good, the Bad and the Ugly 1966-01-01 8.8
10 The Lord of the Rings: The Fellowship of the Ring 2001-01-01 8.8
11 Fight Club 1999-01-01 8.8
12 Forrest Gump 1994-01-01 8.8
13 Inception 2010-01-01 8.7
14 The Lord of the Rings: The Two Towers 2002-01-01 8.7
15 Star Wars: Episode V - The Empire Strikes Back 1980-01-01 8.7
16 The Matrix 1999-01-01 8.6
17 Goodfellas 1990-01-01 8.6
18 One Flew Over the Cuckoo’s Nest 1975-01-01 8.6
19 Seven Samurai 1954-01-01 8.6
20 Se7en 1995-01-01 8.6
21 Life Is Beautiful 1997-01-01 8.6
22 City of God 2002-01-01 8.6
23 The Silence of the Lambs 1991-01-01 8.6
24 It’s a Wonderful Life 1946-01-01 8.6
25 Star Wars: Episode IV - A New Hope 1977-01-01 8.6
26 Saving Private Ryan 1998-01-01 8.6
27 The Green Mile 1999-01-01 8.5
28 Spirited Away 2001-01-01 8.5
29 Interstellar 2014-01-01 8.5
30 Parasite 2019-01-01 8.5
31 Léon: The Professional 1994-01-01 8.5
32 Hara-Kiri 1962-01-01 8.5
33 The Usual Suspects 1995-01-01 8.5
34 The Lion King 1994-01-01 8.5
35 The Pianist 2002-01-01 8.5
36 Back to the Future 1985-01-01 8.5
37 Terminator 2: Judgment Day 1991-01-01 8.5
38 American History X 1998-01-01 8.5
39 Modern Times 1936-01-01 8.5
40 Gladiator 2000-01-01 8.5
41 Psycho 1960-01-01 8.5
42 The Departed 2006-01-01 8.5
43 City Lights 1931-01-01 8.5
44 The Intouchables 2011-01-01 8.5
45 Whiplash 2014-01-01 8.5
46 Grave of the Fireflies 1988-01-01 8.5
47 The Prestige 2006-01-01 8.5
48 Once Upon a Time in the West 1968-01-01 8.4
49 Casablanca 1942-01-01 8.4
50 Cinema Paradiso 1988-01-01 8.4
51 Rear Window 1954-01-01 8.4
52 Alien 1979-01-01 8.4
53 Apocalypse Now 1979-01-01 8.4
54 Memento 2000-01-01 8.4
55 The Great Dictator 1940-01-01 8.4
56 Indiana Jones and the Raiders of the Lost Ark 1981-01-01 8.4
57 Django Unchained 2012-01-01 8.4
58 The Lives of Others 2006-01-01 8.4
59 Hamilton 2020-01-01 8.4
60 Paths of Glory 1957-01-01 8.4
61 Joker 2019-01-01 8.4
62 WALL·E 2008-01-01 8.4
63 The Shining 1980-01-01 8.4
64 Avengers: Infinity War 2018-01-01 8.4
65 Sunset Blvd. 1950-01-01 8.4
66 Witness for the Prosecution 1957-01-01 8.4
67 Oldboy 2003-01-01 8.3
68 Spider-Man: Into the Spider-Verse 2018-01-01 8.3
69 Princess Mononoke 1997-01-01 8.3
70 Dr. Strangelove or: How I Learned to Stop Worrying and Love the Bomb 1964-01-01 8.3
71 The Dark Knight Rises 2012-01-01 8.3
72 Once Upon a Time in America 1984-01-01 8.3
73 Your Name. 2016-01-01 8.3
74 Aliens 1986-01-01 8.3
75 Coco 2017-01-01 8.3
76 Avengers: Endgame 2019-01-01 8.3
77 Capernaum 2018-01-01 8.3
78 American Beauty 1999-01-01 8.3
79 Braveheart 1995-01-01 8.3
80 Das Boot 1981-01-01 8.3
81 High and Low 1963-01-01 8.3
82 Toy Story 1995-01-01 8.3
83 3 Idiots 2009-01-01 8.3
84 Amadeus 1984-01-01 8.3
85 Inglourious Basterds 2009-01-01 8.3
86 Good Will Hunting 1997-01-01 8.3
87 Star Wars: Episode VI - Return of the Jedi 1983-01-01 8.3
88 Like Stars on Earth 2007-01-01 8.3
89 Reservoir Dogs 1992-01-01 8.3
90 2001: A Space Odyssey 1968-01-01 8.3
91 Requiem for a Dream 2000-01-01 8.3
92 Vertigo 1958-01-01 8.3
93 The Hunt 2012-01-01 8.3
94 M 1931-01-01 8.3
95 Eternal Sunshine of the Spotless Mind 2004-01-01 8.3
96 Citizen Kane 1941-01-01 8.3
97 Dangal 2016-01-01 8.3
98 Singin’ in the Rain 1952-01-01 8.2
99 Bicycle Thieves 1948-01-01 8.2
100 Full Metal Jacket 1987-01-01 8.2
101 The Kid 1921-01-01 8.2
102 Come and See 1985-01-01 8.2
103 Snatch 2000-01-01 8.2
104 North by Northwest 1959-01-01 8.2
105 Ikiru 1952-01-01 8.2
106 A Clockwork Orange 1971-01-01 8.2
107 Scarface 1983-01-01 8.2
108 1917 2019-01-01 8.2
109 Taxi Driver 1976-01-01 8.2
110 Incendies 2010-01-01 8.2
111 A Separation 2011-01-01 8.2
112 Lawrence of Arabia 1962-01-01 8.2
113 Toy Story 3 2010-01-01 8.2
114 The Sting 1973-01-01 8.2
115 Amélie 2001-01-01 8.2
116 Metropolis 1927-01-01 8.2
117 The Apartment 1960-01-01 8.2
118 For a Few Dollars More 1965-01-01 8.2
119 Double Indemnity 1944-01-01 8.2
120 To Kill a Mockingbird 1962-01-01 8.2
121 Up 2009-01-01 8.2
122 Indiana Jones and the Last Crusade 1989-01-01 8.2
123 Heat 1995-01-01 8.2
124 L.A. Confidential 1997-01-01 8.2
125 Green Book 2018-01-01 8.2
126 Die Hard 1988-01-01 8.2
127 Monty Python and the Holy Grail 1975-01-01 8.2
128 Batman Begins 2005-01-01 8.2
129 Yojimbo 1961-01-01 8.2
130 Rashomon 1950-01-01 8.2
131 Downfall 2004-01-01 8.2
132 Children of Heaven 1997-01-01 8.2
133 Unforgiven 1992-01-01 8.2
134 Ran 1985-01-01 8.2
135 Some Like It Hot 1959-01-01 8.2
136 Howl’s Moving Castle 2004-01-01 8.2
137 All About Eve 1950-01-01 8.2
138 Casino 1995-01-01 8.2
139 A Beautiful Mind 2001-01-01 8.2
140 The Wolf of Wall Street 2013-01-01 8.2
141 The Great Escape 1963-01-01 8.2
142 Pan’s Labyrinth 2006-01-01 8.2
143 There Will Be Blood 2007-01-01 8.1
144 The Secret in Their Eyes 2009-01-01 8.1
145 Lock, Stock and Two Smoking Barrels 1998-01-01 8.1
146 Judgment at Nuremberg 1961-01-01 8.1
147 My Neighbor Totoro 1988-01-01 8.1
148 Raging Bull 1980-01-01 8.1
149 The Treasure of the Sierra Madre 1948-01-01 8.1
150 Dial M for Murder 1954-01-01 8.1
151 Three Billboards Outside Ebbing, Missouri 2017-01-01 8.1
152 Shutter Island 2010-01-01 8.1
153 The Gold Rush 1925-01-01 8.1
154 Chinatown 1974-01-01 8.1
155 My Father and My Son 2005-01-01 8.1
156 No Country for Old Men 2007-01-01 8.1
157 V for Vendetta 2005-01-01 8.1
158 Inside Out 2015-01-01 8.1
159 The Elephant Man 1980-01-01 8.1
160 The Thing 1982-01-01 8.1
161 The Seventh Seal 1957-01-01 8.1
162 Warrior 2011-01-01 8.1
163 The Sixth Sense 1999-01-01 8.1
164 Jurassic Park 1993-01-01 8.1
165 Klaus 2019-01-01 8.1
166 Trainspotting 1996-01-01 8.1
167 The Truman Show 1998-01-01 8.1
168 Gone with the Wind 1939-01-01 8.1
169 Finding Nemo 2003-01-01 8.1
170 Stalker 1979-01-01 8.1
171 Wild Strawberries 1957-01-01 8.1
172 Blade Runner 1982-01-01 8.1
173 Kill Bill: Vol. 1 2003-01-01 8.1
174 Memories of Murder 2003-01-01 8.1
175 The Bridge on the River Kwai 1957-01-01 8.1
176 Fargo 1996-01-01 8.1
177 Room 2015-01-01 8.1
178 Wild Tales 2014-01-01 8.1
179 Gran Torino 2008-01-01 8.1
180 Tokyo Story 1953-01-01 8.1
181 The Third Man 1949-01-01 8.1
182 On the Waterfront 1954-01-01 8.1
183 The Deer Hunter 1978-01-01 8.1
184 In the Name of the Father 1993-01-01 8.1
185 Mary and Max 2009-01-01 8.1
186 The Grand Budapest Hotel 2014-01-01 8.1
187 Before Sunrise 1995-01-01 8.1
188 Gone Girl 2014-01-01 8.1
189 Catch Me If You Can 2002-01-01 8.1
190 Hacksaw Ridge 2016-01-01 8.1
191 Prisoners 2013-01-01 8.1
192 Persona 1966-01-01 8.1
193 Andhadhun 2018-01-01 8.1
194 Sherlock Jr.  1924-01-01 8.1
195 The Big Lebowski 1998-01-01 8.1
196 Raatchasan 2018-01-01 8.1
197 To Be or Not to Be 1942-01-01 8.1
198 The General 1926-01-01 8.1
199 Barry Lyndon 1975-01-01 8.1
200 How to Train Your Dragon 2010-01-01 8.1
201 Anand 1971-01-01 8.1
202 Autumn Sonata 1978-01-01 8.1
203 Ford v Ferrari 2019-01-01 8.1
204 12 Years a Slave 2013-01-01 8.1
205 The Bandit 1996-01-01 8.1
206 Mr. Smith Goes to Washington 1939-01-01 8.1
207 Mad Max: Fury Road 2015-01-01 8.1
208 Dead Poets Society 1989-01-01 8.1
209 Million Dollar Baby 2004-01-01 8.1
210 Stand by Me 1986-01-01 8.1
211 Network 1976-01-01 8.1
212 Harry Potter and the Deathly Hallows: Part 2 2011-01-01 8.1
213 Ben-Hur 1959-01-01 8.1
214 Hachi: A Dog’s Tale 2009-01-01 8.1
215 Cool Hand Luke 1967-01-01 8.1
216 The Handmaiden 2016-01-01 8.1
217 Logan 2017-01-01 8.0
218 Platoon 1986-01-01 8.0
219 Into the Wild 2007-01-01 8.0
220 Soul 2020-01-01 8.0
221 Rush 2013-01-01 8.0
222 The Wages of Fear 1953-01-01 8.0
223 Monty Python’s Life of Brian 1979-01-01 8.0
224 La Haine 1995-01-01 8.0
225 The 400 Blows 1959-01-01 8.0
226 The Passion of Joan of Arc 1928-01-01 8.0
227 Spotlight 2015-01-01 8.0
228 Hotel Rwanda 2004-01-01 8.0
229 Amores Perros 2000-01-01 8.0
230 Gangs of Wasseypur 2012-01-01 8.0
231 Rocky 1976-01-01 8.0
232 Monsters, Inc.  2001-01-01 8.0
233 Andrei Rublev 1966-01-01 8.0
234 Nausicaä of the Valley of the Wind 1984-01-01 8.0
235 Rebecca 1940-01-01 8.0
236 Time of the Gypsies 1988-01-01 8.0
237 Before Sunset 2004-01-01 8.0
238 Rang De Basanti 2006-01-01 8.0
239 In the Mood for Love 2000-01-01 8.0
240 Rififi 1955-01-01 8.0
241 Paris, Texas 1984-01-01 8.0
242 Drishyam 2013-01-01 8.0
243 Portrait of a Lady on Fire 2019-01-01 8.0
244 It Happened One Night 1934-01-01 8.0
245 The Invisible Guest 2016-01-01 8.0
246 Drishyam 2015-01-01 8.0
247 A Silent Voice: The Movie 2016-01-01 8.0
248 The Battle of Algiers 1966-01-01 8.0
249 The Help 2011-01-01 8.0
250 Tangerines 2013-01-01 8.0

Let’s make this easy to look at and group the movies by decade and then let’s see how many movies there are in the top 250 by decade. Claire had originally thought that there would be a lot of older movies which were highly ranked because they became classics.

imdb$decade <- floor_date(imdb$year, years(10))


kable(imdb %>% select(decade, rating) %>% group_by(decade) %>% summarise(number_movies = n())%>% arrange((number_movies)), "html") %>% kable_styling("striped") %>% scroll_box(width = "100%", height = "350px")
decade number_movies
2020-01-01 2
1920-01-01 6
1930-01-01 6
1940-01-01 10
1960-01-01 18
1970-01-01 19
1950-01-01 23
1980-01-01 28
1990-01-01 39
2000-01-01 47
2010-01-01 52

Interestingly, it seems that the past four decades have a lot of movies in the top 250. This may actually show bias in that younger people who use the internet are more likely to rate movies online (to check this out we would need to get the demographics of reviewers on IMDB).

Let’s see which decades rank the highest.

movie <- imdb %>% select(decade, rating) %>% group_by(decade) %>% summarise(avg_rating = mean(rating)) %>% arrange(desc(avg_rating))

kable(movie, "html") %>% kable_styling("striped") %>% scroll_box(width = "100%", height = "350px")
decade avg_rating
1990-01-01 8.382051
1970-01-01 8.294737
2000-01-01 8.263830
1960-01-01 8.255556
1930-01-01 8.250000
1940-01-01 8.240000
1950-01-01 8.230435
1980-01-01 8.225000
2020-01-01 8.200000
2010-01-01 8.180769
1920-01-01 8.116667

Let’s see what it looks like graphed.

ggplot(data=movie, aes(x = reorder(decade, -avg_rating), y=avg_rating)) +
  geom_bar(stat='identity') +
  coord_flip() +
  labs(title="Average Rating of Movies by Decade",
        x ="Decade", y = "Average Rating")

This actually shows that the movies from the 90s are the best! Since these are the movies from my childhood and I also am one of the first generations who has widespread access to the internet, I’m going to guess that the user base is younger, and that is also shown by the 2000s being in third. However, it is interesting that 1960-1980 and 1990-2010 are the top four. Must have been good years for movies!