Caso 7. Regresión Polinomial. Datos FIFA. Variables Overall y Value

Objetivo

Analizar caso FIFA mediante un modelo de regresión polinomial con las variables Overall y Value del conjunto de datos.

Descripción

Determinar modelo de regresión plinomial de segundo y tal vez de trecer o cuarto nivel para establecer un análisi en el conjunto de datos del caso FIFA y comparar con el modelo de regresión lineal simple Fundamento teórico. Regresión Polinomial

Los modelos lineales tienen la ventaja de ser fácilmente interpretables, sin embargo, pueden tener limitaciones importantes en capacidad predictiva. Esto se debe a que, la asunción de linealidad, es con frecuencia una aproximación demasiado simple para describir las relaciones reales entre variables. A continuación, se describen métodos que permiten relajar la condición de linealidad intentando mantener al mismo tiempo una interpretabilidad alta.

La forma más sencilla de incorporar flexibilidad a un modelo lineal es introduciendo nuevos predictores obtenidos al elevar a distintas potencias el predictor original.

Partiendo del modelo lineal: y=β0+β1xi+ϵi

Ahora el modelo polinómico: y=β0+β1xi2+β3xi3+…+βdxdin+ϵi

Cargar Librerias

library(readr)
library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(ggplot2)
library(caret)
## Warning: package 'caret' was built under R version 4.0.3
## Loading required package: lattice

Cargar datos

getwd()
## [1] "C:/Users/pc/Documents/RStudio"
datos.fifa <- read.csv(file = "data.csv", encoding = "UTF-8")

Determinar variable independiente Y dependiente

La variable ‘x’ independiente es Overall que significa como se valora en su totalidad el jugador

La variable ‘y’ dependiente es Value character que sera el valor en el formato numerico que significa el valor economico del jugador

Limpiar Datos

source(file = "misfunciones.r")
datos <- datos.fifa %>%
  mutate(Valor = ifelse (substr(Value, nchar(Value), nchar(Value)) == 'M', fcleanValue(Value) * 1000000, fcleanValue(Value) * 1000)) %>%
  filter(Valor > 0)
