Quarto Test

Wage Prediction of FIFA22 players

Figure 1 explores the impact of Value on Wage.

library(ggplot2)
library(dplyr)

players_orig <- read.csv("./../Datasets/FIFA22/players_22.csv")
players <- players_orig %>% sample_frac(0.01)

ggplot(data=players,
       mapping = aes(x=value_eur, y=wage_eur))+
  geom_point(color='cornflowerblue',
             alpha = 0.7,
             size=3)+
  geom_smooth(method = 'lm')

Figure 1: Wage versus Value of players

Using a linear regression model

The following figures show the fit of the model used to predict Wage.

M0 <- lm(wage_eur ~ value_eur+age+height_cm+weight_kg, data=players) 
summary(M0)

Call:
lm(formula = wage_eur ~ value_eur + age + height_cm + weight_kg, 
    data = players)

Residuals:
   Min     1Q Median     3Q    Max 
-97769  -4611  -1773    583  80193 

Coefficients:
              Estimate Std. Error t value Pr(>|t|)    
(Intercept) -2.206e+04  2.889e+04  -0.763  0.44623    
value_eur    1.909e-03  1.138e-04  16.777  < 2e-16 ***
age          6.097e+02  2.238e+02   2.724  0.00707 ** 
height_cm    1.870e+02  2.091e+02   0.894  0.37237    
weight_kg   -3.106e+02  2.125e+02  -1.462  0.14556    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 13870 on 185 degrees of freedom
  (2 observations deleted due to missingness)
Multiple R-squared:  0.6142,    Adjusted R-squared:  0.6059 
F-statistic: 73.64 on 4 and 185 DF,  p-value: < 2.2e-16
plot(M0)

Model fit

Model fit

Model fit

Model fit