INTRODUCCIÓN
La deserción estudiantil representa un desafío crítico para las instituciones educativas. Comprender qué factores están asociados al abandono puede ayudar a implementar políticas de apoyo académico más efectivas.
Este análisis tiene como objetivo explorar un conjunto de datos reales de estudiantes, identificando posibles patrones y variables que influyen en la deserción, con especial énfasis en el rendimiento académico previo.
EXPLORACION Y LIMPIEZA DE DATOS
Carga de Datos
# Cargar archivo CSV con separador ";"
data <- read.csv("data.csv", sep = ";")
# Vista general de los primeros registros
head(data)
Estructura y Resumen
# Estructura de los datos
str(data)
## 'data.frame': 4424 obs. of 37 variables:
## $ Marital.status : int 1 1 1 1 2 2 1 1 1 1 ...
## $ Application.mode : int 17 15 1 17 39 39 1 18 1 1 ...
## $ Application.order : int 5 1 5 2 1 1 1 4 3 1 ...
## $ Course : int 171 9254 9070 9773 8014 9991 9500 9254 9238 9238 ...
## $ Daytime.evening.attendance. : int 1 1 1 1 0 0 1 1 1 1 ...
## $ Previous.qualification : int 1 1 1 1 1 19 1 1 1 1 ...
## $ Previous.qualification..grade. : num 122 160 122 122 100 ...
## $ Nacionality : int 1 1 1 1 1 1 1 1 62 1 ...
## $ Mother.s.qualification : int 19 1 37 38 37 37 19 37 1 1 ...
## $ Father.s.qualification : int 12 3 37 37 38 37 38 37 1 19 ...
## $ Mother.s.occupation : int 5 3 9 5 9 9 7 9 9 4 ...
## $ Father.s.occupation : int 9 3 9 3 9 7 10 9 9 7 ...
## $ Admission.grade : num 127 142 125 120 142 ...
## $ Displaced : int 1 1 1 1 0 0 1 1 0 1 ...
## $ Educational.special.needs : int 0 0 0 0 0 0 0 0 0 0 ...
## $ Debtor : int 0 0 0 0 0 1 0 0 0 1 ...
## $ Tuition.fees.up.to.date : int 1 0 0 1 1 1 1 0 1 0 ...
## $ Gender : int 1 1 1 0 0 1 0 1 0 0 ...
## $ Scholarship.holder : int 0 0 0 0 0 0 1 0 1 0 ...
## $ Age.at.enrollment : int 20 19 19 20 45 50 18 22 21 18 ...
## $ International : int 0 0 0 0 0 0 0 0 1 0 ...
## $ Curricular.units.1st.sem..credited. : int 0 0 0 0 0 0 0 0 0 0 ...
## $ Curricular.units.1st.sem..enrolled. : int 0 6 6 6 6 5 7 5 6 6 ...
## $ Curricular.units.1st.sem..evaluations. : int 0 6 0 8 9 10 9 5 8 9 ...
## $ Curricular.units.1st.sem..approved. : int 0 6 0 6 5 5 7 0 6 5 ...
## $ Curricular.units.1st.sem..grade. : num 0 14 0 13.4 12.3 ...
## $ Curricular.units.1st.sem..without.evaluations.: int 0 0 0 0 0 0 0 0 0 0 ...
## $ Curricular.units.2nd.sem..credited. : int 0 0 0 0 0 0 0 0 0 0 ...
## $ Curricular.units.2nd.sem..enrolled. : int 0 6 6 6 6 5 8 5 6 6 ...
## $ Curricular.units.2nd.sem..evaluations. : int 0 6 0 10 6 17 8 5 7 14 ...
## $ Curricular.units.2nd.sem..approved. : int 0 6 0 5 6 5 8 0 6 2 ...
## $ Curricular.units.2nd.sem..grade. : num 0 13.7 0 12.4 13 ...
## $ Curricular.units.2nd.sem..without.evaluations.: int 0 0 0 0 0 5 0 0 0 0 ...
## $ Unemployment.rate : num 10.8 13.9 10.8 9.4 13.9 16.2 15.5 15.5 16.2 8.9 ...
## $ Inflation.rate : num 1.4 -0.3 1.4 -0.8 -0.3 0.3 2.8 2.8 0.3 1.4 ...
## $ GDP : num 1.74 0.79 1.74 -3.12 0.79 -0.92 -4.06 -4.06 -0.92 3.51 ...
## $ Target : chr "Dropout" "Graduate" "Dropout" "Graduate" ...
# Estadísticas generales
summary(data)
## Marital.status Application.mode Application.order Course
## Min. :1.000 Min. : 1.00 Min. :0.000 Min. : 33
## 1st Qu.:1.000 1st Qu.: 1.00 1st Qu.:1.000 1st Qu.:9085
## Median :1.000 Median :17.00 Median :1.000 Median :9238
## Mean :1.179 Mean :18.67 Mean :1.728 Mean :8857
## 3rd Qu.:1.000 3rd Qu.:39.00 3rd Qu.:2.000 3rd Qu.:9556
## Max. :6.000 Max. :57.00 Max. :9.000 Max. :9991
## Daytime.evening.attendance. Previous.qualification
## Min. :0.0000 Min. : 1.000
## 1st Qu.:1.0000 1st Qu.: 1.000
## Median :1.0000 Median : 1.000
## Mean :0.8908 Mean : 4.578
## 3rd Qu.:1.0000 3rd Qu.: 1.000
## Max. :1.0000 Max. :43.000
## Previous.qualification..grade. Nacionality Mother.s.qualification
## Min. : 95.0 Min. : 1.000 Min. : 1.00
## 1st Qu.:125.0 1st Qu.: 1.000 1st Qu.: 2.00
## Median :133.1 Median : 1.000 Median :19.00
## Mean :132.6 Mean : 1.873 Mean :19.56
## 3rd Qu.:140.0 3rd Qu.: 1.000 3rd Qu.:37.00
## Max. :190.0 Max. :109.000 Max. :44.00
## Father.s.qualification Mother.s.occupation Father.s.occupation Admission.grade
## Min. : 1.00 Min. : 0.00 Min. : 0.00 Min. : 95.0
## 1st Qu.: 3.00 1st Qu.: 4.00 1st Qu.: 4.00 1st Qu.:117.9
## Median :19.00 Median : 5.00 Median : 7.00 Median :126.1
## Mean :22.28 Mean : 10.96 Mean : 11.03 Mean :127.0
## 3rd Qu.:37.00 3rd Qu.: 9.00 3rd Qu.: 9.00 3rd Qu.:134.8
## Max. :44.00 Max. :194.00 Max. :195.00 Max. :190.0
## Displaced Educational.special.needs Debtor
## Min. :0.0000 Min. :0.00000 Min. :0.0000
## 1st Qu.:0.0000 1st Qu.:0.00000 1st Qu.:0.0000
## Median :1.0000 Median :0.00000 Median :0.0000
## Mean :0.5484 Mean :0.01153 Mean :0.1137
## 3rd Qu.:1.0000 3rd Qu.:0.00000 3rd Qu.:0.0000
## Max. :1.0000 Max. :1.00000 Max. :1.0000
## Tuition.fees.up.to.date Gender Scholarship.holder Age.at.enrollment
## Min. :0.0000 Min. :0.0000 Min. :0.0000 Min. :17.00
## 1st Qu.:1.0000 1st Qu.:0.0000 1st Qu.:0.0000 1st Qu.:19.00
## Median :1.0000 Median :0.0000 Median :0.0000 Median :20.00
## Mean :0.8807 Mean :0.3517 Mean :0.2484 Mean :23.27
## 3rd Qu.:1.0000 3rd Qu.:1.0000 3rd Qu.:0.0000 3rd Qu.:25.00
## Max. :1.0000 Max. :1.0000 Max. :1.0000 Max. :70.00
## International Curricular.units.1st.sem..credited.
## Min. :0.00000 Min. : 0.00
## 1st Qu.:0.00000 1st Qu.: 0.00
## Median :0.00000 Median : 0.00
## Mean :0.02486 Mean : 0.71
## 3rd Qu.:0.00000 3rd Qu.: 0.00
## Max. :1.00000 Max. :20.00
## Curricular.units.1st.sem..enrolled. Curricular.units.1st.sem..evaluations.
## Min. : 0.000 Min. : 0.000
## 1st Qu.: 5.000 1st Qu.: 6.000
## Median : 6.000 Median : 8.000
## Mean : 6.271 Mean : 8.299
## 3rd Qu.: 7.000 3rd Qu.:10.000
## Max. :26.000 Max. :45.000
## Curricular.units.1st.sem..approved. Curricular.units.1st.sem..grade.
## Min. : 0.000 Min. : 0.00
## 1st Qu.: 3.000 1st Qu.:11.00
## Median : 5.000 Median :12.29
## Mean : 4.707 Mean :10.64
## 3rd Qu.: 6.000 3rd Qu.:13.40
## Max. :26.000 Max. :18.88
## Curricular.units.1st.sem..without.evaluations.
## Min. : 0.0000
## 1st Qu.: 0.0000
## Median : 0.0000
## Mean : 0.1377
## 3rd Qu.: 0.0000
## Max. :12.0000
## Curricular.units.2nd.sem..credited. Curricular.units.2nd.sem..enrolled.
## Min. : 0.0000 Min. : 0.000
## 1st Qu.: 0.0000 1st Qu.: 5.000
## Median : 0.0000 Median : 6.000
## Mean : 0.5418 Mean : 6.232
## 3rd Qu.: 0.0000 3rd Qu.: 7.000
## Max. :19.0000 Max. :23.000
## Curricular.units.2nd.sem..evaluations. Curricular.units.2nd.sem..approved.
## Min. : 0.000 Min. : 0.000
## 1st Qu.: 6.000 1st Qu.: 2.000
## Median : 8.000 Median : 5.000
## Mean : 8.063 Mean : 4.436
## 3rd Qu.:10.000 3rd Qu.: 6.000
## Max. :33.000 Max. :20.000
## Curricular.units.2nd.sem..grade.
## Min. : 0.00
## 1st Qu.:10.75
## Median :12.20
## Mean :10.23
## 3rd Qu.:13.33
## Max. :18.57
## Curricular.units.2nd.sem..without.evaluations. Unemployment.rate
## Min. : 0.0000 Min. : 7.60
## 1st Qu.: 0.0000 1st Qu.: 9.40
## Median : 0.0000 Median :11.10
## Mean : 0.1503 Mean :11.57
## 3rd Qu.: 0.0000 3rd Qu.:13.90
## Max. :12.0000 Max. :16.20
## Inflation.rate GDP Target
## Min. :-0.800 Min. :-4.060000 Length:4424
## 1st Qu.: 0.300 1st Qu.:-1.700000 Class :character
## Median : 1.400 Median : 0.320000 Mode :character
## Mean : 1.228 Mean : 0.001969
## 3rd Qu.: 2.600 3rd Qu.: 1.790000
## Max. : 3.700 Max. : 3.510000
Revisión de valores NA
# Recuento de valores NA por columna
total_na <- colSums(is.na(data))
kable(as.data.frame(total_na), caption = "Valores faltantes por columna")
| total_na | |
|---|---|
| Marital.status | 0 |
| Application.mode | 0 |
| Application.order | 0 |
| Course | 0 |
| Daytime.evening.attendance. | 0 |
| Previous.qualification | 0 |
| Previous.qualification..grade. | 0 |
| Nacionality | 0 |
| Mother.s.qualification | 0 |
| Father.s.qualification | 0 |
| Mother.s.occupation | 0 |
| Father.s.occupation | 0 |
| Admission.grade | 0 |
| Displaced | 0 |
| Educational.special.needs | 0 |
| Debtor | 0 |
| Tuition.fees.up.to.date | 0 |
| Gender | 0 |
| Scholarship.holder | 0 |
| Age.at.enrollment | 0 |
| International | 0 |
| Curricular.units.1st.sem..credited. | 0 |
| Curricular.units.1st.sem..enrolled. | 0 |
| Curricular.units.1st.sem..evaluations. | 0 |
| Curricular.units.1st.sem..approved. | 0 |
| Curricular.units.1st.sem..grade. | 0 |
| Curricular.units.1st.sem..without.evaluations. | 0 |
| Curricular.units.2nd.sem..credited. | 0 |
| Curricular.units.2nd.sem..enrolled. | 0 |
| Curricular.units.2nd.sem..evaluations. | 0 |
| Curricular.units.2nd.sem..approved. | 0 |
| Curricular.units.2nd.sem..grade. | 0 |
| Curricular.units.2nd.sem..without.evaluations. | 0 |
| Unemployment.rate | 0 |
| Inflation.rate | 0 |
| GDP | 0 |
| Target | 0 |
Limpieza de Datos
# Eliminamos columnas irrelevantes (por ejemplo, Nacionality)
data <- data %>% select(-c(Nacionality))
# Creamos una variable con el promedio de calificaciones anteriores
data <- data %>% mutate(Promedio_Nota_Previa = rowMeans(select(., starts_with("Curricular.units")), na.rm = TRUE))
VISUALIZACIÓN Y ANÁLISIS
Estadísticas de notas previas
# Media y mediana de calificación previa
mean(data$Previous.qualification..grade., na.rm = TRUE)
## [1] 132.6133
median(data$Previous.qualification..grade., na.rm = TRUE)
## [1] 133.1
Estudiantes que Abandonaron
# Filtrado de estudiantes que abandonaron
abandonaron <- data %>% filter(Target == "Dropout")
# Mostramos algunos registros
kable(head(abandonaron), caption = "Ejemplos de estudiantes que abandonaron")
| Marital.status | Application.mode | Application.order | Course | Daytime.evening.attendance. | Previous.qualification | Previous.qualification..grade. | Mother.s.qualification | Father.s.qualification | Mother.s.occupation | Father.s.occupation | Admission.grade | Displaced | Educational.special.needs | Debtor | Tuition.fees.up.to.date | Gender | Scholarship.holder | Age.at.enrollment | International | Curricular.units.1st.sem..credited. | Curricular.units.1st.sem..enrolled. | Curricular.units.1st.sem..evaluations. | Curricular.units.1st.sem..approved. | Curricular.units.1st.sem..grade. | Curricular.units.1st.sem..without.evaluations. | Curricular.units.2nd.sem..credited. | Curricular.units.2nd.sem..enrolled. | Curricular.units.2nd.sem..evaluations. | Curricular.units.2nd.sem..approved. | Curricular.units.2nd.sem..grade. | Curricular.units.2nd.sem..without.evaluations. | Unemployment.rate | Inflation.rate | GDP | Target | Promedio_Nota_Previa |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 17 | 5 | 171 | 1 | 1 | 122 | 19 | 12 | 5 | 9 | 127.3 | 1 | 0 | 0 | 1 | 1 | 0 | 20 | 0 | 0 | 0 | 0 | 0 | 0.0 | 0 | 0 | 0 | 0 | 0 | 0.0 | 0 | 10.8 | 1.4 | 1.74 | Dropout | 0.000000 |
| 1 | 1 | 5 | 9070 | 1 | 1 | 122 | 37 | 37 | 9 | 9 | 124.8 | 1 | 0 | 0 | 0 | 1 | 0 | 19 | 0 | 0 | 6 | 0 | 0 | 0.0 | 0 | 0 | 6 | 0 | 0 | 0.0 | 0 | 10.8 | 1.4 | 1.74 | Dropout | 1.000000 |
| 1 | 18 | 4 | 9254 | 1 | 1 | 119 | 37 | 37 | 9 | 9 | 113.1 | 1 | 0 | 0 | 0 | 1 | 0 | 22 | 0 | 0 | 5 | 5 | 0 | 0.0 | 0 | 0 | 5 | 5 | 0 | 0.0 | 0 | 15.5 | 2.8 | -4.06 | Dropout | 1.666667 |
| 1 | 1 | 1 | 9238 | 1 | 1 | 138 | 1 | 19 | 4 | 7 | 123.0 | 1 | 0 | 1 | 0 | 0 | 0 | 18 | 0 | 0 | 6 | 9 | 5 | 11.4 | 0 | 0 | 6 | 14 | 2 | 13.5 | 0 | 8.9 | 1.4 | 3.51 | Dropout | 5.575000 |
| 1 | 1 | 2 | 9853 | 1 | 1 | 133 | 19 | 37 | 4 | 9 | 130.2 | 1 | 0 | 0 | 1 | 0 | 0 | 19 | 0 | 0 | 6 | 6 | 0 | 0.0 | 0 | 0 | 6 | 0 | 0 | 0.0 | 0 | 12.7 | 3.7 | -1.70 | Dropout | 1.500000 |
| 1 | 1 | 1 | 9773 | 1 | 1 | 127 | 19 | 37 | 9 | 3 | 120.7 | 1 | 0 | 0 | 1 | 0 | 0 | 20 | 0 | 0 | 6 | 6 | 5 | 13.2 | 0 | 0 | 6 | 7 | 0 | 0.0 | 0 | 15.5 | 2.8 | -4.06 | Dropout | 3.600000 |
Boxplot: Calificaciones anteriores por estado final
ggplot(data, aes(x = Target, y = Previous.qualification..grade.)) +
geom_boxplot(fill = "skyblue") +
labs(title = "Distribución de calificaciones anteriores por estado del estudiante",
x = "Estado del estudiante", y = "Calificación previa") +
theme_minimal()
Interpretación: Se observa que los estudiantes con calificaciones previas más bajas tienen una mayor probabilidad de abandonar sus estudios.
Histograma: Unidades curriculares aprobadas en el primer semestre
ggplot(data, aes(x = Curricular.units.1st.sem..approved.)) +
geom_histogram(binwidth = 1, fill = "steelblue", color = "white") +
labs(title = "Unidades curriculares aprobadas en primer semestre",
x = "Unidades aprobadas", y = "Frecuencia") +
theme_minimal()
Interpretación: Muchos estudiantes aprueban entre 0 y 5 materias en el primer semestre. Este bajo rendimiento puede estar relacionado con la deserción temprana.
CONCLUSIONES Los estudiantes con calificaciones previas más bajas y menor número de unidades curriculares aprobadas en el primer semestre son más propensos a abandonar.
Las visualizaciones ayudan a identificar patrones importantes que podrían servir para establecer intervenciones académicas tempranas.