Analyse des lycées franciliens

Library

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(tidyr)
library(ade4)
library(adegraphics)
## 
## Attaching package: 'adegraphics'
## 
## The following objects are masked from 'package:ade4':
## 
##     kplotsepan.coa, s.arrow, s.class, s.corcircle, s.distri,
##     s.image, s.label, s.logo, s.match, s.traject, s.value,
##     table.value, triangle.class
library(ggplot2)
## Warning: package 'ggplot2' was built under R version 3.2.2
library(foreign)
## Warning: package 'foreign' was built under R version 3.2.2
library(doBy)
## Warning: package 'doBy' was built under R version 3.2.2
## Loading required package: survival
mb5 <- read.csv("C:/Users/Antoine/Desktop/mb5.csv")
df <- mb5

Check

df2 <- na.omit(df)

head(df)
##   session  numetab                      patronyme   com   sensible
## 1    1997 0750105G COURS DU SOIR POUR ADULTES     75102        NON
## 2    1998 0750105G COURS DU SOIR POUR ADULTES     75102        NON
## 3    1999 0750105G COURS DU SOIR POUR ADULTES     75102        NON
## 4    2000 0750105G COURS DU SOIR POUR ADULTES     75102        NON
## 5    2001 0750105G COURS DU SOIR POUR ADULTES     75102 SANS OBJET
## 6    2002 0750105G COURS DU SOIR POUR ADULTES     75102 SANS OBJET
##         id_etab tot_inscrits    psucc p_cs1    p_cs2     p_cs3      p_cs4
## 1 0750105G_1997          111 44.14415     0 2.702703  1.801802  2.7027028
## 2 0750105G_1998          129 55.81395     0 3.875969 11.627907  0.7751938
## 3 0750105G_1999           99 55.55556     0 3.030303 12.121212  5.0505052
## 4 0750105G_2000           94 52.12766     0 2.127660 12.765958  0.0000000
## 5 0750105G_2001           80 48.75000     0 1.250000  7.500000  2.5000000
## 6 0750105G_2002           72 40.27778     0 6.944445  6.944445 11.1111110
##        p_cs5    p_cs6     p_cs7      p_cs8     p_cs9 cep   tx_btb cep2
## 1  0.9009009 0.000000 0.0000000  0.9009009 90.990990   0 2.040816    0
## 2  6.2015505 0.000000 0.7751938  2.3255813 74.418602   0 0.000000    0
## 3  6.0606060 4.040404 1.0101010  0.0000000 68.686867   0 0.000000    0
## 4  0.0000000 1.063830 1.0638298  1.0638298 81.914894   0 2.040816    0
## 5  2.5000000 5.000000 0.0000000  1.2500000 80.000000   0 2.564103    0
## 6 38.8888890 4.166666 0.0000000 25.0000000  6.944445   0 3.448276    0
##   depa    ps_es     ps_l     ps_s tx_btb_es tx_btb_l tx_btb_s
## 1   75 33.33333 53.84615 44.44444   0.00000 4.761905        0
## 2   75 59.52381 61.36364 46.51163   0.00000 0.000000        0
## 3   75 48.48485 61.29032 57.14286   0.00000 0.000000        0
## 4   75 60.71429 45.45454 51.51515   0.00000 6.666666        0
## 5   75 36.00000 61.53846 48.27586   0.00000 6.250000        0
## 6   75 34.61538 58.33333 27.27273  11.11111 0.000000        0
head(df2)
##   session  numetab                      patronyme   com   sensible
## 1    1997 0750105G COURS DU SOIR POUR ADULTES     75102        NON
## 2    1998 0750105G COURS DU SOIR POUR ADULTES     75102        NON
## 3    1999 0750105G COURS DU SOIR POUR ADULTES     75102        NON
## 4    2000 0750105G COURS DU SOIR POUR ADULTES     75102        NON
## 5    2001 0750105G COURS DU SOIR POUR ADULTES     75102 SANS OBJET
## 6    2002 0750105G COURS DU SOIR POUR ADULTES     75102 SANS OBJET
##         id_etab tot_inscrits    psucc p_cs1    p_cs2     p_cs3      p_cs4
## 1 0750105G_1997          111 44.14415     0 2.702703  1.801802  2.7027028
## 2 0750105G_1998          129 55.81395     0 3.875969 11.627907  0.7751938
## 3 0750105G_1999           99 55.55556     0 3.030303 12.121212  5.0505052
## 4 0750105G_2000           94 52.12766     0 2.127660 12.765958  0.0000000
## 5 0750105G_2001           80 48.75000     0 1.250000  7.500000  2.5000000
## 6 0750105G_2002           72 40.27778     0 6.944445  6.944445 11.1111110
##        p_cs5    p_cs6     p_cs7      p_cs8     p_cs9 cep   tx_btb cep2
## 1  0.9009009 0.000000 0.0000000  0.9009009 90.990990   0 2.040816    0
## 2  6.2015505 0.000000 0.7751938  2.3255813 74.418602   0 0.000000    0
## 3  6.0606060 4.040404 1.0101010  0.0000000 68.686867   0 0.000000    0
## 4  0.0000000 1.063830 1.0638298  1.0638298 81.914894   0 2.040816    0
## 5  2.5000000 5.000000 0.0000000  1.2500000 80.000000   0 2.564103    0
## 6 38.8888890 4.166666 0.0000000 25.0000000  6.944445   0 3.448276    0
##   depa    ps_es     ps_l     ps_s tx_btb_es tx_btb_l tx_btb_s
## 1   75 33.33333 53.84615 44.44444   0.00000 4.761905        0
## 2   75 59.52381 61.36364 46.51163   0.00000 0.000000        0
## 3   75 48.48485 61.29032 57.14286   0.00000 0.000000        0
## 4   75 60.71429 45.45454 51.51515   0.00000 6.666666        0
## 5   75 36.00000 61.53846 48.27586   0.00000 6.250000        0
## 6   75 34.61538 58.33333 27.27273  11.11111 0.000000        0