head(datos, 10); tail(datos, 10)
##    X.U.FEFF.     ID              Name Age
## 1          0 158023          L. Messi  31
## 2          1  20801 Cristiano Ronaldo  33
## 3          2 190871         Neymar Jr  26
## 4          3 193080            De Gea  27
## 5          4 192985      K. De Bruyne  27
## 6          5 183277         E. Hazard  27
## 7          6 177003         L. Modric  32
## 8          7 176580         L. Suárez  31
## 9          8 155862      Sergio Ramos  32
## 10         9 200389          J. Oblak  25
##                                             Photo Nationality
## 1  https://cdn.sofifa.org/players/4/19/158023.png   Argentina
## 2   https://cdn.sofifa.org/players/4/19/20801.png    Portugal
## 3  https://cdn.sofifa.org/players/4/19/190871.png      Brazil
## 4  https://cdn.sofifa.org/players/4/19/193080.png       Spain
## 5  https://cdn.sofifa.org/players/4/19/192985.png     Belgium
## 6  https://cdn.sofifa.org/players/4/19/183277.png     Belgium
## 7  https://cdn.sofifa.org/players/4/19/177003.png     Croatia
## 8  https://cdn.sofifa.org/players/4/19/176580.png     Uruguay
## 9  https://cdn.sofifa.org/players/4/19/155862.png       Spain
## 10 https://cdn.sofifa.org/players/4/19/200389.png    Slovenia
##                                   Flag Overall Potential                Club
## 1  https://cdn.sofifa.org/flags/52.png      94        94        FC Barcelona
## 2  https://cdn.sofifa.org/flags/38.png      94        94            Juventus
## 3  https://cdn.sofifa.org/flags/54.png      92        93 Paris Saint-Germain
## 4  https://cdn.sofifa.org/flags/45.png      91        93   Manchester United
## 5   https://cdn.sofifa.org/flags/7.png      91        92     Manchester City
## 6   https://cdn.sofifa.org/flags/7.png      91        91             Chelsea
## 7  https://cdn.sofifa.org/flags/10.png      91        91         Real Madrid
## 8  https://cdn.sofifa.org/flags/60.png      91        91        FC Barcelona
## 9  https://cdn.sofifa.org/flags/45.png      91        91         Real Madrid
## 10 https://cdn.sofifa.org/flags/44.png      90        93     Atlético Madrid
##                                       Club.Logo   Value  Wage Special
## 1  https://cdn.sofifa.org/teams/2/light/241.png \200110.5M \200565K    2202
## 2   https://cdn.sofifa.org/teams/2/light/45.png    \20077M \200405K    2228
## 3   https://cdn.sofifa.org/teams/2/light/73.png \200118.5M \200290K    2143
## 4   https://cdn.sofifa.org/teams/2/light/11.png    \20072M \200260K    1471
## 5   https://cdn.sofifa.org/teams/2/light/10.png   \200102M \200355K    2281
## 6    https://cdn.sofifa.org/teams/2/light/5.png    \20093M \200340K    2142
## 7  https://cdn.sofifa.org/teams/2/light/243.png    \20067M \200420K    2280
## 8  https://cdn.sofifa.org/teams/2/light/241.png    \20080M \200455K    2346
## 9  https://cdn.sofifa.org/teams/2/light/243.png    \20051M \200380K    2201
## 10 https://cdn.sofifa.org/teams/2/light/240.png    \20068M  \20094K    1331
##    Preferred.Foot International.Reputation Weak.Foot Skill.Moves      Work.Rate
## 1            Left                        5         4           4 Medium/ Medium
## 2           Right                        5         4           5      High/ Low
## 3           Right                        5         5           5   High/ Medium
## 4           Right                        4         3           1 Medium/ Medium
## 5           Right                        4         5           4     High/ High
## 6           Right                        4         4           4   High/ Medium
## 7           Right                        4         4           4     High/ High
## 8           Right                        5         4           3   High/ Medium
## 9           Right                        4         3           3   High/ Medium
## 10          Right                        3         3           1 Medium/ Medium
##     Body.Type Real.Face Position Jersey.Number       Joined Loaned.From
## 1       Messi       Yes       RF            10  Jul 1, 2004            
## 2  C. Ronaldo       Yes       ST             7 Jul 10, 2018            
## 3      Neymar       Yes       LW            10  Aug 3, 2017            
## 4        Lean       Yes       GK             1  Jul 1, 2011            
## 5      Normal       Yes      RCM             7 Aug 30, 2015            
## 6      Normal       Yes       LF            10  Jul 1, 2012            
## 7        Lean       Yes      RCM            10  Aug 1, 2012            
## 8      Normal       Yes       RS             9 Jul 11, 2014            
## 9      Normal       Yes      RCB            15  Aug 1, 2005            
## 10     Normal       Yes       GK             1 Jul 16, 2014            
##    Contract.Valid.Until Height Weight   LS   ST   RS   LW   LF   CF   RF   RW
## 1                  2021    5'7 159lbs 88+2 88+2 88+2 92+2 93+2 93+2 93+2 92+2
## 2                  2022    6'2 183lbs 91+3 91+3 91+3 89+3 90+3 90+3 90+3 89+3
## 3                  2022    5'9 150lbs 84+3 84+3 84+3 89+3 89+3 89+3 89+3 89+3
## 4                  2020    6'4 168lbs                                        
## 5                  2023   5'11 154lbs 82+3 82+3 82+3 87+3 87+3 87+3 87+3 87+3
## 6                  2020    5'8 163lbs 83+3 83+3 83+3 89+3 88+3 88+3 88+3 89+3
## 7                  2020    5'8 146lbs 77+3 77+3 77+3 85+3 84+3 84+3 84+3 85+3
## 8                  2021    6'0 190lbs 87+5 87+5 87+5 86+5 87+5 87+5 87+5 86+5
## 9                  2020    6'0 181lbs 73+3 73+3 73+3 70+3 71+3 71+3 71+3 70+3
## 10                 2021    6'2 192lbs                                        
##     LAM  CAM  RAM   LM  LCM   CM  RCM   RM  LWB  LDM  CDM  RDM  RWB   LB  LCB
## 1  93+2 93+2 93+2 91+2 84+2 84+2 84+2 91+2 64+2 61+2 61+2 61+2 64+2 59+2 47+2
## 2  88+3 88+3 88+3 88+3 81+3 81+3 81+3 88+3 65+3 61+3 61+3 61+3 65+3 61+3 53+3
## 3  89+3 89+3 89+3 88+3 81+3 81+3 81+3 88+3 65+3 60+3 60+3 60+3 65+3 60+3 47+3
## 4                                                                            
## 5  88+3 88+3 88+3 88+3 87+3 87+3 87+3 88+3 77+3 77+3 77+3 77+3 77+3 73+3 66+3
## 6  89+3 89+3 89+3 89+3 82+3 82+3 82+3 89+3 66+3 63+3 63+3 63+3 66+3 60+3 49+3
## 7  87+3 87+3 87+3 86+3 88+3 88+3 88+3 86+3 82+3 81+3 81+3 81+3 82+3 79+3 71+3
## 8  85+5 85+5 85+5 84+5 79+5 79+5 79+5 84+5 69+5 68+5 68+5 68+5 69+5 66+5 63+5
## 9  71+3 71+3 71+3 72+3 75+3 75+3 75+3 72+3 81+3 84+3 84+3 84+3 81+3 84+3 87+3
## 10                                                                           
##      CB  RCB   RB Crossing Finishing HeadingAccuracy ShortPassing Volleys
## 1  47+2 47+2 59+2       84        95              70           90      86
## 2  53+3 53+3 61+3       84        94              89           81      87
## 3  47+3 47+3 60+3       79        87              62           84      84
## 4                       17        13              21           50      13
## 5  66+3 66+3 73+3       93        82              55           92      82
## 6  49+3 49+3 60+3       81        84              61           89      80
## 7  71+3 71+3 79+3       86        72              55           93      76
## 8  63+5 63+5 66+5       77        93              77           82      88
## 9  87+3 87+3 84+3       66        60              91           78      66
## 10                      13        11              15           29      13
##    Dribbling Curve FKAccuracy LongPassing BallControl Acceleration SprintSpeed
## 1         97    93         94          87          96           91          86
## 2         88    81         76          77          94           89          91
## 3         96    88         87          78          95           94          90
## 4         18    21         19          51          42           57          58
## 5         86    85         83          91          91           78          76
## 6         95    83         79          83          94           94          88
## 7         90    85         78          88          93           80          72
## 8         87    86         84          64          90           86          75
## 9         63    74         72          77          84           76          75
## 10        12    13         14          26          16           43          60
##    Agility Reactions Balance ShotPower Jumping Stamina Strength LongShots
## 1       91        95      95        85      68      72       59        94
## 2       87        96      70        95      95      88       79        93
## 3       96        94      84        80      61      81       49        82
## 4       60        90      43        31      67      43       64        12
## 5       79        91      77        91      63      90       75        91
## 6       95        90      94        82      56      83       66        80
## 7       93        90      94        79      68      89       58        82
## 8       82        92      83        86      69      90       83        85
## 9       78        85      66        79      93      84       83        59
## 10      67        86      49        22      76      41       78        12
##    Aggression Interceptions Positioning Vision Penalties Composure Marking
## 1          48            22          94     94        75        96      33
## 2          63            29          95     82        85        95      28
## 3          56            36          89     87        81        94      27
## 4          38            30          12     68        40        68      15
## 5          76            61          87     94        79        88      68
## 6          54            41          87     89        86        91      34
## 7          62            83          79     92        82        84      60
## 8          87            41          92     84        85        85      62
## 9          88            90          60     63        75        82      87
## 10         34            19          11     70        11        70      27
##    StandingTackle SlidingTackle GKDiving GKHandling GKKicking GKPositioning
## 1              28            26        6         11        15            14
## 2              31            23        7         11        15            14
## 3              24            33        9          9        15            15
## 4              21            13       90         85        87            88
## 5              58            51       15         13         5            10
## 6              27            22       11         12         6             8
## 7              76            73       13          9         7            14
## 8              45            38       27         25        31            33
## 9              92            91       11          8         9             7
## 10             12            18       86         92        78            88
##    GKReflexes Release.Clause     Valor
## 1           8        \200226.5M 110500000
## 2          11        \200127.1M  77000000
## 3          11        \200228.1M 118500000
## 4          94        \200138.6M  72000000
## 5          13        \200196.4M 102000000
## 6           8        \200172.1M  93000000
## 7           9        \200137.4M  67000000
## 8          37          \200164M  80000000
## 9          11        \200104.6M  51000000
## 10         89        \200144.5M  68000000
##       X.U.FEFF.     ID               Name Age
## 17946     18197 246167         D. Holland  18
## 17947     18198 242844         J. Livesey  18
## 17948     18199 244677       M. Baldisimo  18
## 17949     18200 231381           J. Young  18
## 17950     18201 243413           D. Walsh  18
## 17951     18202 238813       J. Lundstram  19
## 17952     18203 243165 N. Christoffersson  19
## 17953     18204 241638          B. Worman  16
## 17954     18205 246268     D. Walker-Rice  17
## 17955     18206 246269          G. Nugent  16
##                                                Photo         Nationality
## 17946 https://cdn.sofifa.org/players/4/19/246167.png Republic of Ireland
## 17947 https://cdn.sofifa.org/players/4/19/242844.png             England
## 17948 https://cdn.sofifa.org/players/4/19/244677.png              Canada
## 17949 https://cdn.sofifa.org/players/4/19/231381.png            Scotland
## 17950 https://cdn.sofifa.org/players/4/19/243413.png Republic of Ireland
## 17951 https://cdn.sofifa.org/players/4/19/238813.png             England
## 17952 https://cdn.sofifa.org/players/4/19/243165.png              Sweden
## 17953 https://cdn.sofifa.org/players/4/19/241638.png             England
## 17954 https://cdn.sofifa.org/players/4/19/246268.png             England
## 17955 https://cdn.sofifa.org/players/4/19/246269.png             England
##                                      Flag Overall Potential
## 17946 https://cdn.sofifa.org/flags/25.png      47        61
## 17947 https://cdn.sofifa.org/flags/14.png      47        70
## 17948 https://cdn.sofifa.org/flags/70.png      47        69
## 17949 https://cdn.sofifa.org/flags/42.png      47        62
## 17950 https://cdn.sofifa.org/flags/25.png      47        68
## 17951 https://cdn.sofifa.org/flags/14.png      47        65
## 17952 https://cdn.sofifa.org/flags/46.png      47        63
## 17953 https://cdn.sofifa.org/flags/14.png      47        67
## 17954 https://cdn.sofifa.org/flags/14.png      47        66
## 17955 https://cdn.sofifa.org/flags/14.png      46        66
##                         Club                                       Club.Logo
## 17946              Cork City    https://cdn.sofifa.org/teams/2/light/422.png
## 17947          Burton Albion  https://cdn.sofifa.org/teams/2/light/15015.png
## 17948 Vancouver Whitecaps FC https://cdn.sofifa.org/teams/2/light/101112.png
## 17949           Swindon Town   https://cdn.sofifa.org/teams/2/light/1934.png
## 17950           Waterford FC    https://cdn.sofifa.org/teams/2/light/753.png
## 17951        Crewe Alexandra    https://cdn.sofifa.org/teams/2/light/121.png
## 17952         Trelleborgs FF    https://cdn.sofifa.org/teams/2/light/703.png
## 17953       Cambridge United   https://cdn.sofifa.org/teams/2/light/1944.png
## 17954        Tranmere Rovers  https://cdn.sofifa.org/teams/2/light/15048.png
## 17955        Tranmere Rovers  https://cdn.sofifa.org/teams/2/light/15048.png
##       Value Wage Special Preferred.Foot International.Reputation Weak.Foot
## 17946  \20060K  \2001K    1362          Right                        1         3
## 17947  \20060K  \2001K     792          Right                        1         2
## 17948  \20070K  \2001K    1303          Right                        1         3
## 17949  \20060K  \2001K    1203           Left                        1         2
## 17950  \20060K  \2001K    1098           Left                        1         3
## 17951  \20060K  \2001K    1307          Right                        1         2
## 17952  \20060K  \2001K    1098          Right                        1         2
## 17953  \20060K  \2001K    1189          Right                        1         3
## 17954  \20060K  \2001K    1228          Right                        1         3
## 17955  \20060K  \2001K    1321          Right                        1         3
##       Skill.Moves      Work.Rate Body.Type Real.Face Position Jersey.Number
## 17946           2 Medium/ Medium    Normal        No       CM            14
## 17947           1 Medium/ Medium      Lean        No       GK            22
## 17948           2   Medium/ High      Lean        No       CM            65
## 17949           2 Medium/ Medium      Lean        No       ST            21
## 17950           2 Medium/ Medium      Lean        No       RB            29
## 17951           2 Medium/ Medium      Lean        No       CM            22
## 17952           2 Medium/ Medium    Normal        No       ST            21
## 17953           2 Medium/ Medium    Normal        No       ST            33
## 17954           2 Medium/ Medium      Lean        No       RW            34
## 17955           2 Medium/ Medium      Lean        No       CM            33
##             Joined Loaned.From Contract.Valid.Until Height Weight   LS   ST
## 17946  Oct 5, 2018                             2018   5'10 141lbs 45+2 45+2
## 17947 Nov 10, 2018                             2021   5'11 154lbs          
## 17948 Jul 17, 2018                             2021    5'6 150lbs 42+2 42+2
## 17949 Oct 17, 2015                             2019    5'9 157lbs 45+2 45+2
## 17950 Apr 20, 2018                             2018    6'1 168lbs 32+2 32+2
## 17951  May 3, 2017                             2019    5'9 134lbs 42+2 42+2
## 17952 Mar 19, 2018                             2020    6'3 170lbs 45+2 45+2
## 17953  Jul 1, 2017                             2021    5'8 148lbs 45+2 45+2
## 17954 Apr 24, 2018                             2019   5'10 154lbs 47+2 47+2
## 17955 Oct 30, 2018                             2019   5'10 176lbs 43+2 43+2
##         RS   LW   LF   CF   RF   RW  LAM  CAM  RAM   LM  LCM   CM  RCM   RM
## 17946 45+2 49+2 48+2 48+2 48+2 49+2 49+2 49+2 49+2 49+2 47+2 47+2 47+2 49+2
## 17947                                                                      
## 17948 42+2 43+2 44+2 44+2 44+2 43+2 44+2 44+2 44+2 45+2 45+2 45+2 45+2 45+2
## 17949 45+2 44+2 45+2 45+2 45+2 44+2 44+2 44+2 44+2 41+2 37+2 37+2 37+2 41+2
## 17950 32+2 29+2 30+2 30+2 30+2 29+2 28+2 28+2 28+2 30+2 30+2 30+2 30+2 30+2
## 17951 42+2 44+2 44+2 44+2 44+2 44+2 45+2 45+2 45+2 44+2 45+2 45+2 45+2 44+2
## 17952 45+2 39+2 42+2 42+2 42+2 39+2 40+2 40+2 40+2 38+2 35+2 35+2 35+2 38+2
## 17953 45+2 45+2 46+2 46+2 46+2 45+2 44+2 44+2 44+2 44+2 38+2 38+2 38+2 44+2
## 17954 47+2 47+2 46+2 46+2 46+2 47+2 45+2 45+2 45+2 46+2 39+2 39+2 39+2 46+2
## 17955 43+2 45+2 44+2 44+2 44+2 45+2 45+2 45+2 45+2 46+2 45+2 45+2 45+2 46+2
##        LWB  LDM  CDM  RDM  RWB   LB  LCB   CB  RCB   RB Crossing Finishing
## 17946 45+2 44+2 44+2 44+2 45+2 44+2 40+2 40+2 40+2 44+2       44        44
## 17947                                                         14         8
## 17948 47+2 48+2 48+2 48+2 47+2 47+2 48+2 48+2 48+2 47+2       31        31
## 17949 31+2 28+2 28+2 28+2 31+2 30+2 27+2 27+2 27+2 30+2       28        47
## 17950 39+2 38+2 38+2 38+2 39+2 42+2 46+2 46+2 46+2 42+2       22        23
## 17951 44+2 45+2 45+2 45+2 44+2 45+2 45+2 45+2 45+2 45+2       34        38
## 17952 30+2 31+2 31+2 31+2 30+2 29+2 32+2 32+2 32+2 29+2       23        52
## 17953 34+2 30+2 30+2 30+2 34+2 33+2 28+2 28+2 28+2 33+2       25        40
## 17954 36+2 32+2 32+2 32+2 36+2 35+2 31+2 31+2 31+2 35+2       44        50
## 17955 46+2 46+2 46+2 46+2 46+2 46+2 47+2 47+2 47+2 46+2       41        34
##       HeadingAccuracy ShortPassing Volleys Dribbling Curve FKAccuracy
## 17946              36           53      43        50    48         46
## 17947              14           19       8        10    13         10
## 17948              41           51      26        46    35         31
## 17949              47           42      37        39    32         25
## 17950              45           25      27        21    21         27
## 17951              40           49      25        42    30         34
## 17952              52           43      36        39    32         20
## 17953              46           38      38        45    38         27
## 17954              39           42      40        51    34         32
## 17955              46           48      30        43    40         34
##       LongPassing BallControl Acceleration SprintSpeed Agility Reactions
## 17946          52          51           68          62      58        41
## 17947          21          11           18          24      22        36
## 17948          55          47           60          63      53        46
## 17949          30          41           65          48      64        54
## 17950          27          32           52          52      39        43
## 17951          45          43           54          57      60        49
## 17952          25          40           41          39      38        40
## 17953          28          44           70          69      50        47
## 17954          32          52           61          60      52        21
## 17955          44          51           57          55      55        51
##       Balance ShotPower Jumping Stamina Strength LongShots Aggression
## 17946      62        50      55      50       38        37         37
## 17947      47        26      56      20       38         5         25
## 17948      55        49      57      42       43        30         53
## 17949      80        44      77      31       31        51         26
## 17950      48        39      74      39       52        16         44
## 17951      76        43      55      40       47        38         46
## 17952      52        41      47      43       67        42         47
## 17953      58        45      60      55       32        45         32
## 17954      71        64      42      40       48        34         33
## 17955      63        43      62      47       60        32         56
##       Interceptions Positioning Vision Penalties Composure Marking
## 17946            28          39     48        49        52      41
## 17947             6           5     37        14        34      15
## 17948            49          35     40        36        40      48
## 17949            16          46     37        58        50      15
## 17950            45          20     31        38        43      44
## 17951            46          39     52        43        45      40
## 17952            16          46     33        43        42      22
## 17953            15          48     43        55        41      32
## 17954            22          44     47        50        46      20
## 17955            42          34     49        33        43      40
##       StandingTackle SlidingTackle GKDiving GKHandling GKKicking GKPositioning
## 17946             47            38       13          6         9            10
## 17947             11            13       46         52        58            42
## 17948             49            49        7          7         9            14
## 17949             17            14       11         15        12            12
## 17950             47            53        9         10         9            11
## 17951             48            47       10         13         7             8
## 17952             15            19       10          9         9             5
## 17953             13            11        6          5        10             6
## 17954             25            27       14          6        14             8
## 17955             43            50       10         15         9            12
##       GKReflexes Release.Clause Valor
## 17946         15           \20088K 60000
## 17947         48          \200165K 60000
## 17948         15          \200175K 70000
## 17949         11          \200143K 60000
## 17950         13          \200153K 60000
## 17951          9          \200143K 60000
## 17952         12          \200113K 60000
## 17953         13          \200165K 60000
## 17954          9          \200143K 60000
## 17955          9          \200165K 60000

