This is an R Markdown Notebook. When you execute code within the notebook, the results appear beneath the code.
Try executing this chunk by clicking the Run button within the chunk or by placing your cursor inside it and pressing Cmd+Shift+Enter.
setwd("~/Dropbox/Evry/M1GENIOMHE/TP/TP1/")
The working directory was changed to /Users/agatheguilloux/Dropbox/Evry/M1GENIOMHE/TP/TP1 inside a notebook chunk. The working directory will be reset when the chunk is finished running. Use the knitr root.dir option in the setup chunk to change the the working directory for notebook chunks.
Cheat sheets : https://www.rstudio.com/wp-content/uploads/2015/02/data-wrangling-cheatsheet.pdf https://www.rstudio.com/wp-content/uploads/2015/03/ggplot2-cheatsheet.pdf
Récuperer les données https://archive.ics.uci.edu/ml/datasets/Student+Performance. ### Chargement des données
glimpse(data)
Observations: 201
Variables: 38
$ school <fctr> GP, GP, GP, GP, GP, GP,...
$ sex <fctr> F, F, M, F, F, M, F, F,...
$ age <int> 18, 17, 16, 17, 15, 15, ...
$ address <fctr> U, U, U, U, U, U, U, U,...
$ famsize <fctr> GT3, GT3, LE3, GT3, GT3...
$ Pstatus <fctr> A, T, T, A, T, A, T, T,...
$ Medu <int> 4, 1, 2, 4, 2, 2, 4, 3, ...
$ Fedu <int> 4, 1, 2, 4, 1, 2, 4, 3, ...
$ Mjob <fctr> at_home, at_home, other...
$ Fjob <fctr> teacher, other, other, ...
$ reason <fctr> course, course, home, h...
$ guardian <fctr> mother, father, mother,...
$ traveltime <int> 2, 1, 1, 2, 3, 1, 1, 3, ...
$ studytime <int> 2, 2, 2, 2, 3, 3, 1, 2, ...
$ failures.x <int> 0, 0, 0, 0, 0, 0, 0, 0, ...
$ schoolsup <fctr> yes, no, no, yes, no, n...
$ famsup <fctr> no, yes, no, yes, yes, ...
$ paid <fctr> no, no, no, no, no, no,...
$ activities <fctr> no, no, no, no, yes, no...
$ nursery <fctr> yes, no, yes, yes, yes,...
$ higher <fctr> yes, yes, yes, yes, yes...
$ internet <fctr> no, yes, yes, no, yes, ...
$ romantic <fctr> no, no, no, no, no, yes...
$ famrel <int> 4, 5, 4, 4, 5, 4, 4, 5, ...
$ freetime <int> 3, 3, 4, 1, 2, 5, 4, 3, ...
$ goout <int> 4, 3, 4, 4, 2, 2, 4, 2, ...
$ Dalc <int> 1, 1, 1, 1, 1, 1, 1, 1, ...
$ Walc <int> 1, 1, 1, 1, 1, 1, 2, 1, ...
$ health <int> 3, 3, 3, 1, 4, 3, 2, 4, ...
$ absences.x <int> 6, 4, 0, 6, 4, 0, 4, 4, ...
$ G1.x <int> 5, 5, 12, 6, 10, 14, 14,...
$ G2.x <int> 6, 5, 12, 5, 12, 16, 14,...
$ G3.x <int> 6, 6, 11, 6, 12, 16, 14,...
$ failures.y <int> 0, 0, 0, 0, 0, 0, 0, 0, ...
$ absences.y <int> 4, 2, 0, 2, 0, 0, 6, 2, ...
$ G1.y <int> 0, 9, 13, 10, 10, 14, 17...
$ G2.y <int> 11, 11, 12, 13, 12, 14, ...
$ G3.y <int> 11, 11, 13, 13, 13, 15, ...
data = mutate(data, Y = (G1.x+G2.x+G3.x+G1.y+G2.y+G3.y)/6)
data = select(data , - G1.x, -G2.x - G3.x - G1.y - G2.y -G3.y )
sex + age + address + famsize + Pstatus + Medu + Fjob + traveltime + failures.x + schoolsup + famsup + nursery + internet + romantic + freetime + goout + failures.y