Formatting

df$session <- as.factor(df$session)
df$cep2    <- as.factor(df$cep2)
df$cep     <- as.factor(df$cep)
df$depa    <- as.factor(df$depa)

Sorting

attach(df)

df2 <- df[order(id_etab),]
dcs <- df2

Subset

df97 <- filter(df, session=="1997")
df98 <- filter(df, session=="1998")
df99 <- filter(df, session=="1999")
df00 <- filter(df, session=="2000")
df01 <- filter(df, session=="2001")
df02 <- filter(df, session=="2002")
df03 <- filter(df, session=="2003")
df04 <- filter(df, session=="2004")
df05 <- filter(df, session=="2005")
df06 <- filter(df, session=="2006")
df07 <- filter(df, session=="2007")
df08 <- filter(df, session=="2008")
df09 <- filter(df, session=="2009")
df10 <- filter(df, session=="2010")
df11 <- filter(df, session=="2011")
df12 <- filter(df, session=="2012")
df13 <- filter(df, session=="2013")
df14 <- filter(df, session=="2014")

Selection

df97s <- select(df97, p_cs2, p_cs3, p_cs4, p_cs5, p_cs6, p_cs7, p_cs8, p_cs9 , psucc, tx_btb)
df98s <- select(df98, p_cs2, p_cs3, p_cs4, p_cs5, p_cs6, p_cs7, p_cs8, p_cs9 , psucc, tx_btb)
df99s <- select(df99, p_cs2, p_cs3, p_cs4, p_cs5, p_cs6, p_cs7, p_cs8, p_cs9 , psucc, tx_btb)
df00s <- select(df00, p_cs2, p_cs3, p_cs4, p_cs5, p_cs6, p_cs7, p_cs8, p_cs9 , psucc, tx_btb)
df01s <- select(df01, p_cs2, p_cs3, p_cs4, p_cs5, p_cs6, p_cs7, p_cs8, p_cs9 , psucc, tx_btb)
df02s <- select(df02, p_cs2, p_cs3, p_cs4, p_cs5, p_cs6, p_cs7, p_cs8, p_cs9 , psucc, tx_btb)
df03s <- select(df03, p_cs2, p_cs3, p_cs4, p_cs5, p_cs6, p_cs7, p_cs8, p_cs9 , psucc, tx_btb)
df04s <- select(df04, p_cs2, p_cs3, p_cs4, p_cs5, p_cs6, p_cs7, p_cs8, p_cs9 , psucc, tx_btb)
df05s <- select(df05, p_cs2, p_cs3, p_cs4, p_cs5, p_cs6, p_cs7, p_cs8, p_cs9 , psucc, tx_btb)
df06s <- select(df06, p_cs2, p_cs3, p_cs4, p_cs5, p_cs6, p_cs7, p_cs8, p_cs9 , psucc, tx_btb)
df07s <- select(df07, p_cs2, p_cs3, p_cs4, p_cs5, p_cs6, p_cs7, p_cs8, p_cs9 , psucc, tx_btb)
df08s <- select(df08, p_cs2, p_cs3, p_cs4, p_cs5, p_cs6, p_cs7, p_cs8, p_cs9 , psucc, tx_btb)
df09s <- select(df09, p_cs2, p_cs3, p_cs4, p_cs5, p_cs6, p_cs7, p_cs8, p_cs9 , psucc, tx_btb)
df10s <- select(df10, p_cs2, p_cs3, p_cs4, p_cs5, p_cs6, p_cs7, p_cs8, p_cs9 , psucc, tx_btb)
df11s <- select(df11, p_cs2, p_cs3, p_cs4, p_cs5, p_cs6, p_cs7, p_cs8, p_cs9 , psucc, tx_btb)
df12s <- select(df12, p_cs2, p_cs3, p_cs4, p_cs5, p_cs6, p_cs7, p_cs8, p_cs9 , psucc, tx_btb)
df13s <- select(df13, p_cs2, p_cs3, p_cs4, p_cs5, p_cs6, p_cs7, p_cs8, p_cs9 , psucc, tx_btb)
df14s <- select(df14, p_cs2, p_cs3, p_cs4, p_cs5, p_cs6, p_cs7, p_cs8, p_cs9 , psucc, tx_btb)
df97i <- select(df97, p_cs2, p_cs3, p_cs4, p_cs5, p_cs6, p_cs7, p_cs8, p_cs9 )
df98i <- select(df98, p_cs2, p_cs3, p_cs4, p_cs5, p_cs6, p_cs7, p_cs8, p_cs9 )
df99i <- select(df99, p_cs2, p_cs3, p_cs4, p_cs5, p_cs6, p_cs7, p_cs8, p_cs9 )
df00i <- select(df00, p_cs2, p_cs3, p_cs4, p_cs5, p_cs6, p_cs7, p_cs8, p_cs9 )
df01i <- select(df01, p_cs2, p_cs3, p_cs4, p_cs5, p_cs6, p_cs7, p_cs8, p_cs9 )
df02i <- select(df02, p_cs2, p_cs3, p_cs4, p_cs5, p_cs6, p_cs7, p_cs8, p_cs9 )
df03i <- select(df03, p_cs2, p_cs3, p_cs4, p_cs5, p_cs6, p_cs7, p_cs8, p_cs9 )
df04i <- select(df04, p_cs2, p_cs3, p_cs4, p_cs5, p_cs6, p_cs7, p_cs8, p_cs9 )
df05i <- select(df05, p_cs2, p_cs3, p_cs4, p_cs5, p_cs6, p_cs7, p_cs8, p_cs9 )
df06i <- select(df06, p_cs2, p_cs3, p_cs4, p_cs5, p_cs6, p_cs7, p_cs8, p_cs9 )
df07i <- select(df07, p_cs2, p_cs3, p_cs4, p_cs5, p_cs6, p_cs7, p_cs8, p_cs9 )
df08i <- select(df08, p_cs2, p_cs3, p_cs4, p_cs5, p_cs6, p_cs7, p_cs8, p_cs9 )
df09i <- select(df09, p_cs2, p_cs3, p_cs4, p_cs5, p_cs6, p_cs7, p_cs8, p_cs9 )
df10i <- select(df10, p_cs2, p_cs3, p_cs4, p_cs5, p_cs6, p_cs7, p_cs8, p_cs9 )
df11i <- select(df11, p_cs2, p_cs3, p_cs4, p_cs5, p_cs6, p_cs7, p_cs8, p_cs9 )
df12i <- select(df12, p_cs2, p_cs3, p_cs4, p_cs5, p_cs6, p_cs7, p_cs8, p_cs9 )
df13i <- select(df13, p_cs2, p_cs3, p_cs4, p_cs5, p_cs6, p_cs7, p_cs8, p_cs9 )
df14i <- select(df14, p_cs2, p_cs3, p_cs4, p_cs5, p_cs6, p_cs7, p_cs8, p_cs9 )