Datos

ggplot(datos, aes(x = Overall, y = Valor)) +
    geom_point()

*La grafica tiene una relacion en curva no lineal.

Dividir el conjunto de datos en 70% y 30%

set.seed(2020)
entrena <- createDataPartition(y = datos$Valor, p = 0.7, list = FALSE, times = 1)

datos.entrenamiento <- datos[entrena, ]

datos.validacion <- datos[-entrena, ]

head(datos.entrenamiento, 10)
##    X.U.FEFF.     ID              Name Age
## 1          0 158023          L. Messi  31
## 2          1  20801 Cristiano Ronaldo  33
## 3          2 190871         Neymar Jr  26
## 5          4 192985      K. De Bruyne  27
## 6          5 183277         E. Hazard  27
## 7          6 177003         L. Modric  32
## 8          7 176580         L. Suárez  31
## 11        10 188545    R. Lewandowski  29
## 12        11 182521          T. Kroos  28
## 13        12 182493          D. Godín  32
##                                             Photo Nationality
## 1  https://cdn.sofifa.org/players/4/19/158023.png   Argentina
## 2   https://cdn.sofifa.org/players/4/19/20801.png    Portugal
## 3  https://cdn.sofifa.org/players/4/19/190871.png      Brazil
## 5  https://cdn.sofifa.org/players/4/19/192985.png     Belgium
## 6  https://cdn.sofifa.org/players/4/19/183277.png     Belgium
## 7  https://cdn.sofifa.org/players/4/19/177003.png     Croatia
## 8  https://cdn.sofifa.org/players/4/19/176580.png     Uruguay
## 11 https://cdn.sofifa.org/players/4/19/188545.png      Poland
## 12 https://cdn.sofifa.org/players/4/19/182521.png     Germany
## 13 https://cdn.sofifa.org/players/4/19/182493.png     Uruguay
##                                   Flag Overall Potential                Club
## 1  https://cdn.sofifa.org/flags/52.png      94        94        FC Barcelona
## 2  https://cdn.sofifa.org/flags/38.png      94        94            Juventus
## 3  https://cdn.sofifa.org/flags/54.png      92        93 Paris Saint-Germain
## 5   https://cdn.sofifa.org/flags/7.png      91        92     Manchester City
## 6   https://cdn.sofifa.org/flags/7.png      91        91             Chelsea
## 7  https://cdn.sofifa.org/flags/10.png      91        91         Real Madrid
## 8  https://cdn.sofifa.org/flags/60.png      91        91        FC Barcelona
## 11 https://cdn.sofifa.org/flags/37.png      90        90   FC Bayern München
## 12 https://cdn.sofifa.org/flags/21.png      90        90         Real Madrid
## 13 https://cdn.sofifa.org/flags/60.png      90        90     Atlético Madrid
##                                       Club.Logo   Value  Wage Special
## 1  https://cdn.sofifa.org/teams/2/light/241.png \200110.5M \200565K    2202
## 2   https://cdn.sofifa.org/teams/2/light/45.png    \20077M \200405K    2228
## 3   https://cdn.sofifa.org/teams/2/light/73.png \200118.5M \200290K    2143
## 5   https://cdn.sofifa.org/teams/2/light/10.png   \200102M \200355K    2281
## 6    https://cdn.sofifa.org/teams/2/light/5.png    \20093M \200340K    2142
## 7  https://cdn.sofifa.org/teams/2/light/243.png    \20067M \200420K    2280
## 8  https://cdn.sofifa.org/teams/2/light/241.png    \20080M \200455K    2346
## 11  https://cdn.sofifa.org/teams/2/light/21.png    \20077M \200205K    2152
## 12 https://cdn.sofifa.org/teams/2/light/243.png  \20076.5M \200355K    2190
## 13 https://cdn.sofifa.org/teams/2/light/240.png    \20044M \200125K    1946
##    Preferred.Foot International.Reputation Weak.Foot Skill.Moves      Work.Rate
## 1            Left                        5         4           4 Medium/ Medium
## 2           Right                        5         4           5      High/ Low
## 3           Right                        5         5           5   High/ Medium
## 5           Right                        4         5           4     High/ High
## 6           Right                        4         4           4   High/ Medium
## 7           Right                        4         4           4     High/ High
## 8           Right                        5         4           3   High/ Medium
## 11          Right                        4         4           4   High/ Medium
## 12          Right                        4         5           3 Medium/ Medium
## 13          Right                        3         3           2   Medium/ High
##     Body.Type Real.Face Position Jersey.Number       Joined Loaned.From
## 1       Messi       Yes       RF            10  Jul 1, 2004            
## 2  C. Ronaldo       Yes       ST             7 Jul 10, 2018            
## 3      Neymar       Yes       LW            10  Aug 3, 2017            
## 5      Normal       Yes      RCM             7 Aug 30, 2015            
## 6      Normal       Yes       LF            10  Jul 1, 2012            
## 7        Lean       Yes      RCM            10  Aug 1, 2012            
## 8      Normal       Yes       RS             9 Jul 11, 2014            
## 11     Normal       Yes       ST             9  Jul 1, 2014            
## 12     Normal       Yes      LCM             8 Jul 17, 2014            
## 13       Lean       Yes       CB            10  Aug 4, 2010            
##    Contract.Valid.Until Height Weight   LS   ST   RS   LW   LF   CF   RF   RW
## 1                  2021    5'7 159lbs 88+2 88+2 88+2 92+2 93+2 93+2 93+2 92+2
## 2                  2022    6'2 183lbs 91+3 91+3 91+3 89+3 90+3 90+3 90+3 89+3
## 3                  2022    5'9 150lbs 84+3 84+3 84+3 89+3 89+3 89+3 89+3 89+3
## 5                  2023   5'11 154lbs 82+3 82+3 82+3 87+3 87+3 87+3 87+3 87+3
## 6                  2020    5'8 163lbs 83+3 83+3 83+3 89+3 88+3 88+3 88+3 89+3
## 7                  2020    5'8 146lbs 77+3 77+3 77+3 85+3 84+3 84+3 84+3 85+3
## 8                  2021    6'0 190lbs 87+5 87+5 87+5 86+5 87+5 87+5 87+5 86+5
## 11                 2021    6'0 176lbs 87+3 87+3 87+3 83+3 86+3 86+3 86+3 83+3
## 12                 2022    6'0 168lbs 78+3 78+3 78+3 81+3 82+3 82+3 82+3 81+3
## 13                 2019    6'2 172lbs 64+3 64+3 64+3 61+3 62+3 62+3 62+3 61+3
##     LAM  CAM  RAM   LM  LCM   CM  RCM   RM  LWB  LDM  CDM  RDM  RWB   LB  LCB
## 1  93+2 93+2 93+2 91+2 84+2 84+2 84+2 91+2 64+2 61+2 61+2 61+2 64+2 59+2 47+2
## 2  88+3 88+3 88+3 88+3 81+3 81+3 81+3 88+3 65+3 61+3 61+3 61+3 65+3 61+3 53+3
## 3  89+3 89+3 89+3 88+3 81+3 81+3 81+3 88+3 65+3 60+3 60+3 60+3 65+3 60+3 47+3
## 5  88+3 88+3 88+3 88+3 87+3 87+3 87+3 88+3 77+3 77+3 77+3 77+3 77+3 73+3 66+3
## 6  89+3 89+3 89+3 89+3 82+3 82+3 82+3 89+3 66+3 63+3 63+3 63+3 66+3 60+3 49+3
## 7  87+3 87+3 87+3 86+3 88+3 88+3 88+3 86+3 82+3 81+3 81+3 81+3 82+3 79+3 71+3
## 8  85+5 85+5 85+5 84+5 79+5 79+5 79+5 84+5 69+5 68+5 68+5 68+5 69+5 66+5 63+5
## 11 83+3 83+3 83+3 81+3 77+3 77+3 77+3 81+3 61+3 62+3 62+3 62+3 61+3 58+3 57+3
## 12 84+3 84+3 84+3 82+3 86+3 86+3 86+3 82+3 79+3 82+3 82+3 82+3 79+3 77+3 72+3
## 13 62+3 62+3 62+3 63+3 68+3 68+3 68+3 63+3 76+3 81+3 81+3 81+3 76+3 79+3 87+3
##      CB  RCB   RB Crossing Finishing HeadingAccuracy ShortPassing Volleys
## 1  47+2 47+2 59+2       84        95              70           90      86
## 2  53+3 53+3 61+3       84        94              89           81      87
## 3  47+3 47+3 60+3       79        87              62           84      84
## 5  66+3 66+3 73+3       93        82              55           92      82
## 6  49+3 49+3 60+3       81        84              61           89      80
## 7  71+3 71+3 79+3       86        72              55           93      76
## 8  63+5 63+5 66+5       77        93              77           82      88
## 11 57+3 57+3 58+3       62        91              85           83      89
## 12 72+3 72+3 77+3       88        76              54           92      82
## 13 87+3 87+3 79+3       55        42              92           79      47
##    Dribbling Curve FKAccuracy LongPassing BallControl Acceleration SprintSpeed
## 1         97    93         94          87          96           91          86
## 2         88    81         76          77          94           89          91
## 3         96    88         87          78          95           94          90
## 5         86    85         83          91          91           78          76
## 6         95    83         79          83          94           94          88
## 7         90    85         78          88          93           80          72
## 8         87    86         84          64          90           86          75
## 11        85    77         86          65          89           77          78
## 12        81    86         84          93          90           64          62
## 13        53    49         51          70          76           68          68
##    Agility Reactions Balance ShotPower Jumping Stamina Strength LongShots
## 1       91        95      95        85      68      72       59        94
## 2       87        96      70        95      95      88       79        93
## 3       96        94      84        80      61      81       49        82
## 5       79        91      77        91      63      90       75        91
## 6       95        90      94        82      56      83       66        80
## 7       93        90      94        79      68      89       58        82
## 8       82        92      83        86      69      90       83        85
## 11      78        90      78        88      84      78       84        84
## 12      70        89      71        87      30      75       73        92
## 13      58        85      54        67      91      66       88        43
##    Aggression Interceptions Positioning Vision Penalties Composure Marking
## 1          48            22          94     94        75        96      33
## 2          63            29          95     82        85        95      28
## 3          56            36          89     87        81        94      27
## 5          76            61          87     94        79        88      68
## 6          54            41          87     89        86        91      34
## 7          62            83          79     92        82        84      60
## 8          87            41          92     84        85        85      62
## 11         80            39          91     77        88        86      34
## 12         60            82          79     86        73        85      72
## 13         89            88          48     52        50        82      90
##    StandingTackle SlidingTackle GKDiving GKHandling GKKicking GKPositioning
## 1              28            26        6         11        15            14
## 2              31            23        7         11        15            14
## 3              24            33        9          9        15            15
## 5              58            51       15         13         5            10
## 6              27            22       11         12         6             8
## 7              76            73       13          9         7            14
## 8              45            38       27         25        31            33
## 11             42            19       15          6        12             8
## 12             79            69       10         11        13             7
## 13             89            89        6          8        15             5
##    GKReflexes Release.Clause     Valor
## 1           8        \200226.5M 110500000
## 2          11        \200127.1M  77000000
## 3          11        \200228.1M 118500000
## 5          13        \200196.4M 102000000
## 6           8        \200172.1M  93000000
## 7           9        \200137.4M  67000000
## 8          37          \200164M  80000000
## 11         10        \200127.1M  77000000
## 12         10        \200156.8M  76500000
## 13         15         \20090.2M  44000000
head(datos.validacion, 10)
##    X.U.FEFF.     ID         Name Age
## 4          3 193080       De Gea  27
## 9          8 155862 Sergio Ramos  32
## 10         9 200389     J. Oblak  25
## 16        15 211110    P. Dybala  24
## 22        21 179813    E. Cavani  31
## 23        22 167495     M. Neuer  32
## 25        24 138956 G. Chiellini  33
## 29        28 198710 J. Rodríguez  26
## 30        29 198219   L. Insigne  27
## 31        30 197781         Isco  26
##                                             Photo Nationality
## 4  https://cdn.sofifa.org/players/4/19/193080.png       Spain
## 9  https://cdn.sofifa.org/players/4/19/155862.png       Spain
## 10 https://cdn.sofifa.org/players/4/19/200389.png    Slovenia
## 16 https://cdn.sofifa.org/players/4/19/211110.png   Argentina
## 22 https://cdn.sofifa.org/players/4/19/179813.png     Uruguay
## 23 https://cdn.sofifa.org/players/4/19/167495.png     Germany
## 25 https://cdn.sofifa.org/players/4/19/138956.png       Italy
## 29 https://cdn.sofifa.org/players/4/19/198710.png    Colombia
## 30 https://cdn.sofifa.org/players/4/19/198219.png       Italy
## 31 https://cdn.sofifa.org/players/4/19/197781.png       Spain
##                                   Flag Overall Potential                Club
## 4  https://cdn.sofifa.org/flags/45.png      91        93   Manchester United
## 9  https://cdn.sofifa.org/flags/45.png      91        91         Real Madrid
## 10 https://cdn.sofifa.org/flags/44.png      90        93     Atlético Madrid
## 16 https://cdn.sofifa.org/flags/52.png      89        94            Juventus
## 22 https://cdn.sofifa.org/flags/60.png      89        89 Paris Saint-Germain
## 23 https://cdn.sofifa.org/flags/21.png      89        89   FC Bayern München
## 25 https://cdn.sofifa.org/flags/27.png      89        89            Juventus
## 29 https://cdn.sofifa.org/flags/56.png      88        89   FC Bayern München
## 30 https://cdn.sofifa.org/flags/27.png      88        88              Napoli
## 31 https://cdn.sofifa.org/flags/45.png      88        91         Real Madrid
##                                       Club.Logo  Value  Wage Special
## 4   https://cdn.sofifa.org/teams/2/light/11.png   \20072M \200260K    1471
## 9  https://cdn.sofifa.org/teams/2/light/243.png   \20051M \200380K    2201
## 10 https://cdn.sofifa.org/teams/2/light/240.png   \20068M  \20094K    1331
## 16  https://cdn.sofifa.org/teams/2/light/45.png   \20089M \200205K    2092
## 22  https://cdn.sofifa.org/teams/2/light/73.png   \20060M \200200K    2161
## 23  https://cdn.sofifa.org/teams/2/light/21.png   \20038M \200130K    1473
## 25  https://cdn.sofifa.org/teams/2/light/45.png   \20027M \200215K    1841
## 29  https://cdn.sofifa.org/teams/2/light/21.png \20069.5M \200315K    2171
## 30  https://cdn.sofifa.org/teams/2/light/48.png   \20062M \200165K    2017
## 31 https://cdn.sofifa.org/teams/2/light/243.png \20073.5M \200315K    2137
##    Preferred.Foot International.Reputation Weak.Foot Skill.Moves      Work.Rate
## 4           Right                        4         3           1 Medium/ Medium
## 9           Right                        4         3           3   High/ Medium
## 10          Right                        3         3           1 Medium/ Medium
## 16           Left                        3         3           4   High/ Medium
## 22          Right                        4         4           3     High/ High
## 23          Right                        5         4           1 Medium/ Medium
## 25           Left                        4         3           2   Medium/ High
## 29           Left                        4         3           4 Medium/ Medium
## 30          Right                        3         3           4   High/ Medium
## 31          Right                        3         3           4   High/ Medium
##    Body.Type Real.Face Position Jersey.Number       Joined Loaned.From
## 4       Lean       Yes       GK             1  Jul 1, 2011            
## 9     Normal       Yes      RCB            15  Aug 1, 2005            
## 10    Normal       Yes       GK             1 Jul 16, 2014            
## 16    Normal       Yes       LF            21  Jul 1, 2015            
## 22      Lean       Yes       LS            21 Jul 16, 2013            
## 23    Normal       Yes       GK             1  Jul 1, 2011            
## 25    Normal       Yes      LCB             3  Jul 1, 2005            
## 29    Normal       Yes      LAM            10              Real Madrid
## 30    Normal       Yes       LW            10  Jul 1, 2010            
## 31    Normal       Yes       LW            22  Jul 3, 2013            
##    Contract.Valid.Until Height Weight   LS   ST   RS   LW   LF   CF   RF   RW
## 4                  2020    6'4 168lbs                                        
## 9                  2020    6'0 181lbs 73+3 73+3 73+3 70+3 71+3 71+3 71+3 70+3
## 10                 2021    6'2 192lbs                                        
## 16                 2022   5'10 165lbs 83+3 83+3 83+3 87+3 86+3 86+3 86+3 87+3
## 22                 2020    6'1 170lbs 85+3 85+3 85+3 81+3 83+3 83+3 83+3 81+3
## 23                 2021    6'4 203lbs                                        
## 25                 2020    6'2 187lbs 58+3 58+3 58+3 54+3 55+3 55+3 55+3 54+3
## 29         Jun 30, 2019   5'11 172lbs 80+3 80+3 80+3 84+3 83+3 83+3 83+3 84+3
## 30                 2022    5'4 130lbs 78+3 78+3 78+3 86+3 85+3 85+3 85+3 86+3
## 31                 2022    5'9 174lbs 76+3 76+3 76+3 84+3 83+3 83+3 83+3 84+3
##     LAM  CAM  RAM   LM  LCM   CM  RCM   RM  LWB  LDM  CDM  RDM  RWB   LB  LCB
## 4                                                                            
## 9  71+3 71+3 71+3 72+3 75+3 75+3 75+3 72+3 81+3 84+3 84+3 84+3 81+3 84+3 87+3
## 10                                                                           
## 16 87+3 87+3 87+3 86+3 79+3 79+3 79+3 86+3 62+3 58+3 58+3 58+3 62+3 56+3 45+3
## 22 80+3 80+3 80+3 79+3 75+3 75+3 75+3 79+3 67+3 65+3 65+3 65+3 67+3 65+3 63+3
## 23                                                                           
## 25 54+3 54+3 54+3 56+3 60+3 60+3 60+3 56+3 74+3 76+3 76+3 76+3 74+3 77+3 86+3
## 29 85+3 85+3 85+3 83+3 81+3 81+3 81+3 83+3 69+3 68+3 68+3 68+3 69+3 65+3 58+3
## 30 86+3 86+3 86+3 86+3 78+3 78+3 78+3 86+3 63+3 58+3 58+3 58+3 63+3 58+3 44+3
## 31 86+3 86+3 86+3 83+3 83+3 83+3 83+3 83+3 72+3 73+3 73+3 73+3 72+3 68+3 63+3
##      CB  RCB   RB Crossing Finishing HeadingAccuracy ShortPassing Volleys
## 4                       17        13              21           50      13
## 9  87+3 87+3 84+3       66        60              91           78      66
## 10                      13        11              15           29      13
## 16 45+3 45+3 56+3       82        84              68           87      88
## 22 63+3 63+3 65+3       70        89              89           78      90
## 23                      15        13              25           55      11
## 25 86+3 86+3 77+3       58        33              83           59      45
## 29 58+3 58+3 65+3       90        83              62           89      90
## 30 44+3 44+3 58+3       86        77              56           85      74
## 31 63+3 63+3 68+3       75        79              55           89      65
##    Dribbling Curve FKAccuracy LongPassing BallControl Acceleration SprintSpeed
## 4         18    21         19          51          42           57          58
## 9         63    74         72          77          84           76          75
## 10        12    13         14          26          16           43          60
## 16        92    88         88          75          92           87          83
## 22        80    77         76          52          82           75          76
## 23        30    14         11          59          48           54          60
## 25        58    60         31          59          57           63          75
## 29        85    89         86          83          90           73          67
## 30        90    87         77          78          93           94          86
## 31        94    88         76          83          95           75          69
##    Agility Reactions Balance ShotPower Jumping Stamina Strength LongShots
## 4       60        90      43        31      67      43       64        12
## 9       78        85      66        79      93      84       83        59
## 10      67        86      49        22      76      41       78        12
## 16      91        86      85        82      75      80       65        88
## 22      77        91      59        87      88      92       78        79
## 23      51        84      35        25      77      43       80        16
## 25      54        82      55        78      89      65       89        49
## 29      83        85      76        86      54      70       68        92
## 30      94        83      93        75      53      75       44        84
## 31      87        77      90        69      64      70       59        87
##    Aggression Interceptions Positioning Vision Penalties Composure Marking
## 4          38            30          12     68        40        68      15
## 9          88            90          60     63        75        82      87
## 10         34            19          11     70        11        70      27
## 16         48            32          84     87        86        84      23
## 22         84            48          93     77        85        82      52
## 23         29            30          12     70        47        70      17
## 25         92            88          28     50        50        84      93
## 29         64            55          80     89        81        87      52
## 30         34            26          83     87        61        83      51
## 31         58            64          78     89        76        86      60
##    StandingTackle SlidingTackle GKDiving GKHandling GKKicking GKPositioning
## 4              21            13       90         85        87            88
## 9              92            91       11          8         9             7
## 10             12            18       86         92        78            88
## 16             20            20        5          4         4             5
## 22             45            39       12          5        13            13
## 23             10            11       90         86        91            87
## 25             93            90        3          3         2             4
## 29             41            44       15         15        15             5
## 30             24            22        8          4        14             9
## 31             64            51       10          8        12            15
##    GKReflexes Release.Clause    Valor
## 4          94        \200138.6M 72000000
## 9          11        \200104.6M 51000000
## 10         89        \200144.5M 68000000
## 16          8        \200153.5M 89000000
## 22         10          \200111M 60000000
## 23         87         \20062.7M 38000000
## 25          3         \20044.6M 27000000
## 29         14                69500000
## 30         10        \200105.4M 62000000
## 31          6        \200156.2M 73500000

