Email: anujagarwal237@gmail.com

College: IIT Bombay

1. Introduction

Ultimate Team is one of the most popular modes in FIFA, as people are able to build their dream squads of the best players from around the world.Building a team is the biggest challenge in FIFA 18 Ultimate Team. It doesn’t need to be the best team, this is because the budget may not allow it, but it needs to be the player’s stature for him to obtain success.Planning and building the team is half the fun for some people, while others simply want the best squad available.

2. Overview of the Study

I have been a huge soccer fan since my childhood and have grown up loving the sport. With this project, I aim to combine my knowledge of data analytics and the passion for the sport to discover insights that we may not normally come across while watching a particular game or discussing it with our friends.We will be utilizing data about the attributes of the players from the latest EA Sports FIFA 18- Soccer Video Game.This paper analysises the correlation between a players age and other variables like- overall rating and potential.

3. Dataset

The data used in this paper is obtained from a secondary source.(https://www.kaggle.com/kamils/fifa-18-data-exploration/data) This dataset contains data of over 18000 players with 75 different columns including Overall rating and Potential(variables taken into account in this analysis).

setwd("C:/Anuj")
players <- read.csv(paste("CompleteDataset.csv",sep=""))
dim(players)
## [1] 17981    75
head(players)
##   X              Name Age                                           Photo
## 1 0 Cristiano Ronaldo  32  https://cdn.sofifa.org/48/18/players/20801.png
## 2 1          L. Messi  30 https://cdn.sofifa.org/48/18/players/158023.png
## 3 2            Neymar  25 https://cdn.sofifa.org/48/18/players/190871.png
## 4 3        L. Suárez  30 https://cdn.sofifa.org/48/18/players/176580.png
## 5 4          M. Neuer  31 https://cdn.sofifa.org/48/18/players/167495.png
## 6 5    R. Lewandowski  28 https://cdn.sofifa.org/48/18/players/188545.png
##   Nationality                                Flag Overall Potential
## 1    Portugal https://cdn.sofifa.org/flags/38.png      94        94
## 2   Argentina https://cdn.sofifa.org/flags/52.png      93        93
## 3      Brazil https://cdn.sofifa.org/flags/54.png      92        94
## 4     Uruguay https://cdn.sofifa.org/flags/60.png      92        92
## 5     Germany https://cdn.sofifa.org/flags/21.png      92        92
## 6      Poland https://cdn.sofifa.org/flags/37.png      91        91
##                  Club                                  Club.Logo    Value
## 1      Real Madrid CF https://cdn.sofifa.org/24/18/teams/243.png €95.5M
## 2        FC Barcelona https://cdn.sofifa.org/24/18/teams/241.png  €105M
## 3 Paris Saint-Germain  https://cdn.sofifa.org/24/18/teams/73.png  €123M
## 4        FC Barcelona https://cdn.sofifa.org/24/18/teams/241.png   €97M
## 5    FC Bayern Munich  https://cdn.sofifa.org/24/18/teams/21.png   €61M
## 6    FC Bayern Munich  https://cdn.sofifa.org/24/18/teams/21.png   €92M
##      Wage Special Acceleration Aggression Agility Balance Ball.control
## 1 €565K    2228           89         63      89      63           93
## 2 €565K    2154           92         48      90      95           95
## 3 €280K    2100           94         56      96      82           95
## 4 €510K    2291           88         78      86      60           91
## 5 €230K    1493           58         29      52      35           48
## 6 €355K    2143           79         80      78      80           89
##   Composure Crossing Curve Dribbling Finishing Free.kick.accuracy
## 1        95       85    81        91        94                 76
## 2        96       77    89        97        95                 90
## 3        92       75    81        96        89                 84
## 4        83       77    86        86        94                 84
## 5        70       15    14        30        13                 11
## 6        87       62    77        85        91                 84
##   GK.diving GK.handling GK.kicking GK.positioning GK.reflexes
## 1         7          11         15             14          11
## 2         6          11         15             14           8
## 3         9           9         15             15          11
## 4        27          25         31             33          37
## 5        91          90         95             91          89
## 6        15           6         12              8          10
##   Heading.accuracy Interceptions Jumping Long.passing Long.shots Marking
## 1               88            29      95           77         92      22
## 2               71            22      68           87         88      13
## 3               62            36      61           75         77      21
## 4               77            41      69           64         86      30
## 5               25            30      78           59         16      10
## 6               85            39      84           65         83      25
##   Penalties Positioning Reactions Short.passing Shot.power Sliding.tackle
## 1        85          95        96            83         94             23
## 2        74          93        95            88         85             26
## 3        81          90        88            81         80             33
## 4        85          92        93            83         87             38
## 5        47          12        85            55         25             11
## 6        81          91        91            83         88             19
##   Sprint.speed Stamina Standing.tackle Strength Vision Volleys CAM CB CDM
## 1           91      92              31       80     85      88  89 53  62
## 2           87      73              28       59     90      85  92 45  59
## 3           90      78              24       53     80      83  88 46  59
## 4           77      89              45       80     84      88  87 58  65
## 5           61      44              10       83     70      11  NA NA  NA
## 6           83      79              42       84     78      87  84 57  62
##   CF CM     ID LAM LB LCB LCM LDM LF LM LS LW LWB Preferred.Positions RAM
## 1 91 82  20801  89 61  53  82  62 91 89 92 91  66              ST LW   89
## 2 92 84 158023  92 57  45  84  59 92 90 88 91  62                 RW   92
## 3 88 79 190871  88 59  46  79  59 88 87 84 89  64                 LW   88
## 4 88 80 176580  87 64  58  80  65 88 85 88 87  68                 ST   87
## 5 NA NA 167495  NA NA  NA  NA  NA NA NA NA NA  NA                 GK   NA
## 6 87 78 188545  84 58  57  78  62 87 82 88 84  61                 ST   84
##   RB RCB RCM RDM RF RM RS RW RWB ST
## 1 61  53  82  62 91 89 92 91  66 92
## 2 57  45  84  59 92 90 88 91  62 88
## 3 59  46  79  59 88 87 84 89  64 84
## 4 64  58  80  65 88 85 88 87  68 88
## 5 NA  NA  NA  NA NA NA NA NA  NA NA
## 6 58  57  78  62 87 82 88 84  61 88

3.1 Descriptive statistics

library(psych)
describe(players)[,c(1:5)]
##                      vars     n      mean       sd median
## X                       1 17981   8990.00  5190.81   8990
## Name*                   2 17981   8460.96  4892.67   8422
## Age                     3 17981     25.14     4.61     25
## Photo*                  4 17981   8960.84  5170.09   8952
## Nationality*            5 17981     77.85    47.91     72
## Flag*                   6 17981     94.16    37.81    105
## Overall                 7 17981     66.25     6.99     66
## Potential               8 17981     71.19     6.10     71
## Club*                   9 17981    321.15   189.04    322
## Club.Logo*             10 17981    329.41   189.94    333
## Value*                 11 17981    102.93    67.10    108
## Wage*                  12 17981     60.55    36.37     59
## Special                13 17981   1594.10   272.15   1633
## Acceleration*          14 17981     85.02    36.98     85
## Aggression*            15 17981     69.37    37.14     69
## Agility*               16 17981     79.50    34.22     79
## Balance*               17 17981     72.34    29.55     74
## Ball.control*          18 17981     91.87    44.98     97
## Composure*             19 17981     80.83    36.05     81
## Crossing*              20 17981     72.52    46.08     68
## Curve*                 21 17981     59.01    37.59     54
## Dribbling*             22 17981     91.11    48.50     96
## Finishing*             23 17981     69.81    47.49     65
## Free.kick.accuracy*    24 17981     45.53    31.13     40
## GK.diving*             25 17981     34.64    35.25      8
## GK.handling*           26 17981     33.61    34.67      7
## GK.kicking*            27 17981     38.33    38.72      8
## GK.positioning*        28 17981     36.23    36.60      8
## GK.reflexes*           29 17981     35.28    36.09      8
## Heading.accuracy*      30 17981     67.98    37.34     65
## Interceptions*         31 17981     72.08    48.46     71
## Jumping*               32 17981     68.68    32.72     64
## Long.passing*          33 17981     83.71    45.39     85
## Long.shots*            34 17981     63.28    39.16     58
## Marking*               35 17981     69.66    51.46     61
## Penalties*             36 17981     49.10    24.77     46
## Positioning*           37 17981     72.39    41.34     70
## Reactions*             38 17981     75.50    35.20     75
## Short.passing*         39 17981    102.19    52.00    101
## Shot.power*            40 17981     70.07    36.52     70
## Sliding.tackle*        41 17981     63.91    45.97     62
## Sprint.speed*          42 17981     96.18    46.01     89
## Stamina*               43 17981     92.75    44.84     92
## Standing.tackle*       44 17981     72.51    52.40     69
## Strength*              45 17981     86.30    36.86     78
## Vision*                46 17981     72.75    38.58     70
## Volleys*               47 17981     48.41    29.13     44
## CAM                    48 15952     59.25     9.88     60
## CB                     49 15952     55.55    12.19     57
## CDM                    50 15952     56.87    10.31     58
## CF                     51 15952     59.03     9.93     60
## CM                     52 15952     58.51     8.89     59
## ID                     53 17981 207658.71 32291.67 214057
## LAM                    54 15952     59.25     9.88     60
## LB                     55 15952     56.98     9.79     58
## LCB                    56 15952     55.55    12.19     57
## LCM                    57 15952     58.51     8.89     59
## LDM                    58 15952     56.87    10.31     58
## LF                     59 15952     59.03     9.93     60
## LM                     60 15952     60.06     9.35     61
## LS                     61 15952     58.20     9.18     59
## LW                     62 15952     59.36     9.98     60
## LWB                    63 15952     57.70     9.14     58
## Preferred.Positions*   64 17981    335.92   233.08    280
## RAM                    65 15952     59.25     9.88     60
## RB                     66 15952     56.98     9.79     58
## RCB                    67 15952     55.55    12.19     57
## RCM                    68 15952     58.51     8.89     59
## RDM                    69 15952     56.87    10.31     58
## RF                     70 15952     59.03     9.93     60
## RM                     71 15952     60.06     9.35     61
## RS                     72 15952     58.20     9.18     59
## RW                     73 15952     59.36     9.98     60
## RWB                    74 15952     57.70     9.14     58
## ST                     75 15952     58.20     9.18     59

3.2 Contingency tables

str(players)
## 'data.frame':    17981 obs. of  75 variables:
##  $ X                  : int  0 1 2 3 4 5 6 7 8 9 ...
##  $ Name               : Factor w/ 16975 levels "A. Ömür","A. Örn Arnarson",..: 3203 9648 12428 9850 11176 13779 4211 4519 15725 5805 ...
##  $ Age                : int  32 30 25 30 31 28 26 26 27 29 ...
##  $ Photo              : Factor w/ 17929 levels "https://cdn.sofifa.org/48/18/players/101317.png",..: 7185 775 4020 2122 1521 3500 4392 2738 2666 1544 ...
##  $ Nationality        : Factor w/ 165 levels "Afghanistan",..: 122 6 19 159 59 121 139 13 59 6 ...
##  $ Flag               : Factor w/ 165 levels "https://cdn.sofifa.org/flags/1.png",..: 109 125 127 134 88 108 117 140 88 125 ...
##  $ Overall            : int  94 93 92 92 92 91 90 90 90 90 ...
##  $ Potential          : int  94 93 94 92 92 91 92 91 90 90 ...
##  $ Club               : Factor w/ 648 levels ""," SSV Jahn Regensburg",..: 472 226 437 226 229 229 384 148 472 339 ...
##  $ Club.Logo          : Factor w/ 679 levels "https://cdn.sofifa.org/24/18/teams/1.png",..: 467 465 610 465 448 448 62 549 467 528 ...
##  $ Value              : Factor w/ 207 levels "€0","€1.1M",..: 203 13 21 206 168 202 170 198 187 186 ...
##  $ Wage               : Factor w/ 142 levels "€0","€100K",..: 94 94 54 88 42 68 37 57 66 52 ...
##  $ Special            : int  2228 2154 2100 2291 1493 2143 1458 2096 2165 1961 ...
##  $ Acceleration       : Factor w/ 161 levels "11","12","13",..: 151 156 159 150 57 130 55 158 63 126 ...
##  $ Aggression         : Factor w/ 151 levels "11","12","13",..: 79 44 59 124 20 129 31 57 72 48 ...
##  $ Agility            : Factor w/ 146 levels "14","15","16",..: 139 140 146 136 49 118 64 143 101 110 ...
##  $ Balance            : Factor w/ 135 levels "11","15","16",..: 63 134 115 57 23 109 31 130 82 82 ...
##  $ Ball.control       : Factor w/ 184 levels "10","11","12",..: 182 184 184 180 49 177 40 181 177 172 ...
##  $ Composure          : Factor w/ 161 levels "11","12","13",..: 160 161 159 150 123 154 97 154 152 153 ...
##  $ Crossing           : Factor w/ 176 levels "10","11","12",..: 168 155 153 155 6 100 8 162 168 130 ...
##  $ Curve              : Factor w/ 153 levels "10","11","12",..: 141 150 141 147 5 133 12 143 146 126 ...
##  $ Dribbling          : Factor w/ 194 levels "10","11","11+6",..: 190 194 193 183 23 182 10 192 172 180 ...
##  $ Finishing          : Factor w/ 187 levels "10","11","12",..: 186 187 182 186 4 185 4 176 161 185 ...
##  $ Free.kick.accuracy : Factor w/ 136 levels "10","11","12",..: 116 134 127 127 2 127 10 120 127 76 ...
##  $ GK.diving          : Factor w/ 100 levels "1","10","11",..: 66 45 98 17 100 7 99 3 2 30 ...
##  $ GK.handling        : Factor w/ 97 levels "1","10","11",..: 3 3 95 14 96 47 91 4 3 4 ...
##  $ GK.kicking         : Factor w/ 103 levels "1","10","11",..: 7 7 7 22 103 4 100 58 5 81 ...
##  $ GK.positioning     : Factor w/ 99 levels "1","10","11",..: 6 6 7 21 99 88 95 88 75 35 ...
##  $ GK.reflexes        : Factor w/ 102 levels "1","10","11",..: 3 85 3 22 100 2 102 85 2 2 ...
##  $ Heading.accuracy   : Factor w/ 158 levels "10","11","12",..: 151 118 87 136 16 147 12 68 61 149 ...
##  $ Interceptions      : Factor w/ 174 levels "10","10-11","11",..: 28 18 37 47 29 43 29 47 166 15 ...
##  $ Jumping            : Factor w/ 140 levels "13","15","16",..: 140 74 50 80 115 127 69 42 11 118 ...
##  $ Long.passing       : Factor w/ 188 levels "10","11","12",..: 168 182 162 119 98 122 67 174 188 98 ...
##  $ Long.shots         : Factor w/ 156 levels "10","11","12",..: 156 152 136 150 7 147 3 146 154 146 ...
##  $ Marking            : Factor w/ 183 levels "10","11","12",..: 16 4 15 30 1 23 4 23 108 3 ...
##  $ Penalties          : Factor w/ 117 levels "10","11","12",..: 109 96 104 109 41 104 32 110 95 88 ...
##  $ Positioning        : Factor w/ 171 levels "10","10-3","11",..: 171 170 167 169 4 168 4 161 151 169 ...
##  $ Reactions          : Factor w/ 158 levels "28","30","31",..: 158 157 151 156 148 154 151 148 149 151 ...
##  $ Short.passing      : Factor w/ 209 levels "10","11","12",..: 199 205 195 199 71 199 57 203 207 179 ...
##  $ Shot.power         : Factor w/ 153 levels "10","11","12",..: 153 143 134 146 17 147 24 131 146 147 ...
##  $ Sliding.tackle     : Factor w/ 169 levels "10","11","12",..: 18 22 33 40 2 12 4 17 123 10 ...
##  $ Sprint.speed       : Factor w/ 194 levels "11","12","13",..: 188 178 185 143 69 165 61 178 48 155 ...
##  $ Stamina            : Factor w/ 180 levels "12","13","14",..: 177 124 144 173 38 149 31 149 142 117 ...
##  $ Standing.tackle    : Factor w/ 187 levels "10","11","12",..: 28 24 18 53 1 49 15 22 174 16 ...
##  $ Strength           : Factor w/ 168 levels "12","20","21",..: 137 65 48 137 144 148 72 73 114 151 ...
##  $ Vision             : Factor w/ 173 levels "10","11","12",..: 165 170 160 164 127 154 119 166 168 127 ...
##  $ Volleys            : Factor w/ 125 levels "10","11","12",..: 121 118 116 121 2 120 4 111 115 121 ...
##  $ CAM                : num  89 92 88 87 NA 84 NA 88 83 81 ...
##  $ CB                 : num  53 45 46 58 NA 57 NA 47 72 46 ...
##  $ CDM                : num  62 59 59 65 NA 62 NA 61 82 52 ...
##  $ CF                 : num  91 92 88 88 NA 87 NA 87 81 84 ...
##  $ CM                 : num  82 84 79 80 NA 78 NA 81 87 71 ...
##  $ ID                 : int  20801 158023 190871 176580 167495 188545 193080 183277 182521 167664 ...
##  $ LAM                : num  89 92 88 87 NA 84 NA 88 83 81 ...
##  $ LB                 : num  61 57 59 64 NA 58 NA 59 76 51 ...
##  $ LCB                : num  53 45 46 58 NA 57 NA 47 72 46 ...
##  $ LCM                : num  82 84 79 80 NA 78 NA 81 87 71 ...
##  $ LDM                : num  62 59 59 65 NA 62 NA 61 82 52 ...
##  $ LF                 : num  91 92 88 88 NA 87 NA 87 81 84 ...
##  $ LM                 : num  89 90 87 85 NA 82 NA 87 81 79 ...
##  $ LS                 : num  92 88 84 88 NA 88 NA 82 77 87 ...
##  $ LW                 : num  91 91 89 87 NA 84 NA 88 80 82 ...
##  $ LWB                : num  66 62 64 68 NA 61 NA 64 78 55 ...
##  $ Preferred.Positions: Factor w/ 802 levels "CAM ","CAM CB ",..: 781 650 428 736 280 736 280 428 122 736 ...
##  $ RAM                : num  89 92 88 87 NA 84 NA 88 83 81 ...
##  $ RB                 : num  61 57 59 64 NA 58 NA 59 76 51 ...
##  $ RCB                : num  53 45 46 58 NA 57 NA 47 72 46 ...
##  $ RCM                : num  82 84 79 80 NA 78 NA 81 87 71 ...
##  $ RDM                : num  62 59 59 65 NA 62 NA 61 82 52 ...
##  $ RF                 : num  91 92 88 88 NA 87 NA 87 81 84 ...
##  $ RM                 : num  89 90 87 85 NA 82 NA 87 81 79 ...
##  $ RS                 : num  92 88 84 88 NA 88 NA 82 77 87 ...
##  $ RW                 : num  91 91 89 87 NA 84 NA 88 80 82 ...
##  $ RWB                : num  66 62 64 68 NA 61 NA 64 78 55 ...
##  $ ST                 : num  92 88 84 88 NA 88 NA 82 77 87 ...
mytable <- with(players,table(Preferred.Positions))
head(mytable)
## Preferred.Positions
##           CAM         CAM CB     CAM CB CDM      CAM CB CM  CAM CB CM CDM  
##            320              1              2              1              1 
##       CAM CDM  
##             18
mytable <- xtabs(~Preferred.Positions+Nationality,data=players)
head(mytable)
##                    Nationality
## Preferred.Positions Afghanistan Albania Algeria Angola Antigua & Barbuda
##      CAM                      0       1       1      0                 0
##      CAM CB                   0       0       0      0                 0
##      CAM CB CDM               0       0       0      0                 0
##      CAM CB CM                0       0       0      0                 0
##      CAM CB CM CDM            0       0       0      0                 0
##      CAM CDM                  0       0       0      0                 0
##                    Nationality
## Preferred.Positions Argentina Armenia Australia Austria Azerbaijan
##      CAM                   24       1         9       5          0
##      CAM CB                 0       0         0       0          0
##      CAM CB CDM             0       0         0       0          0
##      CAM CB CM              0       0         0       0          0
##      CAM CB CM CDM          0       0         0       0          0
##      CAM CDM                0       0         0       0          0
##                    Nationality
## Preferred.Positions Barbados Belarus Belgium Belize Benin Bermuda Bolivia
##      CAM                   0       0       7      0     0       0       1
##      CAM CB                0       0       0      0     0       0       0
##      CAM CB CDM            0       0       0      0     0       0       0
##      CAM CB CM             0       0       1      0     0       0       0
##      CAM CB CM CDM         0       0       0      0     0       0       0
##      CAM CDM               0       0       0      0     0       0       0
##                    Nationality
## Preferred.Positions Bosnia Herzegovina Brazil Brunei Darussalam Bulgaria
##      CAM                             2     38                 0        0
##      CAM CB                          0      0                 0        0
##      CAM CB CDM                      0      0                 0        0
##      CAM CB CM                       0      0                 0        0
##      CAM CB CM CDM                   0      0                 0        0
##      CAM CDM                         1      0                 0        0
##                    Nationality
## Preferred.Positions Burkina Faso Burundi Cameroon Canada Cape Verde
##      CAM                       0       0        1      0          1
##      CAM CB                    0       0        0      0          0
##      CAM CB CDM                0       0        0      0          0
##      CAM CB CM                 0       0        0      0          0
##      CAM CB CM CDM             0       0        0      0          0
##      CAM CDM                   0       0        0      0          0
##                    Nationality
## Preferred.Positions Central African Rep. Chad Chile China PR Colombia
##      CAM                               0    0    20        0       27
##      CAM CB                            0    0     0        0        0
##      CAM CB CDM                        0    0     0        0        0
##      CAM CB CM                         0    0     0        0        0
##      CAM CB CM CDM                     0    0     0        0        0
##      CAM CDM                           0    0     0        0        0
##                    Nationality
## Preferred.Positions Comoros Congo Costa Rica Croatia Cuba Curacao Cyprus
##      CAM                  0     0          0       5    0       0      0
##      CAM CB               0     0          0       0    0       0      0
##      CAM CB CDM           0     0          0       0    0       0      0
##      CAM CB CM            0     0          0       0    0       0      0
##      CAM CB CM CDM        0     0          0       0    0       0      0
##      CAM CDM              1     0          0       0    0       0      0
##                    Nationality
## Preferred.Positions Czech Republic Denmark Dominican Republic DR Congo
##      CAM                         0       3                  0        0
##      CAM CB                      0       1                  0        0
##      CAM CB CDM                  0       0                  0        0
##      CAM CB CM                   0       0                  0        0
##      CAM CB CM CDM               0       0                  0        0
##      CAM CDM                     0       1                  0        0
##                    Nationality
## Preferred.Positions Ecuador Egypt El Salvador England Equatorial Guinea
##      CAM                  0     0           0      20                 0
##      CAM CB               0     0           0       0                 0
##      CAM CB CDM           0     0           0       0                 0
##      CAM CB CM            0     0           0       0                 0
##      CAM CB CM CDM        0     0           0       0                 0
##      CAM CDM              0     0           0       0                 0
##                    Nationality
## Preferred.Positions Eritrea Estonia Ethiopia Faroe Islands Fiji Finland
##      CAM                  0       2        0             0    0       1
##      CAM CB               0       0        0             0    0       0
##      CAM CB CDM           0       0        0             0    0       0
##      CAM CB CM            0       0        0             0    0       0
##      CAM CB CM CDM        0       0        0             0    0       0
##      CAM CDM              0       0        0             0    0       0
##                    Nationality
## Preferred.Positions France FYR Macedonia Gabon Gambia Georgia Germany
##      CAM                20             0     0      0       2      20
##      CAM CB              0             0     0      0       0       0
##      CAM CB CDM          1             0     0      0       0       1
##      CAM CB CM           0             0     0      0       0       0
##      CAM CB CM CDM       0             0     0      0       0       0
##      CAM CDM             1             0     0      0       1       2
##                    Nationality
## Preferred.Positions Ghana Gibraltar Greece Grenada Guam Guatemala Guinea
##      CAM                1         0      1       0    0         0      0
##      CAM CB             0         0      0       0    0         0      0
##      CAM CB CDM         0         0      0       0    0         0      0
##      CAM CB CM          0         0      0       0    0         0      0
##      CAM CB CM CDM      0         0      0       0    0         0      0
##      CAM CDM            0         0      0       0    0         0      0
##                    Nationality
## Preferred.Positions Guinea Bissau Guyana Haiti Honduras Hong Kong Hungary
##      CAM                        0      0     1        0         0       0
##      CAM CB                     0      0     0        0         0       0
##      CAM CB CDM                 0      0     0        0         0       0
##      CAM CB CM                  0      0     0        0         0       0
##      CAM CB CM CDM              0      0     0        0         0       0
##      CAM CDM                    1      0     0        0         0       0
##                    Nationality
## Preferred.Positions Iceland India Iran Iraq Israel Italy Ivory Coast
##      CAM                  0     0    1    0      0     5           1
##      CAM CB               0     0    0    0      0     0           0
##      CAM CB CDM           0     0    0    0      0     0           0
##      CAM CB CM            0     0    0    0      0     0           0
##      CAM CB CM CDM        0     0    0    0      0     0           0
##      CAM CDM              0     0    0    0      1     0           0
##                    Nationality
## Preferred.Positions Jamaica Japan Kazakhstan Kenya Korea DPR
##      CAM                  1    12          0     0         0
##      CAM CB               0     0          0     0         0
##      CAM CB CDM           0     0          0     0         0
##      CAM CB CM            0     0          0     0         0
##      CAM CB CM CDM        0     0          0     0         0
##      CAM CDM              0     1          0     0         0
##                    Nationality
## Preferred.Positions Korea Republic Kosovo Kuwait Kyrgyzstan Latvia Lebanon
##      CAM                         1      1      0          0      0       0
##      CAM CB                      0      0      0          0      0       0
##      CAM CB CDM                  0      0      0          0      0       0
##      CAM CB CM                   0      0      0          0      0       0
##      CAM CB CM CDM               0      0      0          0      0       0
##      CAM CDM                     0      0      0          0      0       0
##                    Nationality
## Preferred.Positions Liberia Libya Liechtenstein Lithuania Luxembourg
##      CAM                  0     0             0         0          0
##      CAM CB               0     0             0         0          0
##      CAM CB CDM           0     0             0         0          0
##      CAM CB CM            0     0             0         0          0
##      CAM CB CM CDM        0     0             0         0          0
##      CAM CDM              0     0             0         0          0
##                    Nationality
## Preferred.Positions Madagascar Mali Malta Mauritania Mauritius Mexico
##      CAM                     0    1     0          0         0      5
##      CAM CB                  0    0     0          0         0      0
##      CAM CB CDM              0    0     0          0         0      0
##      CAM CB CM               0    0     0          0         0      0
##      CAM CB CM CDM           0    0     0          0         0      0
##      CAM CDM                 0    0     0          0         0      0
##                    Nationality
## Preferred.Positions Moldova Montenegro Montserrat Morocco Mozambique
##      CAM                  0          0          0       2          0
##      CAM CB               0          0          0       0          0
##      CAM CB CDM           0          0          0       0          0
##      CAM CB CM            0          0          0       0          0
##      CAM CB CM CDM        0          0          0       0          0
##      CAM CDM              0          0          0       0          0
##                    Nationality
## Preferred.Positions Namibia Netherlands New Caledonia New Zealand Niger
##      CAM                  0           9             0           0     0
##      CAM CB               0           0             0           0     0
##      CAM CB CDM           0           0             0           0     0
##      CAM CB CM            0           0             0           0     0
##      CAM CB CM CDM        0           0             0           0     0
##      CAM CDM              0           0             0           0     0
##                    Nationality
## Preferred.Positions Nigeria Northern Ireland Norway Oman Palestine Panama
##      CAM                  1                1      2    0         0      0
##      CAM CB               0                0      0    0         0      0
##      CAM CB CDM           0                0      0    0         0      0
##      CAM CB CM            0                0      0    0         0      0
##      CAM CB CM CDM        0                0      0    0         0      0
##      CAM CDM              0                0      0    0         0      0
##                    Nationality
## Preferred.Positions Paraguay Peru Philippines Poland Portugal Puerto Rico
##      CAM                   3    2           0     14        1           0
##      CAM CB                0    0           0      0        0           0
##      CAM CB CDM            0    0           0      0        0           0
##      CAM CB CM             0    0           0      0        0           0
##      CAM CB CM CDM         0    0           0      0        0           0
##      CAM CDM               0    0           0      1        0           0
##                    Nationality
## Preferred.Positions Qatar Republic of Ireland Romania Russia
##      CAM                0                   3       1      3
##      CAM CB             0                   0       0      0
##      CAM CB CDM         0                   0       0      0
##      CAM CB CM          0                   0       0      0
##      CAM CB CM CDM      0                   0       0      0
##      CAM CDM            0                   0       0      2
##                    Nationality
## Preferred.Positions São Tomé & Príncipe San Marino Saudi Arabia
##      CAM                                 0          0            2
##      CAM CB                              0          0            0
##      CAM CB CDM                          0          0            0
##      CAM CB CM                           0          0            0
##      CAM CB CM CDM                       0          0            0
##      CAM CDM                             0          0            0
##                    Nationality
## Preferred.Positions Scotland Senegal Serbia Sierra Leone Slovakia Slovenia
##      CAM                   2       0      2            0        2        2
##      CAM CB                0       0      0            0        0        0
##      CAM CB CDM            0       0      0            0        0        0
##      CAM CB CM             0       0      0            0        0        0
##      CAM CB CM CDM         0       0      0            0        0        0
##      CAM CDM               0       0      1            0        0        0
##                    Nationality
## Preferred.Positions Somalia South Africa Spain Sri Lanka St Kitts Nevis
##      CAM                  0            1     5         0              0
##      CAM CB               0            0     0         0              0
##      CAM CB CDM           0            0     0         0              0
##      CAM CB CM            0            0     0         0              0
##      CAM CB CM CDM        0            0     0         0              0
##      CAM CDM              0            0     2         0              0
##                    Nationality
## Preferred.Positions St Lucia Sudan Suriname Swaziland Sweden Switzerland
##      CAM                   0     1        1         0      3           2
##      CAM CB                0     0        0         0      0           0
##      CAM CB CDM            0     0        0         0      0           0
##      CAM CB CM             0     0        0         0      0           0
##      CAM CB CM CDM         0     0        0         0      0           1
##      CAM CDM               0     0        0         0      0           0
##                    Nationality
## Preferred.Positions Syria Tanzania Thailand Togo Trinidad & Tobago Tunisia
##      CAM                0        0        1    0                 0       0
##      CAM CB             0        0        0    0                 0       0
##      CAM CB CDM         0        0        0    0                 0       0
##      CAM CB CM          0        0        0    0                 0       0
##      CAM CB CM CDM      0        0        0    0                 0       0
##      CAM CDM            0        0        0    0                 0       0
##                    Nationality
## Preferred.Positions Turkey Turkmenistan Uganda Ukraine United States
##      CAM                 3            0      0       1             3
##      CAM CB              0            0      0       0             0
##      CAM CB CDM          0            0      0       0             0
##      CAM CB CM           0            0      0       0             0
##      CAM CB CM CDM       0            0      0       0             0
##      CAM CDM             2            0      0       0             0
##                    Nationality
## Preferred.Positions Uruguay Uzbekistan Venezuela Vietnam Wales Zambia
##      CAM                  1          0         2       0     1      1
##      CAM CB               0          0         0       0     0      0
##      CAM CB CDM           0          0         0       0     0      0
##      CAM CB CM            0          0         0       0     0      0
##      CAM CB CM CDM        0          0         0       0     0      0
##      CAM CDM              0          0         0       0     0      0
##                    Nationality
## Preferred.Positions Zimbabwe
##      CAM                   0
##      CAM CB                0
##      CAM CB CDM            0
##      CAM CB CM             0
##      CAM CB CM CDM         0
##      CAM CDM               0

3.3 Boxplot

boxplot(Age~Overall, data=players,col=(c("magenta","green")),
  main="Player Age and Overall rating", xlab="Overall rating")

boxplot(Age~Potential, data=players,col=(c("magenta","green")),
  main="Player Age and Potential", xlab="Player Potential")

3.4 Histogram

hist(players$Age, 
     main="Histogram for players Age", 
     xlab="Age", 
     border="blue", 
     col="green",
     las=1, 
     breaks=40)

hist(players$Overall, 
     main="Histogram for players Overall Rating", 
     xlab="Overall rating", 
     border="blue", 
     col="magenta",
     las=1, 
     breaks=20)

hist(players$Potential, 
     main="Histogram for players Potential", 
     xlab="Potential", 
     border="black", 
     col="red",
     las=1, 
     breaks=20)

3.5 Correlation Matrix

str(players)
## 'data.frame':    17981 obs. of  75 variables:
##  $ X                  : int  0 1 2 3 4 5 6 7 8 9 ...
##  $ Name               : Factor w/ 16975 levels "A. Ömür","A. Örn Arnarson",..: 3203 9648 12428 9850 11176 13779 4211 4519 15725 5805 ...
##  $ Age                : int  32 30 25 30 31 28 26 26 27 29 ...
##  $ Photo              : Factor w/ 17929 levels "https://cdn.sofifa.org/48/18/players/101317.png",..: 7185 775 4020 2122 1521 3500 4392 2738 2666 1544 ...
##  $ Nationality        : Factor w/ 165 levels "Afghanistan",..: 122 6 19 159 59 121 139 13 59 6 ...
##  $ Flag               : Factor w/ 165 levels "https://cdn.sofifa.org/flags/1.png",..: 109 125 127 134 88 108 117 140 88 125 ...
##  $ Overall            : int  94 93 92 92 92 91 90 90 90 90 ...
##  $ Potential          : int  94 93 94 92 92 91 92 91 90 90 ...
##  $ Club               : Factor w/ 648 levels ""," SSV Jahn Regensburg",..: 472 226 437 226 229 229 384 148 472 339 ...
##  $ Club.Logo          : Factor w/ 679 levels "https://cdn.sofifa.org/24/18/teams/1.png",..: 467 465 610 465 448 448 62 549 467 528 ...
##  $ Value              : Factor w/ 207 levels "€0","€1.1M",..: 203 13 21 206 168 202 170 198 187 186 ...
##  $ Wage               : Factor w/ 142 levels "€0","€100K",..: 94 94 54 88 42 68 37 57 66 52 ...
##  $ Special            : int  2228 2154 2100 2291 1493 2143 1458 2096 2165 1961 ...
##  $ Acceleration       : Factor w/ 161 levels "11","12","13",..: 151 156 159 150 57 130 55 158 63 126 ...
##  $ Aggression         : Factor w/ 151 levels "11","12","13",..: 79 44 59 124 20 129 31 57 72 48 ...
##  $ Agility            : Factor w/ 146 levels "14","15","16",..: 139 140 146 136 49 118 64 143 101 110 ...
##  $ Balance            : Factor w/ 135 levels "11","15","16",..: 63 134 115 57 23 109 31 130 82 82 ...
##  $ Ball.control       : Factor w/ 184 levels "10","11","12",..: 182 184 184 180 49 177 40 181 177 172 ...
##  $ Composure          : Factor w/ 161 levels "11","12","13",..: 160 161 159 150 123 154 97 154 152 153 ...
##  $ Crossing           : Factor w/ 176 levels "10","11","12",..: 168 155 153 155 6 100 8 162 168 130 ...
##  $ Curve              : Factor w/ 153 levels "10","11","12",..: 141 150 141 147 5 133 12 143 146 126 ...
##  $ Dribbling          : Factor w/ 194 levels "10","11","11+6",..: 190 194 193 183 23 182 10 192 172 180 ...
##  $ Finishing          : Factor w/ 187 levels "10","11","12",..: 186 187 182 186 4 185 4 176 161 185 ...
##  $ Free.kick.accuracy : Factor w/ 136 levels "10","11","12",..: 116 134 127 127 2 127 10 120 127 76 ...
##  $ GK.diving          : Factor w/ 100 levels "1","10","11",..: 66 45 98 17 100 7 99 3 2 30 ...
##  $ GK.handling        : Factor w/ 97 levels "1","10","11",..: 3 3 95 14 96 47 91 4 3 4 ...
##  $ GK.kicking         : Factor w/ 103 levels "1","10","11",..: 7 7 7 22 103 4 100 58 5 81 ...
##  $ GK.positioning     : Factor w/ 99 levels "1","10","11",..: 6 6 7 21 99 88 95 88 75 35 ...
##  $ GK.reflexes        : Factor w/ 102 levels "1","10","11",..: 3 85 3 22 100 2 102 85 2 2 ...
##  $ Heading.accuracy   : Factor w/ 158 levels "10","11","12",..: 151 118 87 136 16 147 12 68 61 149 ...
##  $ Interceptions      : Factor w/ 174 levels "10","10-11","11",..: 28 18 37 47 29 43 29 47 166 15 ...
##  $ Jumping            : Factor w/ 140 levels "13","15","16",..: 140 74 50 80 115 127 69 42 11 118 ...
##  $ Long.passing       : Factor w/ 188 levels "10","11","12",..: 168 182 162 119 98 122 67 174 188 98 ...
##  $ Long.shots         : Factor w/ 156 levels "10","11","12",..: 156 152 136 150 7 147 3 146 154 146 ...
##  $ Marking            : Factor w/ 183 levels "10","11","12",..: 16 4 15 30 1 23 4 23 108 3 ...
##  $ Penalties          : Factor w/ 117 levels "10","11","12",..: 109 96 104 109 41 104 32 110 95 88 ...
##  $ Positioning        : Factor w/ 171 levels "10","10-3","11",..: 171 170 167 169 4 168 4 161 151 169 ...
##  $ Reactions          : Factor w/ 158 levels "28","30","31",..: 158 157 151 156 148 154 151 148 149 151 ...
##  $ Short.passing      : Factor w/ 209 levels "10","11","12",..: 199 205 195 199 71 199 57 203 207 179 ...
##  $ Shot.power         : Factor w/ 153 levels "10","11","12",..: 153 143 134 146 17 147 24 131 146 147 ...
##  $ Sliding.tackle     : Factor w/ 169 levels "10","11","12",..: 18 22 33 40 2 12 4 17 123 10 ...
##  $ Sprint.speed       : Factor w/ 194 levels "11","12","13",..: 188 178 185 143 69 165 61 178 48 155 ...
##  $ Stamina            : Factor w/ 180 levels "12","13","14",..: 177 124 144 173 38 149 31 149 142 117 ...
##  $ Standing.tackle    : Factor w/ 187 levels "10","11","12",..: 28 24 18 53 1 49 15 22 174 16 ...
##  $ Strength           : Factor w/ 168 levels "12","20","21",..: 137 65 48 137 144 148 72 73 114 151 ...
##  $ Vision             : Factor w/ 173 levels "10","11","12",..: 165 170 160 164 127 154 119 166 168 127 ...
##  $ Volleys            : Factor w/ 125 levels "10","11","12",..: 121 118 116 121 2 120 4 111 115 121 ...
##  $ CAM                : num  89 92 88 87 NA 84 NA 88 83 81 ...
##  $ CB                 : num  53 45 46 58 NA 57 NA 47 72 46 ...
##  $ CDM                : num  62 59 59 65 NA 62 NA 61 82 52 ...
##  $ CF                 : num  91 92 88 88 NA 87 NA 87 81 84 ...
##  $ CM                 : num  82 84 79 80 NA 78 NA 81 87 71 ...
##  $ ID                 : int  20801 158023 190871 176580 167495 188545 193080 183277 182521 167664 ...
##  $ LAM                : num  89 92 88 87 NA 84 NA 88 83 81 ...
##  $ LB                 : num  61 57 59 64 NA 58 NA 59 76 51 ...
##  $ LCB                : num  53 45 46 58 NA 57 NA 47 72 46 ...
##  $ LCM                : num  82 84 79 80 NA 78 NA 81 87 71 ...
##  $ LDM                : num  62 59 59 65 NA 62 NA 61 82 52 ...
##  $ LF                 : num  91 92 88 88 NA 87 NA 87 81 84 ...
##  $ LM                 : num  89 90 87 85 NA 82 NA 87 81 79 ...
##  $ LS                 : num  92 88 84 88 NA 88 NA 82 77 87 ...
##  $ LW                 : num  91 91 89 87 NA 84 NA 88 80 82 ...
##  $ LWB                : num  66 62 64 68 NA 61 NA 64 78 55 ...
##  $ Preferred.Positions: Factor w/ 802 levels "CAM ","CAM CB ",..: 781 650 428 736 280 736 280 428 122 736 ...
##  $ RAM                : num  89 92 88 87 NA 84 NA 88 83 81 ...
##  $ RB                 : num  61 57 59 64 NA 58 NA 59 76 51 ...
##  $ RCB                : num  53 45 46 58 NA 57 NA 47 72 46 ...
##  $ RCM                : num  82 84 79 80 NA 78 NA 81 87 71 ...
##  $ RDM                : num  62 59 59 65 NA 62 NA 61 82 52 ...
##  $ RF                 : num  91 92 88 88 NA 87 NA 87 81 84 ...
##  $ RM                 : num  89 90 87 85 NA 82 NA 87 81 79 ...
##  $ RS                 : num  92 88 84 88 NA 88 NA 82 77 87 ...
##  $ RW                 : num  91 91 89 87 NA 84 NA 88 80 82 ...
##  $ RWB                : num  66 62 64 68 NA 61 NA 64 78 55 ...
##  $ ST                 : num  92 88 84 88 NA 88 NA 82 77 87 ...
cor(players$Age,players$Overall)
## [1] 0.4597649
plot(players$Age,players$Overall)

cor(players$Age,players$Potential)
## [1] -0.2182643
plot(players$Age,players$Potential)

3.6 Corrgram

library(corrgram)
corrgram(players, order=TRUE, upper.panel=panel.pie,lower.panel=panel.shade, text.panel=panel.txt,main="Correlogram")

3.7 Scatterplot

library(car) 
## 
## Attaching package: 'car'
## The following object is masked from 'package:psych':
## 
##     logit
scatterplot(Age ~ Overall, data=players, 
    xlab="Overall Rating", ylab="Age", 
   main="Scatter plot of Age and Overall rating", 
   labels=row.names(players))

3.8 T-test

H1:There is no relationship between Age and Overall Rating

H2:There is no relationship between Age and Potential

t.test(players$Age,players$Overall)
## 
##  Welch Two Sample t-test
## 
## data:  players$Age and players$Overall
## t = -658.19, df = 31155, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -41.22584 -40.98104
## sample estimates:
## mean of x mean of y 
##  25.14454  66.24798
t.test(players$Age,players$Potential)
## 
##  Welch Two Sample t-test
## 
## data:  players$Age and players$Potential
## t = -807.08, df = 33475, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -46.15810 -45.93445
## sample estimates:
## mean of x mean of y 
##  25.14454  71.19081

From the above T-Tests we can observe that, p-value for both the tests are less than 0.05, hence we can conclude that both the hypothesis are rejected.

3.9 Modelling the data

In order to test Hypothesis, we proposed the following model:

\[Age= \beta_0 + \beta_1 Overall + \beta_2 Potential + \epsilon\]

#Linear Regression Model
fit <- lm(formula = players$Age ~ players$Overall+players$Potential, data=players)
summary(fit)
## 
## Call:
## lm(formula = players$Age ~ players$Overall + players$Potential, 
##     data = players)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -9.3686 -1.5991 -0.5582  1.1223 18.0990 
## 
## Coefficients:
##                    Estimate Std. Error t value Pr(>|t|)    
## (Intercept)       28.949723   0.207218   139.7   <2e-16 ***
## players$Overall    0.754594   0.003417   220.9   <2e-16 ***
## players$Potential -0.755652   0.003913  -193.1   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.337 on 17978 degrees of freedom
## Multiple R-squared:  0.7435, Adjusted R-squared:  0.7435 
## F-statistic: 2.606e+04 on 2 and 17978 DF,  p-value: < 2.2e-16
Model1 <- Age ~ 
             Overall+Potential 
fit1 <- lm(Model1, data = players)
summary(fit1)
## 
## Call:
## lm(formula = Model1, data = players)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -9.3686 -1.5991 -0.5582  1.1223 18.0990 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept) 28.949723   0.207218   139.7   <2e-16 ***
## Overall      0.754594   0.003417   220.9   <2e-16 ***
## Potential   -0.755652   0.003913  -193.1   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.337 on 17978 degrees of freedom
## Multiple R-squared:  0.7435, Adjusted R-squared:  0.7435 
## F-statistic: 2.606e+04 on 2 and 17978 DF,  p-value: < 2.2e-16

We established the effect of Overall rating and Potential on the Age of a player with the simplest model. We regressed Age on Overall rating and Potential.We estimated model, using linear regression.

3.10 Result

The model is a good fit model as p < 0.05. equation:- y(Age) = 28.94 + 0.75(Overall rating) - 0.755652(Potential)

4. Conclusion

This paper was motivated by the need for research that could improve our understanding of how Age of a player is defined by the variables like Overall rating and Potential.We can see from the above equation that our model fits nicely and the dependency of a players age can be predicted from its overall rating and potential.This briefly gives us an overview of a player regarding age while considering him for the Ultimate Team.