Scaling

wdf97 <- data.frame(scalewt(df97i, wt=df97$tot_inscrits))
wdf98 <- data.frame(scalewt(df98i, wt=df98$tot_inscrits))
wdf99 <- data.frame(scalewt(df99i, wt=df99$tot_inscrits))
wdf00 <- data.frame(scalewt(df00i, wt=df00$tot_inscrits))
wdf01 <- data.frame(scalewt(df01i, wt=df01$tot_inscrits))
wdf02 <- data.frame(scalewt(df02i, wt=df02$tot_inscrits))
wdf03 <- data.frame(scalewt(df03i, wt=df03$tot_inscrits))
wdf04 <- data.frame(scalewt(df04i, wt=df04$tot_inscrits))
wdf05 <- data.frame(scalewt(df05i, wt=df05$tot_inscrits))
wdf06 <- data.frame(scalewt(df06i, wt=df06$tot_inscrits))
wdf07 <- data.frame(scalewt(df07i, wt=df07$tot_inscrits))
wdf08 <- data.frame(scalewt(df08i, wt=df08$tot_inscrits))
wdf09 <- data.frame(scalewt(df09i, wt=df09$tot_inscrits))
wdf10 <- data.frame(scalewt(df10i, wt=df10$tot_inscrits))
wdf11 <- data.frame(scalewt(df11i, wt=df11$tot_inscrits))
wdf12 <- data.frame(scalewt(df12i, wt=df12$tot_inscrits))
wdf13 <- data.frame(scalewt(df13i, wt=df13$tot_inscrits))
wdf14 <- data.frame(scalewt(df14i, wt=df14$tot_inscrits))
wdf97x <- data.frame(scalewt(df97s, wt=df97$tot_inscrits))
wdf98x <- data.frame(scalewt(df98s, wt=df98$tot_inscrits))
wdf99x <- data.frame(scalewt(df99s, wt=df99$tot_inscrits))
wdf00x <- data.frame(scalewt(df00s, wt=df00$tot_inscrits))
wdf01x <- data.frame(scalewt(df01s, wt=df01$tot_inscrits))
wdf02x <- data.frame(scalewt(df02s, wt=df02$tot_inscrits))
wdf03x <- data.frame(scalewt(df03s, wt=df03$tot_inscrits))
wdf04x <- data.frame(scalewt(df04s, wt=df04$tot_inscrits))
wdf05x <- data.frame(scalewt(df05s, wt=df05$tot_inscrits))
wdf06x <- data.frame(scalewt(df06s, wt=df06$tot_inscrits))
wdf07x <- data.frame(scalewt(df07s, wt=df07$tot_inscrits))
wdf08x <- data.frame(scalewt(df08s, wt=df08$tot_inscrits))
wdf09x <- data.frame(scalewt(df09s, wt=df09$tot_inscrits))
wdf10x <- data.frame(scalewt(df10s, wt=df10$tot_inscrits))
wdf11x <- data.frame(scalewt(df11s, wt=df11$tot_inscrits))
wdf12x <- data.frame(scalewt(df12s, wt=df12$tot_inscrits))
wdf13x <- data.frame(scalewt(df13s, wt=df13$tot_inscrits))
wdf14x <- data.frame(scalewt(df14s, wt=df14$tot_inscrits))