Modelo a la segunda potencia

modelo2 <- lm(formula = Valor ~ poly(Overall, 2), data = datos.entrenamiento)

summary(modelo2)
## 
## Call:
## lm(formula = Valor ~ poly(Overall, 2), data = datos.entrenamiento)
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -30095610   -930187    382964   1222718  73081882 
## 
## Coefficients:
##                    Estimate Std. Error t value            Pr(>|t|)    
## (Intercept)         2442774      25076   97.41 <0.0000000000000002 ***
## poly(Overall, 2)1 398229563    2811332  141.65 <0.0000000000000002 ***
## poly(Overall, 2)2 384331743    2811332  136.71 <0.0000000000000002 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2811000 on 12566 degrees of freedom
## Multiple R-squared:  0.7551, Adjusted R-squared:  0.7551 
## F-statistic: 1.938e+04 on 2 and 12566 DF,  p-value: < 0.00000000000000022

Se observa que el modelo polinómico a la potencia 2 los p-values individuales de cada predictor son todos muy bajos , por debajo del 0.001 identificado con tres ’***’ y se interpreta que hay estadísticamente significación en los predictores

Además, que al menos uno de los predictores introducidos en el modelo está relacionado con la variable respuesta Valor.

Por otra parte, el R-square igual a 0.7535 y el Adjusted R-Square igual a 0.7535 representan que la variable overall representa aproximadamente el 75% de Value en un jugador por lo que el modelo es aceptable.

