Bibliotecas

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(corrplot)
corrplot 0.90 loaded
library(rio)

Base de dados

library(readxl)
Questionario_Estresse <- read_excel("C:/Users/brenda/Downloads/Base_de_dados-master/Base_de_dados-master/Questionario_Estresse.xls")
View(Questionario_Estresse)
library(readr)
FifaData <- read_csv("C:/Users/brenda/Downloads/Base_de_dados-master/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...

i Use `spec()` to retrieve the full column specification for this data.
i Specify the column types or set `show_col_types = FALSE` to quiet this message.
head(FifaData)
# A tibble: 6 x 53
  Name    Nationality National_Positi~ National_Kit Club  Club_Position Club_Kit
  <chr>   <chr>       <chr>                   <dbl> <chr> <chr>            <dbl>
1 Cristi~ Portugal    LS                          7 Real~ LW                   7
2 Lionel~ Argentina   RW                         10 FC B~ RW                  10
3 Neymar  Brazil      LW                         10 FC B~ LW                  11
4 Luis S~ Uruguay     LS                          9 FC B~ ST                   9
5 Manuel~ Germany     GK                          1 FC B~ GK                   1
6 De Gea  Spain       GK                          1 Manc~ GK                   1
# ... with 46 more variables: Club_Joining <chr>, Contract_Expiry <dbl>,
#   Rating <dbl>, Height <chr>, Weight <chr>, Preffered_Foot <chr>,
#   Birth_Date <chr>, Age <dbl>, Preffered_Position <chr>, Work_Rate <chr>,
#   Weak_foot <dbl>, Skill_Moves <dbl>, Ball_Control <dbl>, Dribbling <dbl>,
#   Marking <dbl>, Sliding_Tackle <dbl>, Standing_Tackle <dbl>,
#   Aggression <dbl>, Reactions <dbl>, Attacking_Position <dbl>,
#   Interceptions <dbl>, Vision <dbl>, Composure <dbl>, Crossing <dbl>, ...
View(FifaData)

Passo 2 - Diagrama de dispersão

Duas variáveis quantitativas

par(bg="lightyellow")
plot(Questionario_Estresse$Desempenho, Questionario_Estresse$Horas_estudo,pch=19,col="black",
     main = "Gráfico 1 - Questionário", ylab = "Horas de estudo",
     xlab = "Desempenho")

# Correlação Positiva muito fraca

abline(a=NULL, b=NULL)
abline(lsfit(Questionario_Estresse$Desempenho,Questionario_Estresse$Horas_estudo),col="red")

cor(Questionario_Estresse$Horas_estudo,Questionario_Estresse$Desempenho)
[1] 0.2231532

Matriz de Correlação

names(Questionario_Estresse)
 [1] "Aluno"        "Turma"        "Mora_pais"    "RJ"           "Namorado_a"  
 [6] "Trabalha"     "Desempenho"   "Estresse"     "Créditos"     "Horas_estudo"
Mc <- Questionario_Estresse %>% select(Desempenho,Estresse,
                                       Horas_estudo) %>% cor()
Mc
             Desempenho   Estresse Horas_estudo
Desempenho   1.00000000 0.08257246    0.2231532
Estresse     0.08257246 1.00000000    0.3039170
Horas_estudo 0.22315316 0.30391699    1.0000000
par(bg="#cccaca")
corrplot(Mc)

corrplot.mixed(Mc)