-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtdpa.R
More file actions
36 lines (27 loc) · 1.3 KB
/
tdpa.R
File metadata and controls
36 lines (27 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
install.packages("dplyr")
install.packages("lubridate")
install.packages("ggplot2")
library(dplyr)
library(lubridate)
library(ggplot2)
load("/Users/cristianespinal/Library/CloudStorage/GoogleDrive-cristian.espinal@pascualbravo.edu.co/Unidades compartidas/UVIC - Unidad de Vigilancia Tecnologica e Inteligencia Competitiva/6. Lago de datos/DATA CONSOLIDADA/desertores.rdata")
load("/Users/cristianespinal/Library/CloudStorage/GoogleDrive-cristian.espinal@pascualbravo.edu.co/Unidades compartidas/UVIC - Unidad de Vigilancia Tecnologica e Inteligencia Competitiva/6. Lago de datos/DATA CONSOLIDADA/matriculados_nuevos.rdata")
# Asumiendo que 'periodo' es la columna que indica la cohorte
# Calcular el total de desertores por cohorte
total_desertores <- desertores %>%
count(periodo) %>%
rename(total_desertores = n)
# Calcular el total de nuevos matriculados (primíparos) por cohorte
total_primiparos <- matricula_nuevos %>%
count(periodo) %>%
rename(total_primiparos = n)
# Combinar los totales por cohorte
tdpa <- total_desertores %>%
left_join(total_primiparos, by = "periodo")
# Calcular la TDPA
tdpa <- tdpa %>%
mutate(TDPA = (total_desertores / total_primiparos) * 100)
# Revisar los resultados
print(tdpa)
library(writexl)
write_xlsx(tdpa, path = "/Users/cristianespinal/Downloads/TDPA_results.xlsx")