La predicción será dada por y=β0+β1xi2ϵi

Para este caso significa que Overall explica el valor económico del jugador.

Modelo a la cuarta potencia

modelo4 <- lm(formula = Valor ~ poly(Overall, 4), data = datos.entrenamiento)

summary(modelo4)
## 
## Call:
## lm(formula = Valor ~ poly(Overall, 4), data = datos.entrenamiento)
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -48804991   -198589      3451    151184  31310143 
## 
## Coefficients:
##                    Estimate Std. Error t value            Pr(>|t|)    
## (Intercept)         2442774      16071  152.00 <0.0000000000000002 ***
## poly(Overall, 4)1 398229563    1801739  221.03 <0.0000000000000002 ***
## poly(Overall, 4)2 384331743    1801739  213.31 <0.0000000000000002 ***
## poly(Overall, 4)3 230674298    1801739  128.03 <0.0000000000000002 ***
## poly(Overall, 4)4  72936931    1801739   40.48 <0.0000000000000002 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1802000 on 12564 degrees of freedom
## Multiple R-squared:  0.8994, Adjusted R-squared:  0.8994 
## F-statistic: 2.81e+04 on 4 and 12564 DF,  p-value: < 0.00000000000000022

Se observa que el modelo polinómico a la potencia 4 los p-values individuales de cada predictor son todos muy bajos , por debajo del 0.001 identificado con tres ’***’ y se interpreta que hay estadísticamente significación en los predictores

Además, que al menos uno de los predictores introducidos en el modelo está relacionado con la variable respuesta Valor.

Por otra parte, el R-sqared igual a 0.8994 y el Adjusted R-Square igual a 0.8994 representan que la variable overal representa aproximadamente el 90% del valor económico de un jugador por lo que el modelo es bueno.

La predicción será dada por y=β0+β1xi2β1xi3+β1xi4ϵi

Para este caso significa que Overall explica el Valor económico del jugador.

Tendencias

ggplot() + 
  geom_point(data = datos, aes(x = Overall, y = Valor)) + geom_line(aes( x = datos$Overall, y = predict(modelo2, datos)), color = "red")

Tendencia a la cuarta potencia

ggplot() + 
  geom_point(data = datos, aes(x = Overall, y = Valor)) + geom_line(aes( x = datos$Overall, y = predict(modelo4, datos)), color = "darkred")

Determinar predicciones

Algunas predicciones con el conjunto de datos de validación usando la fórmula del modelo:

y=β0+β1xi2+β3xi3+...+βdxdin+ϵi
modelo <- lm(formula = Valor ~ Overall, data = datos.entrenamiento)

summary(modelo)
## 
## Call:
## lm(formula = Valor ~ Overall, data = datos.entrenamiento)
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
##  -9583770  -2104319   -889593   1030270 102871367 
## 
## Coefficients:
##              Estimate Std. Error t value            Pr(>|t|)    
## (Intercept) -31403214     378886  -82.88 <0.0000000000000002 ***
## Overall        511216       5692   89.82 <0.0000000000000002 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 4434000 on 12567 degrees of freedom
## Multiple R-squared:  0.391,  Adjusted R-squared:  0.3909 
## F-statistic:  8068 on 1 and 12567 DF,  p-value: < 0.00000000000000022
paste("Valor de a = ", modelo$coefficients[1])
## [1] "Valor de a =  -31403213.910327"
paste("Valor de b = ", modelo$coefficients[2])
## [1] "Valor de b =  511215.731269587"
prediccion <- predict(modelo, newdata = datos.validacion)
datos.validacion <- mutate(datos.validacion, predicho = prediccion)

