set.seed(45)
samp_mean <- function(x,i){
mean(x[i])}
BS<-boot(data$total_goal_count,samp_mean, 100)
plot(BS)
## BOOTSTRAP CONFIDENCE INTERVAL CALCULATIONS
boot.ci(BS,type = "perc")
## BOOTSTRAP CONFIDENCE INTERVAL CALCULATIONS
## Based on 100 bootstrap replicates
##
## CALL :
## boot.ci(boot.out = BS, type = "perc")
##
## Intervals :
## Level Percentile
## 95% ( 2.634, 2.982 )
## Calculations and Intervals on Original Scale
## Some percentile intervals may be unstable
Hypothesis test comparing the mean to a fixed value. I will also be stating my null and alternative hypothesis.
t.test
H0:μ=1 HA:μ≠1
t.test(data$total_goal_count, mu = 1)
##
## One Sample t-test
##
## data: data$total_goal_count
## t = 22.169, df = 379, p-value < 2.2e-16
## alternative hypothesis: true mean is not equal to 1
## 95 percent confidence interval:
## 2.659534 2.982571
## sample estimates:
## mean of x
## 2.821053
\[ t = \frac{\mu-\overline x}{SE} \]
BS$t0
## [1] 2.821053
SE<-sd(BS$t)
c(BS$t0-2*SE,BS$t0+2*SE)
## [1] 2.661710 2.980395
t=(3-BS$t0)/SE
pt(t,100)
## [1] 0.9865504
mean(0 == BS$t)
## [1] 0
mean(1<=BS$t)
## [1] 1
Since the mean of 1<=BS$t it is 0 and the inference in correct statistical terms.
data$total_goal_count[is.na(data$total_goal_count)] <- 0
data$total_goal_count
## [1] 3 3 2 2 3 2 4 4 0 2 0 3 2 4 3 5 4 7 5 2 2 4 4 0 3 1 3 6 3 3 3 4 2 2 2 1 3
## [38] 5 2 3 3 6 5 1 3 3 3 1 4 4 2 4 5 0 4 3 2 3 0 2 4 2 3 2 2 2 2 2 3 3 1 2 1 3
## [75] 1 4 5 6 3 0 4 0 6 5 1 1 2 1 2 4 1 3 5 0 3 2 4 4 3 1 3 1 4 1 6 2 5 7 4 1 3
## [112] 2 0 3 2 1 2 0 2 4 2 1 5 0 3 4 4 3 2 3 3 2 3 2 4 3 4 2 6 1 3 4 4 3 4 2 3 2
## [149] 4 4 4 1 1 1 5 5 2 2 3 4 4 1 1 1 5 2 2 3 5 4 2 4 2 1 4 5 0 2 6 8 2 6 0 3 4
## [186] 4 5 2 3 3 1 1 1 4 2 6 1 2 4 5 1 5 3 0 3 4 2 6 2 3 1 1 3 0 3 3 3 2 1 3 7 2
## [223] 7 3 3 3 0 2 3 3 3 6 1 3 4 3 4 2 2 3 1 0 2 5 2 4 2 1 4 2 2 3 2 3 3 3 1 4 4
## [260] 6 2 6 4 3 2 2 5 2 0 3 1 3 2 6 2 4 2 5 1 2 1 1 4 5 2 2 3 3 0 3 2 2 4 5 3 4
## [297] 6 2 2 4 3 7 3 2 2 1 2 2 2 3 2 3 3 2 5 3 3 2 2 4 4 5 1 1 2 1 4 5 2 2 4 3 4
## [334] 2 1 2 1 1 3 4 0 4 4 5 2 4 2 1 4 2 5 1 0 1 6 3 2 3 1 2 2 1 3 1 5 5 3 2 2 1
## [371] 5 4 8 4 0 2 2 2 4 5
samp_mean <- function(x, i){
mean(x[i])
}
BS1<-boot(data$total_goal_count,samp_mean, R = 10000)
plot(BS1)
boot.ci(BS1, type = "perc")
## BOOTSTRAP CONFIDENCE INTERVAL CALCULATIONS
## Based on 10000 bootstrap replicates
##
## CALL :
## boot.ci(boot.out = BS1, type = "perc")
##
## Intervals :
## Level Percentile
## 95% ( 2.661, 2.987 )
## Calculations and Intervals on Original Scale
min(3<=BS1$t)
## [1] 0
library(caret)
## Loading required package: lattice
##
## Attaching package: 'lattice'
## The following object is masked from 'package:boot':
##
## melanoma
## Loading required package: ggplot2
library(lattice)
library(boot)
library(ggplot2)
data$total_goal_count[is.na(data$total_goals_at_half_time)] <- 0
data$total_goals_at_half_time[is.na(data$total_goals_at_half_time)] <- 0
CV <- createDataPartition(data$total_goals_at_half_time, p=0.66,list = FALSE)
CV
## Resample1
## [1,] 2
## [2,] 3
## [3,] 4
## [4,] 5
## [5,] 6
## [6,] 8
## [7,] 9
## [8,] 12
## [9,] 14
## [10,] 15
## [11,] 16
## [12,] 18
## [13,] 19
## [14,] 20
## [15,] 21
## [16,] 22
## [17,] 23
## [18,] 24
## [19,] 26
## [20,] 32
## [21,] 33
## [22,] 35
## [23,] 37
## [24,] 38
## [25,] 39
## [26,] 40
## [27,] 41
## [28,] 44
## [29,] 45
## [30,] 46
## [31,] 47
## [32,] 50
## [33,] 51
## [34,] 53
## [35,] 54
## [36,] 55
## [37,] 56
## [38,] 57
## [39,] 58
## [40,] 59
## [41,] 60
## [42,] 62
## [43,] 65
## [44,] 67
## [45,] 68
## [46,] 69
## [47,] 70
## [48,] 71
## [49,] 75
## [50,] 76
## [51,] 77
## [52,] 79
## [53,] 81
## [54,] 83
## [55,] 85
## [56,] 86
## [57,] 88
## [58,] 89
## [59,] 90
## [60,] 92
## [61,] 96
## [62,] 97
## [63,] 99
## [64,] 102
## [65,] 103
## [66,] 104
## [67,] 107
## [68,] 109
## [69,] 110
## [70,] 111
## [71,] 112
## [72,] 113
## [73,] 114
## [74,] 115
## [75,] 116
## [76,] 118
## [77,] 119
## [78,] 121
## [79,] 122
## [80,] 123
## [81,] 125
## [82,] 126
## [83,] 127
## [84,] 128
## [85,] 132
## [86,] 133
## [87,] 135
## [88,] 136
## [89,] 137
## [90,] 139
## [91,] 140
## [92,] 143
## [93,] 144
## [94,] 147
## [95,] 149
## [96,] 151
## [97,] 152
## [98,] 153
## [99,] 154
## [100,] 155
## [101,] 156
## [102,] 158
## [103,] 159
## [104,] 160
## [105,] 161
## [106,] 162
## [107,] 163
## [108,] 165
## [109,] 167
## [110,] 168
## [111,] 169
## [112,] 171
## [113,] 172
## [114,] 173
## [115,] 174
## [116,] 178
## [117,] 179
## [118,] 180
## [119,] 181
## [120,] 182
## [121,] 183
## [122,] 184
## [123,] 185
## [124,] 188
## [125,] 190
## [126,] 192
## [127,] 194
## [128,] 195
## [129,] 197
## [130,] 198
## [131,] 199
## [132,] 200
## [133,] 202
## [134,] 203
## [135,] 204
## [136,] 205
## [137,] 206
## [138,] 209
## [139,] 210
## [140,] 213
## [141,] 214
## [142,] 215
## [143,] 218
## [144,] 219
## [145,] 220
## [146,] 222
## [147,] 223
## [148,] 224
## [149,] 225
## [150,] 228
## [151,] 229
## [152,] 230
## [153,] 231
## [154,] 232
## [155,] 233
## [156,] 234
## [157,] 235
## [158,] 236
## [159,] 237
## [160,] 238
## [161,] 239
## [162,] 240
## [163,] 242
## [164,] 244
## [165,] 246
## [166,] 247
## [167,] 248
## [168,] 249
## [169,] 250
## [170,] 252
## [171,] 253
## [172,] 254
## [173,] 255
## [174,] 257
## [175,] 258
## [176,] 259
## [177,] 260
## [178,] 261
## [179,] 264
## [180,] 265
## [181,] 266
## [182,] 269
## [183,] 272
## [184,] 274
## [185,] 278
## [186,] 280
## [187,] 281
## [188,] 282
## [189,] 283
## [190,] 286
## [191,] 288
## [192,] 289
## [193,] 290
## [194,] 291
## [195,] 292
## [196,] 293
## [197,] 295
## [198,] 297
## [199,] 298
## [200,] 299
## [201,] 300
## [202,] 301
## [203,] 302
## [204,] 304
## [205,] 305
## [206,] 306
## [207,] 310
## [208,] 311
## [209,] 315
## [210,] 316
## [211,] 317
## [212,] 319
## [213,] 320
## [214,] 321
## [215,] 322
## [216,] 324
## [217,] 328
## [218,] 329
## [219,] 332
## [220,] 335
## [221,] 337
## [222,] 338
## [223,] 339
## [224,] 341
## [225,] 342
## [226,] 343
## [227,] 344
## [228,] 346
## [229,] 347
## [230,] 348
## [231,] 350
## [232,] 351
## [233,] 354
## [234,] 355
## [235,] 356
## [236,] 357
## [237,] 360
## [238,] 361
## [239,] 362
## [240,] 363
## [241,] 364
## [242,] 365
## [243,] 366
## [244,] 367
## [245,] 369
## [246,] 370
## [247,] 372
## [248,] 374
## [249,] 377
## [250,] 378
## [251,] 379
## [252,] 380
hw <- data[CV,]
HW <- data[CV,]
HW
## date_GMT referee total_goal_count
## 2 Aug 11 2018 - 11:30am Martin Atkinson 3
## 3 Aug 11 2018 - 2:00pm Kevin Friend 2
## 4 Aug 11 2018 - 2:00pm Mike Dean 2
## 5 Aug 11 2018 - 2:00pm Chris Kavanagh 3
## 6 Aug 11 2018 - 2:00pm Jonathan Moss 2
## 8 Aug 12 2018 - 12:30pm Anthony Taylor 4
## 9 Aug 12 2018 - 12:30pm Graham Scott 0
## 12 Aug 18 2018 - 2:00pm Lee Mason 3
## 14 Aug 18 2018 - 2:00pm Anthony Taylor 4
## 15 Aug 18 2018 - 2:00pm Stuart Attwell 3
## 16 Aug 18 2018 - 4:30pm Martin Atkinson 5
## 18 Aug 19 2018 - 12:30pm Andre Marriner 7
## 19 Aug 19 2018 - 3:00pm Kevin Friend 5
## 20 Aug 20 2018 - 7:00pm Michael Oliver 2
## 21 Aug 25 2018 - 11:30am Martin Atkinson 2
## 22 Aug 25 2018 - 2:00pm Lee Probert 4
## 23 Aug 25 2018 - 2:00pm Graham Scott 4
## 24 Aug 25 2018 - 2:00pm Michael Oliver 0
## 26 Aug 25 2018 - 4:30pm Chris Kavanagh 1
## 32 Sep 01 2018 - 2:00pm Lee Probert 4
## 33 Sep 01 2018 - 2:00pm Lee Mason 2
## 35 Sep 01 2018 - 2:00pm Stuart Attwell 2
## 37 Sep 01 2018 - 4:30pm Kevin Friend 3
## 38 Sep 02 2018 - 12:30pm Anthony Taylor 5
## 39 Sep 02 2018 - 3:00pm Jonathan Moss 2
## 40 Sep 02 2018 - 3:00pm Andre Marriner 3
## 41 Sep 15 2018 - 11:30am Michael Oliver 3
## 44 Sep 15 2018 - 2:00pm Lee Mason 1
## 45 Sep 15 2018 - 2:00pm Stuart Attwell 3
## 46 Sep 15 2018 - 2:00pm Lee Probert 3
## 47 Sep 15 2018 - 4:30pm Mike Dean 3
## 50 Sep 17 2018 - 7:00pm Anthony Taylor 4
## 51 Sep 22 2018 - 11:30am Martin Atkinson 2
## 53 Sep 22 2018 - 2:00pm Michael Oliver 5
## 54 Sep 22 2018 - 2:00pm Andre Marriner 0
## 55 Sep 22 2018 - 2:00pm David Coote 4
## 56 Sep 22 2018 - 2:00pm Paul Tierney 3
## 57 Sep 22 2018 - 2:00pm Kevin Friend 2
## 58 Sep 22 2018 - 4:30pm Chris Kavanagh 3
## 59 Sep 23 2018 - 12:30pm Mike Dean 0
## 60 Sep 23 2018 - 3:00pm Jonathan Moss 2
## 62 Sep 29 2018 - 2:00pm Anthony Taylor 2
## 65 Sep 29 2018 - 2:00pm Lee Mason 2
## 67 Sep 29 2018 - 2:00pm Stuart Attwell 2
## 68 Sep 29 2018 - 4:30pm Andre Marriner 2
## 69 Sep 30 2018 - 3:00pm Martin Atkinson 3
## 70 Oct 01 2018 - 7:00pm Mike Dean 3
## 71 Oct 05 2018 - 7:00pm Kevin Friend 1
## 75 Oct 06 2018 - 2:00pm Mike Dean 1
## 76 Oct 06 2018 - 2:00pm Jonathan Moss 4
## 77 Oct 06 2018 - 4:30pm Anthony Taylor 5
## 79 Oct 07 2018 - 1:15pm Craig Pawson 3
## 81 Oct 20 2018 - 11:30am Mike Dean 4
## 83 Oct 20 2018 - 2:00pm Kevin Friend 6
## 85 Oct 20 2018 - 2:00pm Andre Marriner 1
## 86 Oct 20 2018 - 2:00pm Martin Atkinson 1
## 88 Oct 20 2018 - 4:30pm Michael Oliver 1
## 89 Oct 21 2018 - 3:00pm Anthony Taylor 2
## 90 Oct 22 2018 - 7:00pm Chris Kavanagh 4
## 92 Oct 27 2018 - 2:00pm Andre Marriner 3
## 96 Oct 27 2018 - 4:30pm Michael Oliver 2
## 97 Oct 28 2018 - 1:30pm Craig Pawson 4
## 99 Oct 28 2018 - 4:00pm Jonathan Moss 3
## 102 Nov 03 2018 - 3:00pm Lee Probert 1
## 103 Nov 03 2018 - 3:00pm David Coote 4
## 104 Nov 03 2018 - 3:00pm Craig Pawson 1
## 107 Nov 03 2018 - 7:45pm Mike Dean 5
## 109 Nov 04 2018 - 4:00pm Michael Oliver 4
## 110 Nov 05 2018 - 8:00pm Anthony Taylor 1
## 111 Nov 10 2018 - 12:30pm Martin Atkinson 3
## 112 Nov 10 2018 - 3:00pm Chris Kavanagh 2
## 113 Nov 10 2018 - 3:00pm Mike Dean 0
## 114 Nov 10 2018 - 3:00pm Lee Probert 3
## 115 Nov 10 2018 - 3:00pm Simon Hooper 2
## 116 Nov 10 2018 - 5:30pm Jonathan Moss 1
## 118 Nov 11 2018 - 2:15pm Kevin Friend 0
## 119 Nov 11 2018 - 4:30pm Stuart Attwell 2
## 121 Nov 24 2018 - 3:00pm Chris Kavanagh 2
## 122 Nov 24 2018 - 3:00pm Paul Tierney 1
## 123 Nov 24 2018 - 3:00pm Michael Oliver 5
## 125 Nov 24 2018 - 3:00pm Jonathan Moss 3
## 126 Nov 24 2018 - 3:00pm Andre Marriner 4
## 127 Nov 24 2018 - 5:30pm Martin Atkinson 4
## 128 Nov 25 2018 - 1:30pm Craig Pawson 3
## 132 Dec 01 2018 - 3:00pm Lee Probert 2
## 133 Dec 01 2018 - 3:00pm Michael Oliver 3
## 135 Dec 01 2018 - 3:00pm Stuart Attwell 4
## 136 Dec 01 2018 - 3:00pm Paul Tierney 3
## 137 Dec 01 2018 - 5:30pm Kevin Friend 4
## 139 Dec 02 2018 - 2:05pm Mike Dean 6
## 140 Dec 02 2018 - 4:15pm Chris Kavanagh 1
## 143 Dec 04 2018 - 7:45pm Graham Scott 4
## 144 Dec 04 2018 - 8:00pm Paul Tierney 3
## 147 Dec 05 2018 - 7:45pm Jonathan Moss 3
## 149 Dec 05 2018 - 8:00pm Andre Marriner 4
## 151 Dec 08 2018 - 12:30pm Lee Mason 4
## 152 Dec 08 2018 - 3:00pm Paul Tierney 1
## 153 Dec 08 2018 - 3:00pm Martin Atkinson 1
## 154 Dec 08 2018 - 3:00pm Jonathan Moss 1
## 155 Dec 08 2018 - 3:00pm Lee Probert 5
## 156 Dec 08 2018 - 3:00pm Anthony Taylor 5
## 158 Dec 08 2018 - 7:45pm Craig Pawson 2
## 159 Dec 09 2018 - 4:00pm Mike Dean 3
## 160 Dec 10 2018 - 8:00pm Kevin Friend 4
## 161 Dec 15 2018 - 12:30pm Craig Pawson 4
## 162 Dec 15 2018 - 3:00pm Michael Oliver 1
## 163 Dec 15 2018 - 3:00pm Anthony Taylor 1
## 165 Dec 15 2018 - 3:00pm Andy Madley 5
## 167 Dec 15 2018 - 5:30pm Mike Dean 2
## 168 Dec 16 2018 - 1:30pm Stuart Attwell 3
## 169 Dec 16 2018 - 1:30pm Chris Kavanagh 5
## 171 Dec 21 2018 - 8:00pm Craig Pawson 2
## 172 Dec 22 2018 - 12:30pm Kevin Friend 4
## 173 Dec 22 2018 - 3:00pm Mike Dean 2
## 174 Dec 22 2018 - 3:00pm Lee Probert 1
## 178 Dec 22 2018 - 3:00pm Lee Mason 2
## 179 Dec 22 2018 - 5:30pm Michael Oliver 6
## 180 Dec 23 2018 - 4:00pm Paul Tierney 8
## 181 Dec 26 2018 - 12:30pm Andre Marriner 2
## 182 Dec 26 2018 - 3:00pm Michael Oliver 6
## 183 Dec 26 2018 - 3:00pm Lee Probert 0
## 184 Dec 26 2018 - 3:00pm Mike Dean 3
## 185 Dec 26 2018 - 3:00pm Graham Scott 4
## 188 Dec 26 2018 - 5:15pm Anthony Taylor 2
## 190 Dec 27 2018 - 7:45pm Craig Pawson 3
## 192 Dec 29 2018 - 3:00pm Kevin Friend 1
## 194 Dec 29 2018 - 3:00pm Stuart Attwell 4
## 195 Dec 29 2018 - 3:00pm Roger East 2
## 197 Dec 30 2018 - 12:00pm Craig Pawson 1
## 198 Dec 30 2018 - 2:15pm David Coote 2
## 199 Dec 30 2018 - 2:15pm Paul Tierney 4
## 200 Dec 30 2018 - 4:30pm Lee Mason 5
## 202 Jan 01 2019 - 3:00pm Graham Scott 5
## 203 Jan 01 2019 - 5:30pm Kevin Friend 3
## 204 Jan 02 2019 - 7:45pm Jonathan Moss 0
## 205 Jan 02 2019 - 7:45pm Mike Dean 3
## 206 Jan 02 2019 - 7:45pm Chris Kavanagh 4
## 209 Jan 02 2019 - 8:00pm Andre Marriner 2
## 210 Jan 03 2019 - 8:00pm Anthony Taylor 3
## 213 Jan 12 2019 - 3:00pm Martin Atkinson 3
## 214 Jan 12 2019 - 3:00pm Lee Mason 0
## 215 Jan 12 2019 - 3:00pm Paul Tierney 3
## 218 Jan 13 2019 - 2:15pm Anthony Taylor 2
## 219 Jan 13 2019 - 4:30pm Mike Dean 1
## 220 Jan 14 2019 - 8:00pm Craig Pawson 3
## 222 Jan 19 2019 - 3:00pm Simon Hooper 2
## 223 Jan 19 2019 - 3:00pm Jonathan Moss 7
## 224 Jan 19 2019 - 3:00pm Paul Tierney 3
## 225 Jan 19 2019 - 3:00pm Stuart Attwell 3
## 228 Jan 19 2019 - 5:30pm Anthony Taylor 2
## 229 Jan 20 2019 - 1:30pm Andre Marriner 3
## 230 Jan 20 2019 - 4:00pm Craig Pawson 3
## 231 Jan 29 2019 - 7:45pm Mike Dean 3
## 232 Jan 29 2019 - 7:45pm Lee Probert 6
## 233 Jan 29 2019 - 7:45pm Stuart Attwell 1
## 234 Jan 29 2019 - 7:45pm David Coote 3
## 235 Jan 29 2019 - 8:00pm Jonathan Moss 4
## 236 Jan 29 2019 - 8:00pm Paul Tierney 3
## 237 Jan 30 2019 - 7:45pm Roger East 4
## 238 Jan 30 2019 - 7:45pm Andre Marriner 2
## 239 Jan 30 2019 - 8:00pm Martin Atkinson 2
## 240 Jan 30 2019 - 8:00pm Graham Scott 3
## 242 Feb 02 2019 - 3:00pm Simon Hooper 0
## 244 Feb 02 2019 - 3:00pm Paul Tierney 5
## 246 Feb 02 2019 - 3:00pm Lee Mason 4
## 247 Feb 02 2019 - 5:30pm Jonathan Moss 2
## 248 Feb 03 2019 - 2:05pm Mike Dean 1
## 249 Feb 03 2019 - 4:30pm Martin Atkinson 4
## 250 Feb 04 2019 - 8:00pm Kevin Friend 2
## 252 Feb 09 2019 - 12:30pm Paul Tierney 3
## 253 Feb 09 2019 - 3:00pm Craig Pawson 2
## 254 Feb 09 2019 - 3:00pm Jonathan Moss 3
## 255 Feb 09 2019 - 3:00pm Anthony Taylor 3
## 257 Feb 09 2019 - 3:00pm Lee Probert 1
## 258 Feb 09 2019 - 5:30pm Stuart Attwell 4
## 259 Feb 10 2019 - 1:30pm Michael Oliver 4
## 260 Feb 10 2019 - 4:00pm Mike Dean 6
## 261 Feb 11 2019 - 8:00pm Graham Scott 2
## 264 Feb 23 2019 - 12:30pm Mike Dean 3
## 265 Feb 23 2019 - 3:00pm Roger East 2
## 266 Feb 23 2019 - 3:00pm Kevin Friend 2
## 269 Feb 24 2019 - 2:05pm Michael Oliver 0
## 272 Feb 26 2019 - 7:45pm Lee Probert 3
## 274 Feb 27 2019 - 7:45pm Chris Kavanagh 6
## 278 Feb 27 2019 - 8:00pm Graham Scott 5
## 280 Mar 02 2019 - 12:30pm Anthony Taylor 2
## 281 Mar 02 2019 - 3:00pm Kevin Friend 1
## 282 Mar 02 2019 - 3:00pm Mike Dean 1
## 283 Mar 02 2019 - 3:00pm Lee Probert 4
## 286 Mar 02 2019 - 5:30pm Chris Kavanagh 2
## 288 Mar 03 2019 - 2:05pm Graham Scott 3
## 289 Mar 03 2019 - 4:15pm Martin Atkinson 0
## 290 Mar 09 2019 - 12:30pm Craig Pawson 3
## 291 Mar 09 2019 - 3:00pm Graham Scott 2
## 292 Mar 09 2019 - 3:00pm Anthony Taylor 2
## 293 Mar 09 2019 - 3:00pm David Coote 4
## 295 Mar 09 2019 - 3:00pm Kevin Friend 3
## 297 Mar 10 2019 - 12:00pm Andre Marriner 6
## 298 Mar 10 2019 - 2:05pm Michael Oliver 2
## 299 Mar 10 2019 - 4:30pm Jonathan Moss 2
## 300 Mar 16 2019 - 3:00pm Mike Dean 4
## 301 Mar 16 2019 - 3:00pm Michael Oliver 3
## 302 Mar 16 2019 - 3:00pm Jonathan Moss 7
## 304 Mar 17 2019 - 4:30pm Anthony Taylor 2
## 305 Mar 30 2019 - 12:30pm Kevin Friend 2
## 306 Mar 30 2019 - 3:00pm Michael Oliver 1
## 310 Mar 30 2019 - 3:00pm Stuart Attwell 3
## 311 Mar 30 2019 - 5:30pm Paul Tierney 2
## 315 Apr 02 2019 - 6:45pm Roger East 5
## 316 Apr 02 2019 - 6:45pm Mike Dean 3
## 317 Apr 03 2019 - 6:45pm Graham Scott 3
## 319 Apr 03 2019 - 6:45pm Jonathan Moss 2
## 320 Apr 05 2019 - 7:00pm Paul Tierney 4
## 321 Apr 06 2019 - 2:00pm Martin Atkinson 4
## 322 Apr 06 2019 - 2:00pm David Coote 5
## 324 Apr 07 2019 - 1:05pm Kevin Friend 1
## 328 Apr 13 2019 - 2:00pm Kevin Friend 5
## 329 Apr 13 2019 - 2:00pm Mike Dean 2
## 332 Apr 13 2019 - 4:30pm Graham Scott 3
## 335 Apr 15 2019 - 7:00pm Craig Pawson 1
## 337 Apr 20 2019 - 11:30am Michael Oliver 1
## 338 Apr 20 2019 - 2:00pm David Coote 1
## 339 Apr 20 2019 - 2:00pm Roger East 3
## 341 Apr 20 2019 - 2:00pm Craig Pawson 0
## 342 Apr 20 2019 - 4:30pm Anthony Taylor 4
## 343 Apr 21 2019 - 12:30pm Paul Tierney 4
## 344 Apr 21 2019 - 3:00pm Jonathan Moss 5
## 346 Apr 22 2019 - 7:00pm Kevin Friend 4
## 347 Apr 23 2019 - 6:45pm Mike Dean 2
## 348 Apr 23 2019 - 6:45pm Chris Kavanagh 1
## 350 Apr 24 2019 - 7:00pm Andre Marriner 2
## 351 Apr 26 2019 - 7:00pm Kevin Friend 5
## 354 Apr 27 2019 - 2:00pm Chris Kavanagh 1
## 355 Apr 27 2019 - 2:00pm Graham Scott 6
## 356 Apr 27 2019 - 2:00pm Simon Hooper 3
## 357 Apr 27 2019 - 4:30pm Mike Dean 2
## 360 Apr 28 2019 - 3:30pm Martin Atkinson 2
## 361 May 03 2019 - 7:00pm Chris Kavanagh 2
## 362 May 04 2019 - 11:30am Craig Pawson 1
## 363 May 04 2019 - 2:00pm Stuart Attwell 3
## 364 May 04 2019 - 2:00pm Jonathan Moss 1
## 365 May 04 2019 - 4:30pm Michael Oliver 5
## 366 May 04 2019 - 6:45pm Andre Marriner 5
## 367 May 05 2019 - 1:00pm Paul Tierney 3
## 369 May 05 2019 - 3:30pm Anthony Taylor 2
## 370 May 06 2019 - 7:00pm Mike Dean 1
## 372 May 12 2019 - 2:00pm Mike Dean 4
## 374 May 12 2019 - 2:00pm Kevin Friend 4
## 377 May 12 2019 - 2:00pm Jonathan Moss 2
## 378 May 12 2019 - 2:00pm Lee Probert 2
## 379 May 12 2019 - 2:00pm Andre Marriner 4
## 380 May 12 2019 - 2:00pm Chris Kavanagh 5
## total_goals_at_half_time
## 2 3
## 3 1
## 4 1
## 5 2
## 6 1
## 8 2
## 9 0
## 12 2
## 14 1
## 15 1
## 16 4
## 18 4
## 19 4
## 20 1
## 21 0
## 22 0
## 23 2
## 24 0
## 26 1
## 32 1
## 33 0
## 35 2
## 37 2
## 38 2
## 39 2
## 40 0
## 41 1
## 44 1
## 45 2
## 46 0
## 47 2
## 50 1
## 51 1
## 53 3
## 54 0
## 55 2
## 56 3
## 57 1
## 58 1
## 59 0
## 60 0
## 62 0
## 65 1
## 67 0
## 68 1
## 69 0
## 70 1
## 71 1
## 75 1
## 76 3
## 77 2
## 79 1
## 81 1
## 83 4
## 85 1
## 86 1
## 88 1
## 89 0
## 90 2
## 92 1
## 96 1
## 97 1
## 99 1
## 102 0
## 103 2
## 104 0
## 107 2
## 109 1
## 110 1
## 111 2
## 112 1
## 113 0
## 114 3
## 115 1
## 116 0
## 118 0
## 119 1
## 121 1
## 122 0
## 123 3
## 125 0
## 126 3
## 127 2
## 128 2
## 132 1
## 133 2
## 135 2
## 136 1
## 137 4
## 139 3
## 140 0
## 143 0
## 144 1
## 147 1
## 149 2
## 151 1
## 152 0
## 153 1
## 154 0
## 155 3
## 156 1
## 158 1
## 159 2
## 160 1
## 161 1
## 162 1
## 163 0
## 165 1
## 167 2
## 168 2
## 169 3
## 171 1
## 172 1
## 173 1
## 174 0
## 178 1
## 179 4
## 180 4
## 181 0
## 182 4
## 183 0
## 184 2
## 185 1
## 188 2
## 190 0
## 192 0
## 194 1
## 195 1
## 197 0
## 198 2
## 199 4
## 200 4
## 202 1
## 203 3
## 204 0
## 205 2
## 206 0
## 209 0
## 210 1
## 213 3
## 214 0
## 215 1
## 218 0
## 219 1
## 220 2
## 222 0
## 223 1
## 224 2
## 225 1
## 228 2
## 229 1
## 230 1
## 231 0
## 232 2
## 233 1
## 234 0
## 235 0
## 236 1
## 237 0
## 238 1
## 239 2
## 240 1
## 242 0
## 244 2
## 246 3
## 247 1
## 248 1
## 249 3
## 250 2
## 252 2
## 253 1
## 254 2
## 255 2
## 257 0
## 258 1
## 259 1
## 260 4
## 261 0
## 264 0
## 265 1
## 266 0
## 269 0
## 272 1
## 274 3
## 278 2
## 280 1
## 281 0
## 282 0
## 283 1
## 286 2
## 288 3
## 289 0
## 290 1
## 291 1
## 292 1
## 293 1
## 295 1
## 297 3
## 298 0
## 299 1
## 300 1
## 301 2
## 302 3
## 304 0
## 305 2
## 306 0
## 310 1
## 311 2
## 315 2
## 316 2
## 317 1
## 319 2
## 320 2
## 321 3
## 322 1
## 324 1
## 328 1
## 329 1
## 332 1
## 335 1
## 337 1
## 338 0
## 339 1
## 341 0
## 342 2
## 343 2
## 344 1
## 346 4
## 347 1
## 348 0
## 350 0
## 351 3
## 354 0
## 355 3
## 356 1
## 357 1
## 360 2
## 361 2
## 362 0
## 363 1
## 364 0
## 365 3
## 366 3
## 367 0
## 369 1
## 370 0
## 372 0
## 374 2
## 377 1
## 378 1
## 379 1
## 380 2
## stadium_name
## 2 St. James' Park (Newcastle upon Tyne)
## 3 Vitality Stadium (Bournemouth- Dorset)
## 4 Craven Cottage (London)
## 5 John Smith's Stadium (Huddersfield- West Yorkshire)
## 6 Vicarage Road (Watford)
## 8 Anfield (Liverpool)
## 9 St. Mary's Stadium (Southampton- Hampshire)
## 12 Goodison Park (Liverpool)
## 14 Wembley Stadium (London)
## 15 London Stadium (London)
## 16 Stamford Bridge (London)
## 18 Etihad Stadium (Manchester)
## 19 The American Express Community Stadium (Falmer- East Sussex)
## 20 Selhurst Park (London)
## 21 Molineux Stadium (Wolverhampton- West Midlands)
## 22 Vitality Stadium (Bournemouth- Dorset)
## 23 Emirates Stadium (London)
## 24 John Smith's Stadium (Huddersfield- West Yorkshire)
## 26 Anfield (Liverpool)
## 32 The American Express Community Stadium (Falmer- East Sussex)
## 33 Stamford Bridge (London)
## 35 Goodison Park (Liverpool)
## 37 Etihad Stadium (Manchester)
## 38 Cardiff City Stadium (Cardiff (Caerdydd))
## 39 Turf Moor (Burnley)
## 40 Vicarage Road (Watford)
## 41 Wembley Stadium (London)
## 44 John Smith's Stadium (Huddersfield- West Yorkshire)
## 45 Etihad Stadium (Manchester)
## 46 St. James' Park (Newcastle upon Tyne)
## 47 Vicarage Road (Watford)
## 50 St. Mary's Stadium (Southampton- Hampshire)
## 51 Craven Cottage (London)
## 53 Cardiff City Stadium (Cardiff (Caerdydd))
## 54 Selhurst Park (London)
## 55 King Power Stadium (Leicester- Leicestershire)
## 56 Anfield (Liverpool)
## 57 Old Trafford (Manchester)
## 58 The American Express Community Stadium (Falmer- East Sussex)
## 59 London Stadium (London)
## 60 Emirates Stadium (London)
## 62 Emirates Stadium (London)
## 65 Etihad Stadium (Manchester)
## 67 Molineux Stadium (Wolverhampton- West Midlands)
## 68 Stamford Bridge (London)
## 69 Cardiff City Stadium (Cardiff (Caerdydd))
## 70 Vitality Stadium (Bournemouth- Dorset)
## 71 The American Express Community Stadium (Falmer- East Sussex)
## 75 Wembley Stadium (London)
## 76 Vicarage Road (Watford)
## 77 Old Trafford (Manchester)
## 79 St. Mary's Stadium (Southampton- Hampshire)
## 81 Stamford Bridge (London)
## 83 Cardiff City Stadium (Cardiff (Caerdydd))
## 85 St. James' Park (Newcastle upon Tyne)
## 86 London Stadium (London)
## 88 John Smith's Stadium (Huddersfield- West Yorkshire)
## 89 Goodison Park (Liverpool)
## 90 Emirates Stadium (London)
## 92 Craven Cottage (London)
## 96 King Power Stadium (Leicester- Leicestershire)
## 97 Turf Moor (Burnley)
## 99 Old Trafford (Manchester)
## 102 Cardiff City Stadium (Cardiff (Caerdydd))
## 103 Goodison Park (Liverpool)
## 104 St. James' Park (Newcastle upon Tyne)
## 107 Molineux Stadium (Wolverhampton- West Midlands)
## 109 Stamford Bridge (London)
## 110 John Smith's Stadium (Huddersfield- West Yorkshire)
## 111 Cardiff City Stadium (Cardiff (Caerdydd))
## 112 John Smith's Stadium (Huddersfield- West Yorkshire)
## 113 King Power Stadium (Leicester- Leicestershire)
## 114 St. James' Park (Newcastle upon Tyne)
## 115 St. Mary's Stadium (Southampton- Hampshire)
## 116 Selhurst Park (London)
## 118 Stamford Bridge (London)
## 119 Emirates Stadium (London)
## 121 The American Express Community Stadium (Falmer- East Sussex)
## 122 Goodison Park (Liverpool)
## 123 Craven Cottage (London)
## 125 Vicarage Road (Watford)
## 126 London Stadium (London)
## 127 Wembley Stadium (London)
## 128 Vitality Stadium (Bournemouth- Dorset)
## 132 Selhurst Park (London)
## 133 John Smith's Stadium (Huddersfield- West Yorkshire)
## 135 Etihad Stadium (Manchester)
## 136 St. James' Park (Newcastle upon Tyne)
## 137 St. Mary's Stadium (Southampton- Hampshire)
## 139 Emirates Stadium (London)
## 140 Anfield (Liverpool)
## 143 London Stadium (London)
## 144 Vicarage Road (Watford)
## 147 Molineux Stadium (Wolverhampton- West Midlands)
## 149 Old Trafford (Manchester)
## 151 Vitality Stadium (Bournemouth- Dorset)
## 152 Emirates Stadium (London)
## 153 Turf Moor (Burnley)
## 154 Cardiff City Stadium (Cardiff (Caerdydd))
## 155 Old Trafford (Manchester)
## 156 London Stadium (London)
## 158 King Power Stadium (Leicester- Leicestershire)
## 159 St. James' Park (Newcastle upon Tyne)
## 160 Goodison Park (Liverpool)
## 161 Etihad Stadium (Manchester)
## 162 Selhurst Park (London)
## 163 John Smith's Stadium (Huddersfield- West Yorkshire)
## 165 Vicarage Road (Watford)
## 167 Craven Cottage (London)
## 168 The American Express Community Stadium (Falmer- East Sussex)
## 169 St. Mary's Stadium (Southampton- Hampshire)
## 171 Molineux Stadium (Wolverhampton- West Midlands)
## 172 Emirates Stadium (London)
## 173 Vitality Stadium (Bournemouth- Dorset)
## 174 Stamford Bridge (London)
## 178 London Stadium (London)
## 179 Cardiff City Stadium (Cardiff (Caerdydd))
## 180 Goodison Park (Liverpool)
## 181 Craven Cottage (London)
## 182 Turf Moor (Burnley)
## 183 Selhurst Park (London)
## 184 King Power Stadium (Leicester- Leicestershire)
## 185 Anfield (Liverpool)
## 188 The American Express Community Stadium (Falmer- East Sussex)
## 190 St. Mary's Stadium (Southampton- Hampshire)
## 192 Craven Cottage (London)
## 194 Wembley Stadium (London)
## 195 Vicarage Road (Watford)
## 197 Selhurst Park (London)
## 198 Turf Moor (Burnley)
## 199 St. Mary's Stadium (Southampton- Hampshire)
## 200 Old Trafford (Manchester)
## 202 Emirates Stadium (London)
## 203 Cardiff City Stadium (Cardiff (Caerdydd))
## 204 Stamford Bridge (London)
## 205 John Smith's Stadium (Huddersfield- West Yorkshire)
## 206 London Stadium (London)
## 209 St. James' Park (Newcastle upon Tyne)
## 210 Etihad Stadium (Manchester)
## 213 Turf Moor (Burnley)
## 214 Cardiff City Stadium (Cardiff (Caerdydd))
## 215 Selhurst Park (London)
## 218 Goodison Park (Liverpool)
## 219 Wembley Stadium (London)
## 220 Etihad Stadium (Manchester)
## 222 Vitality Stadium (Bournemouth- Dorset)
## 223 Anfield (Liverpool)
## 224 Old Trafford (Manchester)
## 225 St. James' Park (Newcastle upon Tyne)
## 228 Emirates Stadium (London)
## 229 John Smith's Stadium (Huddersfield- West Yorkshire)
## 230 Craven Cottage (London)
## 231 Emirates Stadium (London)
## 232 Craven Cottage (London)
## 233 John Smith's Stadium (Huddersfield- West Yorkshire)
## 234 Molineux Stadium (Wolverhampton- West Midlands)
## 235 Old Trafford (Manchester)
## 236 St. James' Park (Newcastle upon Tyne)
## 237 Vitality Stadium (Bournemouth- Dorset)
## 238 St. Mary's Stadium (Southampton- Hampshire)
## 239 Anfield (Liverpool)
## 240 Wembley Stadium (London)
## 242 The American Express Community Stadium (Falmer- East Sussex)
## 244 Stamford Bridge (London)
## 246 Goodison Park (Liverpool)
## 247 Cardiff City Stadium (Cardiff (Caerdydd))
## 248 King Power Stadium (Leicester- Leicestershire)
## 249 Etihad Stadium (Manchester)
## 250 London Stadium (London)
## 252 Craven Cottage (London)
## 253 Selhurst Park (London)
## 254 John Smith's Stadium (Huddersfield- West Yorkshire)
## 255 Anfield (Liverpool)
## 257 Vicarage Road (Watford)
## 258 The American Express Community Stadium (Falmer- East Sussex)
## 259 Wembley Stadium (London)
## 260 Etihad Stadium (Manchester)
## 261 Molineux Stadium (Wolverhampton- West Midlands)
## 264 Turf Moor (Burnley)
## 265 Vitality Stadium (Bournemouth- Dorset)
## 266 St. James' Park (Newcastle upon Tyne)
## 269 Old Trafford (Manchester)
## 272 King Power Stadium (Leicester- Leicestershire)
## 274 Emirates Stadium (London)
## 278 Anfield (Liverpool)
## 280 Wembley Stadium (London)
## 281 Vitality Stadium (Bournemouth- Dorset)
## 282 The American Express Community Stadium (Falmer- East Sussex)
## 283 Turf Moor (Burnley)
## 286 London Stadium (London)
## 288 Craven Cottage (London)
## 289 Goodison Park (Liverpool)
## 290 Selhurst Park (London)
## 291 Cardiff City Stadium (Cardiff (Caerdydd))
## 292 John Smith's Stadium (Huddersfield- West Yorkshire)
## 293 King Power Stadium (Leicester- Leicestershire)
## 295 St. Mary's Stadium (Southampton- Hampshire)
## 297 Anfield (Liverpool)
## 298 Stamford Bridge (London)
## 299 Emirates Stadium (London)
## 300 Vitality Stadium (Bournemouth- Dorset)
## 301 Turf Moor (Burnley)
## 302 London Stadium (London)
## 304 Goodison Park (Liverpool)
## 305 Craven Cottage (London)
## 306 The American Express Community Stadium (Falmer- East Sussex)
## 310 Old Trafford (Manchester)
## 311 London Stadium (London)
## 315 Vicarage Road (Watford)
## 316 Molineux Stadium (Wolverhampton- West Midlands)
## 317 Stamford Bridge (London)
## 319 Etihad Stadium (Manchester)
## 320 St. Mary's Stadium (Southampton- Hampshire)
## 321 Vitality Stadium (Bournemouth- Dorset)
## 322 John Smith's Stadium (Huddersfield- West Yorkshire)
## 324 Goodison Park (Liverpool)
## 328 The American Express Community Stadium (Falmer- East Sussex)
## 329 Turf Moor (Burnley)
## 332 Old Trafford (Manchester)
## 335 Vicarage Road (Watford)
## 337 Etihad Stadium (Manchester)
## 338 Vitality Stadium (Bournemouth- Dorset)
## 339 John Smith's Stadium (Huddersfield- West Yorkshire)
## 341 Molineux Stadium (Wolverhampton- West Midlands)
## 342 St. James' Park (Newcastle upon Tyne)
## 343 Goodison Park (Liverpool)
## 344 Emirates Stadium (London)
## 346 Stamford Bridge (London)
## 347 Vicarage Road (Watford)
## 348 Tottenham Hotspur Stadium (London)
## 350 Old Trafford (Manchester)
## 351 Anfield (Liverpool)
## 354 Craven Cottage (London)
## 355 St. Mary's Stadium (Southampton- Hampshire)
## 356 Vicarage Road (Watford)
## 357 The American Express Community Stadium (Falmer- East Sussex)
## 360 Old Trafford (Manchester)
## 361 Goodison Park (Liverpool)
## 362 Vitality Stadium (Bournemouth- Dorset)
## 363 London Stadium (London)
## 364 Molineux Stadium (Wolverhampton- West Midlands)
## 365 Cardiff City Stadium (Cardiff (Caerdydd))
## 366 St. James' Park (Newcastle upon Tyne)
## 367 Stamford Bridge (London)
## 369 Emirates Stadium (London)
## 370 Etihad Stadium (Manchester)
## 372 Turf Moor (Burnley)
## 374 Craven Cottage (London)
## 377 Old Trafford (Manchester)
## 378 St. Mary's Stadium (Southampton- Hampshire)
## 379 Tottenham Hotspur Stadium (London)
## 380 Vicarage Road (Watford)
model <- lm(total_goals_at_half_time ~ total_goal_count, data = HW)
summary(model)
##
## Call:
## lm(formula = total_goals_at_half_time ~ total_goal_count, data = HW)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.16794 -0.44923 0.09765 0.55077 2.19141
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.003888 0.108551 -0.036 0.971
## total_goal_count 0.453119 0.033544 13.508 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.8287 on 250 degrees of freedom
## Multiple R-squared: 0.4219, Adjusted R-squared: 0.4196
## F-statistic: 182.5 on 1 and 250 DF, p-value: < 2.2e-16
library(colorspace)
col.rainbow <- rainbow(2)
palette(col.rainbow)
plot(data$total_goal_count, data$total_goals_at_half_time,pch=19,col = as.factor(data$total_goal_count))
abline(model)
ggplot(data = data, mapping = aes(total_goal_count,total_goals_at_half_time,color = "pink"))+
geom_jitter()+
geom_smooth(method = lm)
## `geom_smooth()` using formula 'y ~ x'
pre <- predict(model,data[-data$total_goal_count,])
pre
## 9 10 11 12 13 14
## -0.003888091 0.902349109 -0.003888091 1.355467709 0.902349109 1.808586308
## 15 16 17 18 19 20
## 1.355467709 2.261704908 1.808586308 3.167942108 2.261704908 0.902349109
## 21 22 23 24 25 26
## 0.902349109 1.808586308 1.808586308 -0.003888091 1.355467709 0.449230509
## 27 28 29 30 31 32
## 1.355467709 2.714823508 1.355467709 1.355467709 1.355467709 1.808586308
## 33 34 35 36 37 38
## 0.902349109 0.902349109 0.902349109 0.449230509 1.355467709 2.261704908
## 39 40 41 42 43 44
## 0.902349109 1.355467709 1.355467709 2.714823508 2.261704908 0.449230509
## 45 46 47 48 49 50
## 1.355467709 1.355467709 1.355467709 0.449230509 1.808586308 1.808586308
## 51 52 53 54 55 56
## 0.902349109 1.808586308 2.261704908 -0.003888091 1.808586308 1.355467709
## 57 58 59 60 61 62
## 0.902349109 1.355467709 -0.003888091 0.902349109 1.808586308 0.902349109
## 63 64 65 66 67 68
## 1.355467709 0.902349109 0.902349109 0.902349109 0.902349109 0.902349109
## 69 70 71 72 73 74
## 1.355467709 1.355467709 0.449230509 0.902349109 0.449230509 1.355467709
## 75 76 77 78 79 80
## 0.449230509 1.808586308 2.261704908 2.714823508 1.355467709 -0.003888091
## 81 82 83 84 85 86
## 1.808586308 -0.003888091 2.714823508 2.261704908 0.449230509 0.449230509
## 87 88 89 90 91 92
## 0.902349109 0.449230509 0.902349109 1.808586308 0.449230509 1.355467709
## 93 94 95 96 97 98
## 2.261704908 -0.003888091 1.355467709 0.902349109 1.808586308 1.808586308
## 99 100 101 102 103 104
## 1.355467709 0.449230509 1.355467709 0.449230509 1.808586308 0.449230509
## 105 106 107 108 109 110
## 2.714823508 0.902349109 2.261704908 3.167942108 1.808586308 0.449230509
## 111 112 113 114 115 116
## 1.355467709 0.902349109 -0.003888091 1.355467709 0.902349109 0.449230509
## 117 118 119 120 121 122
## 0.902349109 -0.003888091 0.902349109 1.808586308 0.902349109 0.449230509
## 123 124 125 126 127 128
## 2.261704908 -0.003888091 1.355467709 1.808586308 1.808586308 1.355467709
## 129 130 131 132 133 134
## 0.902349109 1.355467709 1.355467709 0.902349109 1.355467709 0.902349109
## 135 136 137 138 139 140
## 1.808586308 1.355467709 1.808586308 0.902349109 2.714823508 0.449230509
## 141 142 143 144 145 146
## 1.355467709 1.808586308 1.808586308 1.355467709 1.808586308 0.902349109
## 147 148 149 150 151 152
## 1.355467709 0.902349109 1.808586308 1.808586308 1.808586308 0.449230509
## 153 154 155 156 157 158
## 0.449230509 0.449230509 2.261704908 2.261704908 0.902349109 0.902349109
## 159 160 161 162 163 164
## 1.355467709 1.808586308 1.808586308 0.449230509 0.449230509 0.449230509
## 165 166 167 168 169 170
## 2.261704908 0.902349109 0.902349109 1.355467709 2.261704908 1.808586308
## 171 172 173 174 175 176
## 0.902349109 1.808586308 0.902349109 0.449230509 1.808586308 2.261704908
## 177 178 179 180 181 182
## -0.003888091 0.902349109 2.714823508 3.621060708 0.902349109 2.714823508
## 183 184 185 186 187 188
## -0.003888091 1.355467709 1.808586308 1.808586308 2.261704908 0.902349109
## 189 190 191 192 193 194
## 1.355467709 1.355467709 0.449230509 0.449230509 0.449230509 1.808586308
## 195 196 197 198 199 200
## 0.902349109 2.714823508 0.449230509 0.902349109 1.808586308 2.261704908
## 201 202 203 204 205 206
## 0.449230509 2.261704908 1.355467709 -0.003888091 1.355467709 1.808586308
## 207 208 209 210 211 212
## 0.902349109 2.714823508 0.902349109 1.355467709 0.449230509 0.449230509
## 213 214 215 216 217 218
## 1.355467709 -0.003888091 1.355467709 1.355467709 1.355467709 0.902349109
## 219 220 221 222 223 224
## 0.449230509 1.355467709 3.167942108 0.902349109 3.167942108 1.355467709
## 225 226 227 228 229 230
## 1.355467709 1.355467709 -0.003888091 0.902349109 1.355467709 1.355467709
## 231 232 233 234 235 236
## 1.355467709 2.714823508 0.449230509 1.355467709 1.808586308 1.355467709
## 237 238 239 240 241 242
## 1.808586308 0.902349109 0.902349109 1.355467709 0.449230509 -0.003888091
## 243 244 245 246 247 248
## 0.902349109 2.261704908 0.902349109 1.808586308 0.902349109 0.449230509
## 249 250 251 252 253 254
## 1.808586308 0.902349109 0.902349109 1.355467709 0.902349109 1.355467709
## 255 256 257 258 259 260
## 1.355467709 1.355467709 0.449230509 1.808586308 1.808586308 2.714823508
## 261 262 263 264 265 266
## 0.902349109 2.714823508 1.808586308 1.355467709 0.902349109 0.902349109
## 267 268 269 270 271 272
## 2.261704908 0.902349109 -0.003888091 1.355467709 0.449230509 1.355467709
## 273 274 275 276 277 278
## 0.902349109 2.714823508 0.902349109 1.808586308 0.902349109 2.261704908
## 279 280 281 282 283 284
## 0.449230509 0.902349109 0.449230509 0.449230509 1.808586308 2.261704908
## 285 286 287 288 289 290
## 0.902349109 0.902349109 1.355467709 1.355467709 -0.003888091 1.355467709
## 291 292 293 294 295 296
## 0.902349109 0.902349109 1.808586308 2.261704908 1.355467709 1.808586308
## 297 298 299 300 301 302
## 2.714823508 0.902349109 0.902349109 1.808586308 1.355467709 3.167942108
## 303 304 305 306 307 308
## 1.355467709 0.902349109 0.902349109 0.449230509 0.902349109 0.902349109
## 309 310 311 312 313 314
## 0.902349109 1.355467709 0.902349109 1.355467709 1.355467709 0.902349109
## 315 316 317 318 319 320
## 2.261704908 1.355467709 1.355467709 0.902349109 0.902349109 1.808586308
## 321 322 323 324 325 326
## 1.808586308 2.261704908 0.449230509 0.449230509 0.902349109 0.449230509
## 327 328 329 330 331 332
## 1.808586308 2.261704908 0.902349109 0.902349109 1.808586308 1.355467709
## 333 334 335 336 337 338
## 1.808586308 0.902349109 0.449230509 0.902349109 0.449230509 0.449230509
## 339 340 341 342 343 344
## 1.355467709 1.808586308 -0.003888091 1.808586308 1.808586308 2.261704908
## 345 346 347 348 349 350
## 0.902349109 1.808586308 0.902349109 0.449230509 1.808586308 0.902349109
## 351 352 353 354 355 356
## 2.261704908 0.449230509 -0.003888091 0.449230509 2.714823508 1.355467709
## 357 358 359 360 361 362
## 0.902349109 1.355467709 0.449230509 0.902349109 0.902349109 0.449230509
## 363 364 365 366 367 368
## 1.355467709 0.449230509 2.261704908 2.261704908 1.355467709 0.902349109
## 369 370 371 372 373 374
## 0.902349109 0.449230509 2.261704908 1.808586308 3.621060708 1.808586308
## 375 376 377 378 379 380
## -0.003888091 0.902349109 0.902349109 0.902349109 1.808586308 2.261704908
train.control <- trainControl(method = "cv", number = 10)
mode <- train(total_goal_count ~ total_goals_at_half_time, data = data,
method="lm",
trControl=train.control)
print(mode)
## Linear Regression
##
## 380 samples
## 1 predictor
##
## No pre-processing
## Resampling: Cross-Validated (10 fold)
## Summary of sample sizes: 343, 342, 343, 342, 341, 340, ...
## Resampling results:
##
## RMSE Rsquared MAE
## 1.19199 0.4471828 1.004419
##
## Tuning parameter 'intercept' was held constant at a value of TRUE
summary(mode)
##
## Call:
## lm(formula = .outcome ~ ., data = dat)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.6558 -0.6558 -0.4466 0.5534 4.4140
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.65577 0.09124 18.15 <2e-16 ***
## total_goals_at_half_time 0.93027 0.05382 17.29 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1.198 on 378 degrees of freedom
## Multiple R-squared: 0.4415, Adjusted R-squared: 0.44
## F-statistic: 298.8 on 1 and 378 DF, p-value: < 2.2e-16