Labelling

row.names(wdf97x) <- df97$numetab
row.names(wdf98x) <- df98$numetab
row.names(wdf99x) <- df99$numetab
row.names(wdf00x) <- df00$numetab
row.names(wdf01x) <- df01$numetab
row.names(wdf02x) <- df02$numetab
row.names(wdf03x) <- df03$numetab
row.names(wdf04x) <- df04$numetab
row.names(wdf05x) <- df05$numetab
row.names(wdf06x) <- df06$numetab
row.names(wdf07x) <- df07$numetab
row.names(wdf08x) <- df08$numetab
row.names(wdf09x) <- df09$numetab
row.names(wdf10x) <- df10$numetab
row.names(wdf11x) <- df11$numetab
row.names(wdf12x) <- df12$numetab
row.names(wdf13x) <- df13$numetab
row.names(wdf14x) <- df14$numetab
row.names(wdf97) <- df97$numetab
row.names(wdf98) <- df98$numetab
row.names(wdf99) <- df99$numetab
row.names(wdf00) <- df00$numetab
row.names(wdf01) <- df01$numetab
row.names(wdf02) <- df02$numetab
row.names(wdf03) <- df03$numetab
row.names(wdf04) <- df04$numetab
row.names(wdf05) <- df05$numetab
row.names(wdf06) <- df06$numetab
row.names(wdf07) <- df07$numetab
row.names(wdf08) <- df08$numetab
row.names(wdf09) <- df09$numetab
row.names(wdf10) <- df10$numetab
row.names(wdf11) <- df11$numetab
row.names(wdf12) <- df12$numetab
row.names(wdf13) <- df13$numetab
row.names(wdf14) <- df14$numetab

Making K-Tab

lwdfx <- list(wdf97x, wdf98x, wdf99x, wdf00x, wdf01x, wdf02x, wdf03x, wdf04x, wdf05x, wdf06x, wdf07x, wdf08x, wdf09x, wdf10x, wdf11x, wdf12x, wdf13x, wdf14x)

kwdfx <- ktab.list.df(lwdfx)
lwdf <- list(wdf97, wdf98, wdf99, wdf00, wdf01, wdf02, wdf03, wdf04, wdf05, wdf06, wdf07, wdf08, wdf09, wdf10, wdf11, wdf12, wdf13, wdf14)

kwdf <- ktab.list.df(lwdf)

K - tables analysis (dfx : socio-scolaire)

K - tables analysis

  1. PTA
ptakwdfx <- pta(kwdfx, scannf = FALSE, nf=2)

plot(ptakwdfx)
s.class(ptakwdfx$Tli, df$numetab, col=rainbow(100))
s.traject(ptakwdfx$Tli, df$numetab, col=rainbow(100))
  1. MFA
mfakwdfx <- mfa(kwdfx, scannf = FALSE, nf=2)

plot(mfakwdfx)