output: html_document: toc: true toc_float: true toc_depth: 3 number_sections: true theme: cosmo highlight: tango code_folding: show df_print: paged css: styles.css pdf_document: toc: true number_sections: true highlight: tango word_document: toc: true number_sections: true
install.packages("summarytools")
## Installing package into '/cloud/lib/x86_64-pc-linux-gnu-library/4.6'
## (as 'lib' is unspecified)
install.packages("ggplot2")
## Installing package into '/cloud/lib/x86_64-pc-linux-gnu-library/4.6'
## (as 'lib' is unspecified)
📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊
🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯🎯
📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊📊
🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀
library(readxl)
DATOS2026 <- read_excel("00. DATOS202460ULTIMOS25.xlsx")
DATOS2026
## # A tibble: 74 × 16
## CURSO ASISTENCIA2 ASISTENCIA1 `PARCIAL 1` `PARCIAL 2` NRC PROGRAMA EDAD
## <chr> <dbl> <dbl> <chr> <chr> <dbl> <chr> <dbl>
## 1 PROBABI… 100 90 3.6 4.3 2314 F_NEGOC… 20
## 2 ESTADIS… 70 75 0.9 2.5 1136 DERECHO 18
## 3 PROBABI… 85 95 3.9 3.8 2314 F_NEGOC… 19
## 4 PROBABI… 5 5 2.9 0.5 2314 MECANICA 18
## 5 ESTADIS… 20 70 3.7 0.55 1009 PSICOLO… 19
## 6 ESTADIS… 100 100 0.9 2.95 2313 PSICOLO… 20
## 7 PROBABI… 50 75 3.7 1.7 1010 C_DATOS 18
## 8 PROBABI… 100 95 3 3.3 2314 F_NEGOC… 19
## 9 ESTADIS… 100 100 3.8 3.3 1009 PSICOLO… 18
## 10 PROBABI… 95 85 3 2.9 2314 SISTEMAS 22
## # ℹ 64 more rows
## # ℹ 8 more variables: PESO <dbl>, ESTATURA <dbl>, SEXO <chr>,
## # ESTADO_CIVIL <chr>, ESTRATO <chr>, URBANO <chr>, TRANSPORTE <chr>,
## # GR_SANGUINEO <chr>
table_sexo<-table(DATOS2026$SEXO)
table_sexo
##
## Femenino Masculino
## 42 32
pie_1<-pie(table_sexo, col=c("lightblue","pink"),
main="Estudio de Pastel: Jesus David Gonzalez Tellez.\n Distribución por sexos.", labels = table_sexo)
barp<-barplot(table_sexo, col = rainbow(5), border = "darkred",main = "Gráfico de Barras: Jesus David Gonzalez Tellez",sub = "UTB",xlab = "SEXO", ylab = "Conteo")
text(barp, table_sexo-30, labels = table_sexo)
## (5i)Usando la aplicación para hacer la tabla
porcentual redondeando al entero mas cercano
table_sexo2<-round(table(DATOS2026$SEXO)/121*100)
table_sexo2
##
## Femenino Masculino
## 35 26
barp2<-barplot(table_sexo2, col = rainbow(5), border = "darkred",main = "Gráfico de Barras - Jesus David Gonzalez ",sub = "UTB",xlab = "SEXO", ylab = "Porcentaje")
text(barp2, table_sexo2-30, labels = table_sexo2)
pie_1<-pie(table_sexo2, col=c("lightblue","pink"),
main="Estudio de Pastel - Jesus David Gonzalez.\n Distribución por sexos.", labels = table_sexo2)
table_3<-table(DATOS2026$SEXO, DATOS2026$CURSO)
table_3
##
## ESTADISTICAI PROBABILIDAD
## Femenino 16 26
## Masculino 10 22
barp3<-barplot(table_3,
main = "Gráfico de barras CURSO vs SEXO - Jesus David Gonzalez",
xlab = "CURSO", ylab = "Frecuencia",
col = c("pink", "blue"),
legend.text = rownames(table_3),
beside = TRUE) # Barras agrupadas
text(barp3, table_3-5, labels = table_3)
table_4<-round(table(DATOS2026$SEXO, DATOS2026$CURSO)/74*100)
table_4
##
## ESTADISTICAI PROBABILIDAD
## Femenino 22 35
## Masculino 14 30
barp4<-barplot(table_4,
main = "Gráfico de barras CURSO vs SEXO en porcentajes",
xlab = "CURSO", ylab = "Frecuencia",
col = c("pink", "blue"),
legend.text = rownames(table_4),
beside = TRUE) # Barras agrupadas
text(barp4, table_4-5, labels = table_4)
table_5<-table(DATOS2026$ESTRATO, DATOS2026$CURSO)
table_5
##
## ESTADISTICAI PROBABILIDAD
## I 5 10
## II 7 18
## III 9 9
## IV 5 5
## V 0 5
barp3<-barplot(table_5,
main = "Gráfico de barras CURSO vs ESTRATO - Jesus David Gonzalez",
xlab = "CURSO", ylab = "Frecuencia",
col = rainbow(5),
legend.text = rownames(table_5),
beside = TRUE) # Barras agrupadas
text(barp3, table_5-1, labels = table_3)
table_6<-table(DATOS2026$ESTRATO, DATOS2026$SEXO)
table_6
##
## Femenino Masculino
## I 8 7
## II 17 8
## III 10 8
## IV 4 6
## V 3 2
barp3<-barplot(table_6,
main = "Gráfico de barras CURSO vs ESTRATO - Jesus David Gozalez",
xlab = "CURSO", ylab = "Frecuencia",
col = rainbow(5),
legend.text = rownames(table_6),
beside = TRUE) # Barras agrupadas
text(barp3, table_6-1, labels = table_6)
library(summarytools)
## Warning in fun(libname, pkgname): couldn't connect to display ":0"
## system might not have X11 capabilities; in case of errors when using dfSummary(), set st_options(use.x11 = FALSE)
tabla_8 <- freq(DATOS2026$EDAD)
tabla_8
## Frequencies
## DATOS2026$EDAD
## Type: Numeric
##
## Freq % Valid % Valid Cum. % Total % Total Cum.
## ----------- ------ --------- -------------- --------- --------------
## 17 7 9.46 9.46 9.46 9.46
## 18 32 43.24 52.70 43.24 52.70
## 19 21 28.38 81.08 28.38 81.08
## 20 7 9.46 90.54 9.46 90.54
## 21 4 5.41 95.95 5.41 95.95
## 22 3 4.05 100.00 4.05 100.00
## <NA> 0 0.00 100.00
## Total 74 100.00 100.00 100.00 100.00
library(summarytools)
summary(DATOS2026$EDAD)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 17.0 18.0 18.0 18.7 19.0 22.0
boxplot(DATOS2026$EDAD, horizontal = TRUE, col = rainbow(3))
x = DATOS2026$EDAD
boxplot(x, notch = TRUE, horizontal = TRUE, col = rainbow(3))
## Warning in (function (z, notch = FALSE, width = NULL, varwidth = FALSE, : some
## notches went outside hinges ('box'): maybe set notch=FALSE
x = DATOS2026$EDAD
y = DATOS2026$SEXO
boxplot(x~y, horizontal = TRUE, col = rainbow(3))
library(ggplot2)
x = DATOS2026$EDAD
z = DATOS2026$ESTRATO
boxplot(x~z, horizontal = TRUE, col = rainbow(3))
library(ggplot2)
ggplot(data= DATOS2026,mapping= aes(y=EDAD,x = ESTRATO, fill=SEXO))+geom_boxplot()+
scale_y_continuous(name = "EDAD") +
scale_x_discrete(labels = abbreviate, name = "ESTRATO")
summary(DATOS2026$ESTATURA)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 153.0 163.0 168.0 168.4 174.0 192.0
boxplot(DATOS2026$ESTATURA, horizontal = TRUE, col = rainbow(3))
x = DATOS2026$ESTATURA
boxplot(x, notch = TRUE, horizontal = TRUE, col = rainbow(3))
x = DATOS2026$ESTATURA
y = DATOS2026$SEXO
boxplot(x~y, horizontal = TRUE, col = rainbow(3))
library(ggplot2)
x = DATOS2026$ESTATURA
z = DATOS2026$ESTRATO
boxplot(x~z, horizontal = TRUE, col = rainbow(3))
library(ggplot2)
ggplot(data= DATOS2026,mapping= aes(y=ESTATURA,x = ESTRATO, fill=SEXO))+geom_boxplot()+
scale_y_continuous(name = "ESTATURA") +
scale_x_discrete(labels = abbreviate, name = "ESTRATO")
install.packages("agricolae")
## Installing package into '/cloud/lib/x86_64-pc-linux-gnu-library/4.6'
## (as 'lib' is unspecified)
library(agricolae)
h2<-graph.freq(DATOS2026$EDAD, col=colors()[75]) #[86]
summary(h2)
## Lower Upper Main Frequency Percentage CF CPF
## 1 17.0 17.7 17.35 7 9.5 7 9.5
## 2 17.7 18.4 18.05 32 43.2 39 52.7
## 3 18.4 19.1 18.75 21 28.4 60 81.1
## 4 19.1 19.8 19.45 0 0.0 60 81.1
## 5 19.8 20.5 20.15 7 9.5 67 90.5
## 6 20.5 21.2 20.85 4 5.4 71 95.9
## 7 21.2 21.9 21.55 0 0.0 71 95.9
## 8 21.9 22.6 22.25 3 4.1 74 100.0
plot(h2, col=colors()[70], frequency = 1)
polygon.freq(h2, col = "red", frequency = 1, lwd = 2)
fr_por_clase2<-h2$counts
fr_por_clase2
## [1] 7 32 21 0 7 4 0 3
total_n2<-sum(h2$counts)
total_n2
## [1] 74
fr_relativos2<-fr_por_clase2/total_n2
fr_porcentuales2<-100*fr_relativos2
fr_porcentuales2
## [1] 9.459459 43.243243 28.378378 0.000000 9.459459 5.405405 0.000000
## [8] 4.054054
cumsum(fr_por_clase2)
## [1] 7 39 60 60 67 71 71 74
cumsum(fr_relativos2)
## [1] 0.09459459 0.52702703 0.81081081 0.81081081 0.90540541 0.95945946 0.95945946
## [8] 1.00000000
cumsum(fr_porcentuales2)
## [1] 9.459459 52.702703 81.081081 81.081081 90.540541 95.945946 95.945946
## [8] 100.000000
p4<-cumsum(fr_porcentuales2)
plot(p4, col = "red")
lines(p4, col = "red")