head(datos.validacion, 10)
##    X.U.FEFF.     ID         Name Age
## 1          3 193080       De Gea  27
## 2          8 155862 Sergio Ramos  32
## 3          9 200389     J. Oblak  25
## 4         15 211110    P. Dybala  24
## 5         21 179813    E. Cavani  31
## 6         22 167495     M. Neuer  32
## 7         24 138956 G. Chiellini  33
## 8         28 198710 J. Rodríguez  26
## 9         29 198219   L. Insigne  27
## 10        30 197781         Isco  26
##                                             Photo Nationality
## 1  https://cdn.sofifa.org/players/4/19/193080.png       Spain
## 2  https://cdn.sofifa.org/players/4/19/155862.png       Spain
## 3  https://cdn.sofifa.org/players/4/19/200389.png    Slovenia
## 4  https://cdn.sofifa.org/players/4/19/211110.png   Argentina
## 5  https://cdn.sofifa.org/players/4/19/179813.png     Uruguay
## 6  https://cdn.sofifa.org/players/4/19/167495.png     Germany
## 7  https://cdn.sofifa.org/players/4/19/138956.png       Italy
## 8  https://cdn.sofifa.org/players/4/19/198710.png    Colombia
## 9  https://cdn.sofifa.org/players/4/19/198219.png       Italy
## 10 https://cdn.sofifa.org/players/4/19/197781.png       Spain
##                                   Flag Overall Potential                Club
## 1  https://cdn.sofifa.org/flags/45.png      91        93   Manchester United
## 2  https://cdn.sofifa.org/flags/45.png      91        91         Real Madrid
## 3  https://cdn.sofifa.org/flags/44.png      90        93     Atlético Madrid
## 4  https://cdn.sofifa.org/flags/52.png      89        94            Juventus
## 5  https://cdn.sofifa.org/flags/60.png      89        89 Paris Saint-Germain
## 6  https://cdn.sofifa.org/flags/21.png      89        89   FC Bayern München
## 7  https://cdn.sofifa.org/flags/27.png      89        89            Juventus
## 8  https://cdn.sofifa.org/flags/56.png      88        89   FC Bayern München
## 9  https://cdn.sofifa.org/flags/27.png      88        88              Napoli
## 10 https://cdn.sofifa.org/flags/45.png      88        91         Real Madrid
##                                       Club.Logo  Value  Wage Special
## 1   https://cdn.sofifa.org/teams/2/light/11.png   \20072M \200260K    1471
## 2  https://cdn.sofifa.org/teams/2/light/243.png   \20051M \200380K    2201
## 3  https://cdn.sofifa.org/teams/2/light/240.png   \20068M  \20094K    1331
## 4   https://cdn.sofifa.org/teams/2/light/45.png   \20089M \200205K    2092
## 5   https://cdn.sofifa.org/teams/2/light/73.png   \20060M \200200K    2161
## 6   https://cdn.sofifa.org/teams/2/light/21.png   \20038M \200130K    1473
## 7   https://cdn.sofifa.org/teams/2/light/45.png   \20027M \200215K    1841
## 8   https://cdn.sofifa.org/teams/2/light/21.png \20069.5M \200315K    2171
## 9   https://cdn.sofifa.org/teams/2/light/48.png   \20062M \200165K    2017
## 10 https://cdn.sofifa.org/teams/2/light/243.png \20073.5M \200315K    2137
##    Preferred.Foot International.Reputation Weak.Foot Skill.Moves      Work.Rate
## 1           Right                        4         3           1 Medium/ Medium
## 2           Right                        4         3           3   High/ Medium
## 3           Right                        3         3           1 Medium/ Medium
## 4            Left                        3         3           4   High/ Medium
## 5           Right                        4         4           3     High/ High
## 6           Right                        5         4           1 Medium/ Medium
## 7            Left                        4         3           2   Medium/ High
## 8            Left                        4         3           4 Medium/ Medium
## 9           Right                        3         3           4   High/ Medium
## 10          Right                        3         3           4   High/ Medium
##    Body.Type Real.Face Position Jersey.Number       Joined Loaned.From
## 1       Lean       Yes       GK             1  Jul 1, 2011            
## 2     Normal       Yes      RCB            15  Aug 1, 2005            
## 3     Normal       Yes       GK             1 Jul 16, 2014            
## 4     Normal       Yes       LF            21  Jul 1, 2015            
## 5       Lean       Yes       LS            21 Jul 16, 2013            
## 6     Normal       Yes       GK             1  Jul 1, 2011            
## 7     Normal       Yes      LCB             3  Jul 1, 2005            
## 8     Normal       Yes      LAM            10              Real Madrid
## 9     Normal       Yes       LW            10  Jul 1, 2010            
## 10    Normal       Yes       LW            22  Jul 3, 2013            
##    Contract.Valid.Until Height Weight   LS   ST   RS   LW   LF   CF   RF   RW
## 1                  2020    6'4 168lbs                                        
## 2                  2020    6'0 181lbs 73+3 73+3 73+3 70+3 71+3 71+3 71+3 70+3
## 3                  2021    6'2 192lbs                                        
## 4                  2022   5'10 165lbs 83+3 83+3 83+3 87+3 86+3 86+3 86+3 87+3
## 5                  2020    6'1 170lbs 85+3 85+3 85+3 81+3 83+3 83+3 83+3 81+3
## 6                  2021    6'4 203lbs                                        
## 7                  2020    6'2 187lbs 58+3 58+3 58+3 54+3 55+3 55+3 55+3 54+3
## 8          Jun 30, 2019   5'11 172lbs 80+3 80+3 80+3 84+3 83+3 83+3 83+3 84+3
## 9                  2022    5'4 130lbs 78+3 78+3 78+3 86+3 85+3 85+3 85+3 86+3
## 10                 2022    5'9 174lbs 76+3 76+3 76+3 84+3 83+3 83+3 83+3 84+3
##     LAM  CAM  RAM   LM  LCM   CM  RCM   RM  LWB  LDM  CDM  RDM  RWB   LB  LCB
## 1                                                                            
## 2  71+3 71+3 71+3 72+3 75+3 75+3 75+3 72+3 81+3 84+3 84+3 84+3 81+3 84+3 87+3
## 3                                                                            
## 4  87+3 87+3 87+3 86+3 79+3 79+3 79+3 86+3 62+3 58+3 58+3 58+3 62+3 56+3 45+3
## 5  80+3 80+3 80+3 79+3 75+3 75+3 75+3 79+3 67+3 65+3 65+3 65+3 67+3 65+3 63+3
## 6                                                                            
## 7  54+3 54+3 54+3 56+3 60+3 60+3 60+3 56+3 74+3 76+3 76+3 76+3 74+3 77+3 86+3
## 8  85+3 85+3 85+3 83+3 81+3 81+3 81+3 83+3 69+3 68+3 68+3 68+3 69+3 65+3 58+3
## 9  86+3 86+3 86+3 86+3 78+3 78+3 78+3 86+3 63+3 58+3 58+3 58+3 63+3 58+3 44+3
## 10 86+3 86+3 86+3 83+3 83+3 83+3 83+3 83+3 72+3 73+3 73+3 73+3 72+3 68+3 63+3
##      CB  RCB   RB Crossing Finishing HeadingAccuracy ShortPassing Volleys
## 1                       17        13              21           50      13
## 2  87+3 87+3 84+3       66        60              91           78      66
## 3                       13        11              15           29      13
## 4  45+3 45+3 56+3       82        84              68           87      88
## 5  63+3 63+3 65+3       70        89              89           78      90
## 6                       15        13              25           55      11
## 7  86+3 86+3 77+3       58        33              83           59      45
## 8  58+3 58+3 65+3       90        83              62           89      90
## 9  44+3 44+3 58+3       86        77              56           85      74
## 10 63+3 63+3 68+3       75        79              55           89      65
##    Dribbling Curve FKAccuracy LongPassing BallControl Acceleration SprintSpeed
## 1         18    21         19          51          42           57          58
## 2         63    74         72          77          84           76          75
## 3         12    13         14          26          16           43          60
## 4         92    88         88          75          92           87          83
## 5         80    77         76          52          82           75          76
## 6         30    14         11          59          48           54          60
## 7         58    60         31          59          57           63          75
## 8         85    89         86          83          90           73          67
## 9         90    87         77          78          93           94          86
## 10        94    88         76          83          95           75          69
##    Agility Reactions Balance ShotPower Jumping Stamina Strength LongShots
## 1       60        90      43        31      67      43       64        12
## 2       78        85      66        79      93      84       83        59
## 3       67        86      49        22      76      41       78        12
## 4       91        86      85        82      75      80       65        88
## 5       77        91      59        87      88      92       78        79
## 6       51        84      35        25      77      43       80        16
## 7       54        82      55        78      89      65       89        49
## 8       83        85      76        86      54      70       68        92
## 9       94        83      93        75      53      75       44        84
## 10      87        77      90        69      64      70       59        87
##    Aggression Interceptions Positioning Vision Penalties Composure Marking
## 1          38            30          12     68        40        68      15
## 2          88            90          60     63        75        82      87
## 3          34            19          11     70        11        70      27
## 4          48            32          84     87        86        84      23
## 5          84            48          93     77        85        82      52
## 6          29            30          12     70        47        70      17
## 7          92            88          28     50        50        84      93
## 8          64            55          80     89        81        87      52
## 9          34            26          83     87        61        83      51
## 10         58            64          78     89        76        86      60
##    StandingTackle SlidingTackle GKDiving GKHandling GKKicking GKPositioning
## 1              21            13       90         85        87            88
## 2              92            91       11          8         9             7
## 3              12            18       86         92        78            88
## 4              20            20        5          4         4             5
## 5              45            39       12          5        13            13
## 6              10            11       90         86        91            87
## 7              93            90        3          3         2             4
## 8              41            44       15         15        15             5
## 9              24            22        8          4        14             9
## 10             64            51       10          8        12            15
##    GKReflexes Release.Clause    Valor predicho
## 1          94        \200138.6M 72000000 15117418
## 2          11        \200104.6M 51000000 15117418
## 3          89        \200144.5M 68000000 14606202
## 4           8        \200153.5M 89000000 14094986
## 5          10          \200111M 60000000 14094986
## 6          87         \20062.7M 38000000 14094986
## 7           3         \20044.6M 27000000 14094986
## 8          14                69500000 13583770
## 9          10        \200105.4M 62000000 13583770
## 10          6        \200156.2M 73500000 13583770

Prediccion con modelo 2

