# Datos
valores <- c(
44, 4.33, 17.87, 40.67, 41.72, 54, 0, 14, 59.67, 28.33,
58, 27.27, 0, 0, 71, 68.39, 25.67, 8.07, 18, 0, 64.67,
18.87, 13.33, 81, 53.67, 3, 45.67, 77, 56.67, 0, 9.67,
51.22, 42.78, 26, 3.67, 66.67, 60, 34.8, 50, 6.56, 10.33,
52.36, 69.33, 23.42, 13.67, 61.67, 11.67, 41.97, 77, 76.67, 67
)
# Crear histograma
h <- hist(valores,
breaks = 20,
main = "Histograma Clase Myrian",
xlab = "Valores",
ylab = "Frecuencia",
col = "skyblue",
border = "black")
# Añadir etiquetas de frecuencia encima de las barras
text(x = h$mids, # Posición horizontal (centro de las barras)
y = h$counts, # Posición vertical
labels = h$counts, # Texto = frecuencia
pos = 3, # Encima de las barras
col = "black")
# Añadir línea vertical en 65 (punto de aprobado)
abline(v = 65, col = "red", lwd = 2, lty = 2)
abline(v = 38, col = "blue", lwd = 2, lty = 2)
# Etiqueta del aprobado
text(65, max(h$counts), "Aprobado (65)", col = "red", pos = 4, cex = 0.8)
text(38, max(h$counts), "Potencial (38)", col = "blue", pos = 4, cex = 0.8)

# Datos
valores <- c(
36.33, 65, 53, 80, 73.33, 46.33, 64.33, 93, 9.89, 13.33,
37, 40.33, 66.67, 0, 15.33, 19, 13.33, 66, 16.67, 36,
17.92, 1, 0, 10.33, 48, 13, 20.33, 5.22, 67.67, 4,
13.33, 1.33, 35.22, 28.33, 83, 51.67, 49.28, 56.84,
23.93, 73.4, 70.33, 74.72, 7.67, 36.75, 39.33, 14,
32, 77.22, 42.67, 59.67, 50.22, 12.67, 0
)
# Crear histograma
h <- hist(valores,
breaks = 30,
main = "Histograma Clase Mauricio",
xlab = "Valores",
ylab = "Frecuencia",
col = "skyblue",
border = "black")
# Añadir etiquetas de frecuencia encima de las barras
text(x = h$mids,
y = h$counts,
labels = h$counts,
pos = 3,
col = "black")
# Línea vertical en 65 (punto de aprobado)
abline(v = 65, col = "red", lwd = 2, lty = 2)
abline(v = 38, col = "blue", lwd = 2, lty = 2)
# Etiqueta del aprobado
text(65, max(h$counts), "Aprobado (65)", col = "red", pos = 4, cex = 0.8)
text(38, max(h$counts), "Potencial (38)", col = "blue", pos = 4, cex = 0.8)

# Datos
valores_myrian <- c(
44, 4.33, 17.87, 40.67, 41.72, 54, 0, 14, 59.67, 28.33,
58, 27.27, 0, 0, 71, 68.39, 25.67, 8.07, 18, 0, 64.67,
18.87, 13.33, 81, 53.67, 3, 45.67, 77, 56.67, 0, 9.67,
51.22, 42.78, 26, 3.67, 66.67, 60, 34.8, 50, 6.56, 10.33,
52.36, 69.33, 23.42, 13.67, 61.67, 11.67, 41.97, 77, 76.67, 67
)
valores_mauricio <- c(
36.33, 63, 51, 76, 71.33, 42.33, 64.33, 91, 9.89, 13.33,
37, 40.33, 64.67, 0, 15.33, 19, 13.33, 64, 16.67, 36,
17.92, 1, 0, 10.33, 44, 13, 20.33, 5.22, 65.67, 4,
13.33, 1.33, 35.22, 28.33, 83, 47.67, 49.28, 54.84,
23.93, 73.4, 68.33, 72.72, 7.67, 36.75, 39.33, 14,
30, 75.22, 42.67, 57.67, 50.22, 12.67, 0
)
# Crear histograma combinado
breaks <- seq(0, 100, by = 10) # Mismos cortes para ambos
hist_myrian <- hist(valores_myrian, breaks = breaks, plot = FALSE)
hist_mauricio <- hist(valores_mauricio, breaks = breaks, plot = FALSE)
# Graficar el de Myrian
plot(hist_myrian, col = rgb(0, 0, 1, 0.5), main = "Myrian vs Mauricio",
xlab = "Valores", ylab = "Frecuencia", xlim = c(0, 100))
# Añadir el de Mauricio encima
plot(hist_mauricio, col = rgb(0, 1, 0, 0.5), add = TRUE)
# Línea de aprobado
abline(v = 65, col = "red", lwd = 2, lty = 2)
text(65, max(c(hist_myrian$counts, hist_mauricio$counts)),
"Aprobado (65)", col = "red", pos = 4, cex = 0.8)
# Leyenda
legend("topright", legend = c("Myrian", "Mauricio"),
fill = c(rgb(0, 0, 1, 0.5), rgb(0, 1, 0, 0.5)))
