library(readxl)
library(flextable)
library(corrplot)
## corrplot 0.92 loaded
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
FifaData <- read_csv("C:/Users/Marcos/Desktop/Base_de_dados-master/FifaData.csv")
## Rows: 17588 Columns: 53
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (12): Name, Nationality, National_Position, Club, Club_Position, Club_Jo...
## dbl (41): National_Kit, Club_Kit, Contract_Expiry, Rating, Age, Weak_foot, S...
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
View(FifaData)
library(flextable)
head(FifaData) %>% flextable()
Name | Nationality | National_Position | National_Kit | Club | Club_Position | Club_Kit | Club_Joining | Contract_Expiry | Rating | Height | Weight | Preffered_Foot | Birth_Date | Age | Preffered_Position | Work_Rate | Weak_foot | Skill_Moves | Ball_Control | Dribbling | Marking | Sliding_Tackle | Standing_Tackle | Aggression | Reactions | Attacking_Position | Interceptions | Vision | Composure | Crossing | Short_Pass | Long_Pass | Acceleration | Speed | Stamina | Strength | Balance | Agility | Jumping | Heading | Shot_Power | Finishing | Long_Shots | Curve | Freekick_Accuracy | Penalties | Volleys | GK_Positioning | GK_Diving | GK_Kicking | GK_Handling | GK_Reflexes |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Cristiano Ronaldo | Portugal | LS | 7 | Real Madrid | LW | 7 | 07/01/2009 | 2,021 | 94 | 185 cm | 80 kg | Right | 02/05/1985 | 32 | LW/ST | High / Low | 4 | 5 | 93 | 92 | 22 | 23 | 31 | 63 | 96 | 94 | 29 | 85 | 86 | 84 | 83 | 77 | 91 | 92 | 92 | 80 | 63 | 90 | 95 | 85 | 92 | 93 | 90 | 81 | 76 | 85 | 88 | 14 | 7 | 15 | 11 | 11 |
Lionel Messi | Argentina | RW | 10 | FC Barcelona | RW | 10 | 07/01/2004 | 2,018 | 93 | 170 cm | 72 kg | Left | 06/24/1987 | 29 | RW | Medium / Medium | 4 | 4 | 95 | 97 | 13 | 26 | 28 | 48 | 95 | 93 | 22 | 90 | 94 | 77 | 88 | 87 | 92 | 87 | 74 | 59 | 95 | 90 | 68 | 71 | 85 | 95 | 88 | 89 | 90 | 74 | 85 | 14 | 6 | 15 | 11 | 8 |
Neymar | Brazil | LW | 10 | FC Barcelona | LW | 11 | 07/01/2013 | 2,021 | 92 | 174 cm | 68 kg | Right | 02/05/1992 | 25 | LW | High / Medium | 5 | 5 | 95 | 96 | 21 | 33 | 24 | 56 | 88 | 90 | 36 | 80 | 80 | 75 | 81 | 75 | 93 | 90 | 79 | 49 | 82 | 96 | 61 | 62 | 78 | 89 | 77 | 79 | 84 | 81 | 83 | 15 | 9 | 15 | 9 | 11 |
Luis Suárez | Uruguay | LS | 9 | FC Barcelona | ST | 9 | 07/11/2014 | 2,021 | 92 | 182 cm | 85 kg | Right | 01/24/1987 | 30 | ST | High / Medium | 4 | 4 | 91 | 86 | 30 | 38 | 45 | 78 | 93 | 92 | 41 | 84 | 83 | 77 | 83 | 64 | 88 | 77 | 89 | 76 | 60 | 86 | 69 | 77 | 87 | 94 | 86 | 86 | 84 | 85 | 88 | 33 | 27 | 31 | 25 | 37 |
Manuel Neuer | Germany | GK | 1 | FC Bayern | GK | 1 | 07/01/2011 | 2,021 | 92 | 193 cm | 92 kg | Right | 03/27/1986 | 31 | GK | Medium / Medium | 4 | 1 | 48 | 30 | 10 | 11 | 10 | 29 | 85 | 12 | 30 | 70 | 70 | 15 | 55 | 59 | 58 | 61 | 44 | 83 | 35 | 52 | 78 | 25 | 25 | 13 | 16 | 14 | 11 | 47 | 11 | 91 | 89 | 95 | 90 | 89 |
De Gea | Spain | GK | 1 | Manchester Utd | GK | 1 | 07/01/2011 | 2,019 | 90 | 193 cm | 82 kg | Right | 11/07/1990 | 26 | GK | Medium / Medium | 3 | 1 | 31 | 13 | 13 | 13 | 21 | 38 | 88 | 12 | 30 | 68 | 60 | 17 | 31 | 32 | 56 | 56 | 25 | 64 | 43 | 57 | 67 | 21 | 31 | 13 | 12 | 21 | 19 | 40 | 13 | 86 | 88 | 87 | 85 | 90 |
plot(FifaData$Speed,FifaData$Rating, col="orange",
pch=19,main="Diagrama de dispersão",
xlab="Velocidade",
ylab="Nota")
abline(lsfit(FifaData$Speed,FifaData$Rating),col="purple")
cor(FifaData$Speed,FifaData$Rating)
## [1] 0.2242124
library(corrplot)
FifaData %>% select(Rating,Acceleration,Speed,Agility,Stamina,Balance) %>%
cor() %>% corrplot(method = "circle")
A base de dados utilizada para o relatório de hoje é a FifaData. Essa base de dados possui 41 variáveis quantitativas e 8 variáveis qualitativas. A avaliação que foi realizada aborda a relação entre as variáveis Velocidade e Nota. A hipótese levantada a respeito de tais variáveis foi a seguinte: qual é o impacto da velocidade dos jogadores na nota final?
A partir do diagrama de dispersão e do índice de correlação podemos ver que as duas variáveis possuem uma correlação positiva e muito fraca, uma vez que há muita dispersão no diagrama e seu nível de correlação é apenas de 0,22. Analisando a matriz de correlação, é possível concluir que entre as varíaveis que estão relacionadas com habilidades dos jogadores, não existe uma correlação muito forte delas com a variável nota. Portanto, a hipótese levantada é falsa.