prediccion <- predict(modelo2, newdata = datos.validacion)
new.datos.validacion <- mutate(datos.validacion, predicho2 = prediccion)
head(new.datos.validacion, 10)
##    X.U.FEFF.     ID         Name Age
## 1          3 193080       De Gea  27
## 2          8 155862 Sergio Ramos  32
## 3          9 200389     J. Oblak  25
## 4         15 211110    P. Dybala  24
## 5         21 179813    E. Cavani  31
## 6         22 167495     M. Neuer  32
## 7         24 138956 G. Chiellini  33
## 8         28 198710 J. Rodríguez  26
## 9         29 198219   L. Insigne  27
## 10        30 197781         Isco  26
##                                             Photo Nationality
## 1  https://cdn.sofifa.org/players/4/19/193080.png       Spain
## 2  https://cdn.sofifa.org/players/4/19/155862.png       Spain
## 3  https://cdn.sofifa.org/players/4/19/200389.png    Slovenia
## 4  https://cdn.sofifa.org/players/4/19/211110.png   Argentina
## 5  https://cdn.sofifa.org/players/4/19/179813.png     Uruguay
## 6  https://cdn.sofifa.org/players/4/19/167495.png     Germany
## 7  https://cdn.sofifa.org/players/4/19/138956.png       Italy
## 8  https://cdn.sofifa.org/players/4/19/198710.png    Colombia
## 9  https://cdn.sofifa.org/players/4/19/198219.png       Italy
## 10 https://cdn.sofifa.org/players/4/19/197781.png       Spain
##                                   Flag Overall Potential                Club
## 1  https://cdn.sofifa.org/flags/45.png      91        93   Manchester United
## 2  https://cdn.sofifa.org/flags/45.png      91        91         Real Madrid
## 3  https://cdn.sofifa.org/flags/44.png      90        93     Atlético Madrid
## 4  https://cdn.sofifa.org/flags/52.png      89        94            Juventus
## 5  https://cdn.sofifa.org/flags/60.png      89        89 Paris Saint-Germain
## 6  https://cdn.sofifa.org/flags/21.png      89        89   FC Bayern München
## 7  https://cdn.sofifa.org/flags/27.png      89        89            Juventus
## 8  https://cdn.sofifa.org/flags/56.png      88        89   FC Bayern München
## 9  https://cdn.sofifa.org/flags/27.png      88        88              Napoli
## 10 https://cdn.sofifa.org/flags/45.png      88        91         Real Madrid
##                                       Club.Logo  Value  Wage Special
## 1   https://cdn.sofifa.org/teams/2/light/11.png   \20072M \200260K    1471
## 2  https://cdn.sofifa.org/teams/2/light/243.png   \20051M \200380K    2201
## 3  https://cdn.sofifa.org/teams/2/light/240.png   \20068M  \20094K    1331
## 4   https://cdn.sofifa.org/teams/2/light/45.png   \20089M \200205K    2092
## 5   https://cdn.sofifa.org/teams/2/light/73.png   \20060M \200200K    2161
## 6   https://cdn.sofifa.org/teams/2/light/21.png   \20038M \200130K    1473
## 7   https://cdn.sofifa.org/teams/2/light/45.png   \20027M \200215K    1841
## 8   https://cdn.sofifa.org/teams/2/light/21.png \20069.5M \200315K    2171
## 9   https://cdn.sofifa.org/teams/2/light/48.png   \20062M \200165K    2017
## 10 https://cdn.sofifa.org/teams/2/light/243.png \20073.5M \200315K    2137
##    Preferred.Foot International.Reputation Weak.Foot Skill.Moves      Work.Rate
## 1           Right                        4         3           1 Medium/ Medium
## 2           Right                        4         3           3   High/ Medium
## 3           Right                        3         3           1 Medium/ Medium
## 4            Left                        3         3           4   High/ Medium
## 5           Right                        4         4           3     High/ High
## 6           Right                        5         4           1 Medium/ Medium
## 7            Left                        4         3           2   Medium/ High
## 8            Left                        4         3           4 Medium/ Medium
## 9           Right                        3         3           4   High/ Medium
## 10          Right                        3         3           4   High/ Medium
##    Body.Type Real.Face Position Jersey.Number       Joined Loaned.From
## 1       Lean       Yes       GK             1  Jul 1, 2011            
## 2     Normal       Yes      RCB            15  Aug 1, 2005            
## 3     Normal       Yes       GK             1 Jul 16, 2014            
## 4     Normal       Yes       LF            21  Jul 1, 2015            
## 5       Lean       Yes       LS            21 Jul 16, 2013            
## 6     Normal       Yes       GK             1  Jul 1, 2011            
## 7     Normal       Yes      LCB             3  Jul 1, 2005            
## 8     Normal       Yes      LAM            10              Real Madrid
## 9     Normal       Yes       LW            10  Jul 1, 2010            
## 10    Normal       Yes       LW            22  Jul 3, 2013            
##    Contract.Valid.Until Height Weight   LS   ST   RS   LW   LF   CF   RF   RW
## 1                  2020    6'4 168lbs                                        
## 2                  2020    6'0 181lbs 73+3 73+3 73+3 70+3 71+3 71+3 71+3 70+3
## 3                  2021    6'2 192lbs                                        
## 4                  2022   5'10 165lbs 83+3 83+3 83+3 87+3 86+3 86+3 86+3 87+3
## 5                  2020    6'1 170lbs 85+3 85+3 85+3 81+3 83+3 83+3 83+3 81+3
## 6                  2021    6'4 203lbs                                        
## 7                  2020    6'2 187lbs 58+3 58+3 58+3 54+3 55+3 55+3 55+3 54+3
## 8          Jun 30, 2019   5'11 172lbs 80+3 80+3 80+3 84+3 83+3 83+3 83+3 84+3
## 9                  2022    5'4 130lbs 78+3 78+3 78+3 86+3 85+3 85+3 85+3 86+3
## 10                 2022    5'9 174lbs 76+3 76+3 76+3 84+3 83+3 83+3 83+3 84+3
##     LAM  CAM  RAM   LM  LCM   CM  RCM   RM  LWB  LDM  CDM  RDM  RWB   LB  LCB
## 1                                                                            
## 2  71+3 71+3 71+3 72+3 75+3 75+3 75+3 72+3 81+3 84+3 84+3 84+3 81+3 84+3 87+3
## 3                                                                            
## 4  87+3 87+3 87+3 86+3 79+3 79+3 79+3 86+3 62+3 58+3 58+3 58+3 62+3 56+3 45+3
## 5  80+3 80+3 80+3 79+3 75+3 75+3 75+3 79+3 67+3 65+3 65+3 65+3 67+3 65+3 63+3
## 6                                                                            
## 7  54+3 54+3 54+3 56+3 60+3 60+3 60+3 56+3 74+3 76+3 76+3 76+3 74+3 77+3 86+3
## 8  85+3 85+3 85+3 83+3 81+3 81+3 81+3 83+3 69+3 68+3 68+3 68+3 69+3 65+3 58+3
## 9  86+3 86+3 86+3 86+3 78+3 78+3 78+3 86+3 63+3 58+3 58+3 58+3 63+3 58+3 44+3
## 10 86+3 86+3 86+3 83+3 83+3 83+3 83+3 83+3 72+3 73+3 73+3 73+3 72+3 68+3 63+3
##      CB  RCB   RB Crossing Finishing HeadingAccuracy ShortPassing Volleys
## 1                       17        13              21           50      13
## 2  87+3 87+3 84+3       66        60              91           78      66
## 3                       13        11              15           29      13
## 4  45+3 45+3 56+3       82        84              68           87      88
## 5  63+3 63+3 65+3       70        89              89           78      90
## 6                       15        13              25           55      11
## 7  86+3 86+3 77+3       58        33              83           59      45
## 8  58+3 58+3 65+3       90        83              62           89      90
## 9  44+3 44+3 58+3       86        77              56           85      74
## 10 63+3 63+3 68+3       75        79              55           89      65
##    Dribbling Curve FKAccuracy LongPassing BallControl Acceleration SprintSpeed
## 1         18    21         19          51          42           57          58
## 2         63    74         72          77          84           76          75
## 3         12    13         14          26          16           43          60
## 4         92    88         88          75          92           87          83
## 5         80    77         76          52          82           75          76
## 6         30    14         11          59          48           54          60
## 7         58    60         31          59          57           63          75
## 8         85    89         86          83          90           73          67
## 9         90    87         77          78          93           94          86
## 10        94    88         76          83          95           75          69
##    Agility Reactions Balance ShotPower Jumping Stamina Strength LongShots
## 1       60        90      43        31      67      43       64        12
## 2       78        85      66        79      93      84       83        59
## 3       67        86      49        22      76      41       78        12
## 4       91        86      85        82      75      80       65        88
## 5       77        91      59        87      88      92       78        79
## 6       51        84      35        25      77      43       80        16
## 7       54        82      55        78      89      65       89        49
## 8       83        85      76        86      54      70       68        92
## 9       94        83      93        75      53      75       44        84
## 10      87        77      90        69      64      70       59        87
##    Aggression Interceptions Positioning Vision Penalties Composure Marking
## 1          38            30          12     68        40        68      15
## 2          88            90          60     63        75        82      87
## 3          34            19          11     70        11        70      27
## 4          48            32          84     87        86        84      23
## 5          84            48          93     77        85        82      52
## 6          29            30          12     70        47        70      17
## 7          92            88          28     50        50        84      93
## 8          64            55          80     89        81        87      52
## 9          34            26          83     87        61        83      51
## 10         58            64          78     89        76        86      60
##    StandingTackle SlidingTackle GKDiving GKHandling GKKicking GKPositioning
## 1              21            13       90         85        87            88
## 2              92            91       11          8         9             7
## 3              12            18       86         92        78            88
## 4              20            20        5          4         4             5
## 5              45            39       12          5        13            13
## 6              10            11       90         86        91            87
## 7              93            90        3          3         2             4
## 8              41            44       15         15        15             5
## 9              24            22        8          4        14             9
## 10             64            51       10          8        12            15
##    GKReflexes Release.Clause    Valor predicho predicho2
## 1          94        \200138.6M 72000000 15117418  42439871
## 2          11        \200104.6M 51000000 15117418  42439871
## 3          89        \200144.5M 68000000 14606202  39560037
## 4           8        \200153.5M 89000000 14094986  36778617
## 5          10          \200111M 60000000 14094986  36778617
## 6          87         \20062.7M 38000000 14094986  36778617
## 7           3         \20044.6M 27000000 14094986  36778617
## 8          14                69500000 13583770  34095610
## 9          10        \200105.4M 62000000 13583770  34095610
## 10          6        \200156.2M 73500000 13583770  34095610

Prediccion modelo 4

prediccion <- predict(modelo4, newdata = datos.validacion)
new.datos.validacion <- mutate(new.datos.validacion, predicho4 = prediccion)

head(new.datos.validacion, 10)
##    X.U.FEFF.     ID         Name Age
## 1          3 193080       De Gea  27
## 2          8 155862 Sergio Ramos  32
## 3          9 200389     J. Oblak  25
## 4         15 211110    P. Dybala  24
## 5         21 179813    E. Cavani  31
## 6         22 167495     M. Neuer  32
## 7         24 138956 G. Chiellini  33
## 8         28 198710 J. Rodríguez  26
## 9         29 198219   L. Insigne  27
## 10        30 197781         Isco  26
##                                             Photo Nationality
## 1  https://cdn.sofifa.org/players/4/19/193080.png       Spain
## 2  https://cdn.sofifa.org/players/4/19/155862.png       Spain
## 3  https://cdn.sofifa.org/players/4/19/200389.png    Slovenia
## 4  https://cdn.sofifa.org/players/4/19/211110.png   Argentina
## 5  https://cdn.sofifa.org/players/4/19/179813.png     Uruguay
## 6  https://cdn.sofifa.org/players/4/19/167495.png     Germany
## 7  https://cdn.sofifa.org/players/4/19/138956.png       Italy
## 8  https://cdn.sofifa.org/players/4/19/198710.png    Colombia
## 9  https://cdn.sofifa.org/players/4/19/198219.png       Italy
## 10 https://cdn.sofifa.org/players/4/19/197781.png       Spain
##                                   Flag Overall Potential                Club
## 1  https://cdn.sofifa.org/flags/45.png      91        93   Manchester United
## 2  https://cdn.sofifa.org/flags/45.png      91        91         Real Madrid
## 3  https://cdn.sofifa.org/flags/44.png      90        93     Atlético Madrid
## 4  https://cdn.sofifa.org/flags/52.png      89        94            Juventus
## 5  https://cdn.sofifa.org/flags/60.png      89        89 Paris Saint-Germain
## 6  https://cdn.sofifa.org/flags/21.png      89        89   FC Bayern München
## 7  https://cdn.sofifa.org/flags/27.png      89        89            Juventus
## 8  https://cdn.sofifa.org/flags/56.png      88        89   FC Bayern München
## 9  https://cdn.sofifa.org/flags/27.png      88        88              Napoli
## 10 https://cdn.sofifa.org/flags/45.png      88        91         Real Madrid
##                                       Club.Logo  Value  Wage Special
## 1   https://cdn.sofifa.org/teams/2/light/11.png   \20072M \200260K    1471
## 2  https://cdn.sofifa.org/teams/2/light/243.png   \20051M \200380K    2201
## 3  https://cdn.sofifa.org/teams/2/light/240.png   \20068M  \20094K    1331
## 4   https://cdn.sofifa.org/teams/2/light/45.png   \20089M \200205K    2092
## 5   https://cdn.sofifa.org/teams/2/light/73.png   \20060M \200200K    2161
## 6   https://cdn.sofifa.org/teams/2/light/21.png   \20038M \200130K    1473
## 7   https://cdn.sofifa.org/teams/2/light/45.png   \20027M \200215K    1841
## 8   https://cdn.sofifa.org/teams/2/light/21.png \20069.5M \200315K    2171
## 9   https://cdn.sofifa.org/teams/2/light/48.png   \20062M \200165K    2017
## 10 https://cdn.sofifa.org/teams/2/light/243.png \20073.5M \200315K    2137
##    Preferred.Foot International.Reputation Weak.Foot Skill.Moves      Work.Rate
## 1           Right                        4         3           1 Medium/ Medium
## 2           Right                        4         3           3   High/ Medium
## 3           Right                        3         3           1 Medium/ Medium
## 4            Left                        3         3           4   High/ Medium
## 5           Right                        4         4           3     High/ High
## 6           Right                        5         4           1 Medium/ Medium
## 7            Left                        4         3           2   Medium/ High
## 8            Left                        4         3           4 Medium/ Medium
## 9           Right                        3         3           4   High/ Medium
## 10          Right                        3         3           4   High/ Medium
##    Body.Type Real.Face Position Jersey.Number       Joined Loaned.From
## 1       Lean       Yes       GK             1  Jul 1, 2011            
## 2     Normal       Yes      RCB            15  Aug 1, 2005            
## 3     Normal       Yes       GK             1 Jul 16, 2014            
## 4     Normal       Yes       LF            21  Jul 1, 2015            
## 5       Lean       Yes       LS            21 Jul 16, 2013            
## 6     Normal       Yes       GK             1  Jul 1, 2011            
## 7     Normal       Yes      LCB             3  Jul 1, 2005            
## 8     Normal       Yes      LAM            10              Real Madrid
## 9     Normal       Yes       LW            10  Jul 1, 2010            
## 10    Normal       Yes       LW            22  Jul 3, 2013            
##    Contract.Valid.Until Height Weight   LS   ST   RS   LW   LF   CF   RF   RW
## 1                  2020    6'4 168lbs                                        
## 2                  2020    6'0 181lbs 73+3 73+3 73+3 70+3 71+3 71+3 71+3 70+3
## 3                  2021    6'2 192lbs                                        
## 4                  2022   5'10 165lbs 83+3 83+3 83+3 87+3 86+3 86+3 86+3 87+3
## 5                  2020    6'1 170lbs 85+3 85+3 85+3 81+3 83+3 83+3 83+3 81+3
## 6                  2021    6'4 203lbs                                        
## 7                  2020    6'2 187lbs 58+3 58+3 58+3 54+3 55+3 55+3 55+3 54+3
## 8          Jun 30, 2019   5'11 172lbs 80+3 80+3 80+3 84+3 83+3 83+3 83+3 84+3
## 9                  2022    5'4 130lbs 78+3 78+3 78+3 86+3 85+3 85+3 85+3 86+3
## 10                 2022    5'9 174lbs 76+3 76+3 76+3 84+3 83+3 83+3 83+3 84+3
##     LAM  CAM  RAM   LM  LCM   CM  RCM   RM  LWB  LDM  CDM  RDM  RWB   LB  LCB
## 1                                                                            
## 2  71+3 71+3 71+3 72+3 75+3 75+3 75+3 72+3 81+3 84+3 84+3 84+3 81+3 84+3 87+3
## 3                                                                            
## 4  87+3 87+3 87+3 86+3 79+3 79+3 79+3 86+3 62+3 58+3 58+3 58+3 62+3 56+3 45+3
## 5  80+3 80+3 80+3 79+3 75+3 75+3 75+3 79+3 67+3 65+3 65+3 65+3 67+3 65+3 63+3
## 6                                                                            
## 7  54+3 54+3 54+3 56+3 60+3 60+3 60+3 56+3 74+3 76+3 76+3 76+3 74+3 77+3 86+3
## 8  85+3 85+3 85+3 83+3 81+3 81+3 81+3 83+3 69+3 68+3 68+3 68+3 69+3 65+3 58+3
## 9  86+3 86+3 86+3 86+3 78+3 78+3 78+3 86+3 63+3 58+3 58+3 58+3 63+3 58+3 44+3
## 10 86+3 86+3 86+3 83+3 83+3 83+3 83+3 83+3 72+3 73+3 73+3 73+3 72+3 68+3 63+3
##      CB  RCB   RB Crossing Finishing HeadingAccuracy ShortPassing Volleys
## 1                       17        13              21           50      13
## 2  87+3 87+3 84+3       66        60              91           78      66
## 3                       13        11              15           29      13
## 4  45+3 45+3 56+3       82        84              68           87      88
## 5  63+3 63+3 65+3       70        89              89           78      90
## 6                       15        13              25           55      11
## 7  86+3 86+3 77+3       58        33              83           59      45
## 8  58+3 58+3 65+3       90        83              62           89      90
## 9  44+3 44+3 58+3       86        77              56           85      74
## 10 63+3 63+3 68+3       75        79              55           89      65
##    Dribbling Curve FKAccuracy LongPassing BallControl Acceleration SprintSpeed
## 1         18    21         19          51          42           57          58
## 2         63    74         72          77          84           76          75
## 3         12    13         14          26          16           43          60
## 4         92    88         88          75          92           87          83
## 5         80    77         76          52          82           75          76
## 6         30    14         11          59          48           54          60
## 7         58    60         31          59          57           63          75
## 8         85    89         86          83          90           73          67
## 9         90    87         77          78          93           94          86
## 10        94    88         76          83          95           75          69
##    Agility Reactions Balance ShotPower Jumping Stamina Strength LongShots
## 1       60        90      43        31      67      43       64        12
## 2       78        85      66        79      93      84       83        59
## 3       67        86      49        22      76      41       78        12
## 4       91        86      85        82      75      80       65        88
## 5       77        91      59        87      88      92       78        79
## 6       51        84      35        25      77      43       80        16
## 7       54        82      55        78      89      65       89        49
## 8       83        85      76        86      54      70       68        92
## 9       94        83      93        75      53      75       44        84
## 10      87        77      90        69      64      70       59        87
##    Aggression Interceptions Positioning Vision Penalties Composure Marking
## 1          38            30          12     68        40        68      15
## 2          88            90          60     63        75        82      87
## 3          34            19          11     70        11        70      27
## 4          48            32          84     87        86        84      23
## 5          84            48          93     77        85        82      52
## 6          29            30          12     70        47        70      17
## 7          92            88          28     50        50        84      93
## 8          64            55          80     89        81        87      52
## 9          34            26          83     87        61        83      51
## 10         58            64          78     89        76        86      60
##    StandingTackle SlidingTackle GKDiving GKHandling GKKicking GKPositioning
## 1              21            13       90         85        87            88
## 2              92            91       11          8         9             7
## 3              12            18       86         92        78            88
## 4              20            20        5          4         4             5
## 5              45            39       12          5        13            13
## 6              10            11       90         86        91            87
## 7              93            90        3          3         2             4
## 8              41            44       15         15        15             5
## 9              24            22        8          4        14             9
## 10             64            51       10          8        12            15
##    GKReflexes Release.Clause    Valor predicho predicho2 predicho4
## 1          94        \200138.6M 72000000 15117418  42439871  77346260
## 2          11        \200104.6M 51000000 15117418  42439871  77346260
## 3          89        \200144.5M 68000000 14606202  39560037  68369009
## 4           8        \200153.5M 89000000 14094986  36778617  60205554
## 5          10          \200111M 60000000 14094986  36778617  60205554
## 6          87         \20062.7M 38000000 14094986  36778617  60205554
## 7           3         \20044.6M 27000000 14094986  36778617  60205554
## 8          14                69500000 13583770  34095610  52804991
## 9          10        \200105.4M 62000000 13583770  34095610  52804991
## 10          6        \200156.2M 73500000 13583770  34095610  52804991

¿Cuáles son las variables independientes y dependientes del caso y qué significan (b0 & b1)? La variable x es la variable independiente que es Overall donde tambien se conoce como b0 es la ordenada en el origen y la variable ‘y’ es Value que tambien es conocida como b1 que es la pendiente de la recta.

Cuál es valor del coeficiente de correlación R Square y R Square adjusted en el modelo?

En la parte del modelo en la segunda potencia se puede mostrar el valor de Rsquare y el Avanced RSquare en la tabla de resultados al final en donde dice la siguiente informacion.

Multiple R-squared: 0.7551, Adjusted R-squared: 0.7551 Por lo cual represanta que el Overall es el 75% predictorio en relacion al Value del jugador.

¿Cuál es el valor de b0 y b1 en la ecuación de regresión a la potencia 2, 3, 4 o 6? y=β0+β1xi2+β3xi3+…+βdxdin+ϵi

La regresion de potencia aumenta dependiendo de la potencia en donde la potencia numero 4. Da como resultado un 89%.

¿y qué significa? Significa que el modelo estima a mas RSquare dependiendo de la potencia ya que la interprectacion tiene cambios significativos.

Qué tan bien predice el modelo? El modelo mejora la prediccion porque se puede ajustar mas la potencia necesaria para la evaluacion de la correlacion entre las variables que se escogieron. Por lo que el grafico del modelo 4 tiene una exactitud muy diferente al modelo 2 eso hace que se pueda visualizar mejor en el modelo 4 la curva de una manera mas eficiente para identificar las predicciones.

Es el modelo de regresión lineal polinómico adecuado para predecir el valor económico del jugador basado únicamente en la variable Overall? ¿Que comparación se tienen con el modelo lineal en estas dos variables Overall y Value?

La comparacion es que por medio de la formula polinomial el valor de los predichos 2 y 4 cambian con mejor relacion a la Variable Value eso hace que se tenga un mejor acercamiento a la interpretacion de la relacion de un valor con otro.