base1 <- read.csv("C:/Users/christian.figueroa/Desktop/aCTIVIDAD 1 MULTIVARIADO/Actividad 3/base1.csv", row.names=1, sep=";")
Variable Programa
Variable Estrato: Esta variable va de 0 a 6.
dt <- as.table(as.matrix(base1))
addmargins(dt,c(1,2))
## X0 X1 X2 X3 X4 X5 X6 Sum
## AE 0 30 353 195 21 0 0 599
## AEV 2 11 134 104 5 1 0 257
## ARQ 0 13 158 106 7 0 0 284
## CP 2 54 347 138 8 1 0 550
## CS 1 15 166 128 14 0 0 324
## CYT 0 10 152 172 21 0 1 356
## GA 0 1 1 5 0 0 0 7
## GC 0 1 16 17 3 0 0 37
## GE 1 9 30 20 0 0 0 60
## GEM 2 12 82 56 1 1 0 154
## GETH 4 26 162 143 22 1 0 358
## HYT 2 23 222 149 18 0 0 414
## II 3 21 241 139 8 0 0 412
## IM 0 11 183 137 9 0 0 340
## IT 1 13 75 23 4 0 0 116
## LF 0 3 21 6 0 0 0 30
## LLE 0 8 88 39 1 0 0 136
## M 0 11 166 99 10 0 0 286
## NI 6 55 642 433 27 0 0 1163
## NIV 0 4 49 35 2 0 0 90
## P 1 7 16 20 2 1 0 47
## PT 0 4 53 35 2 0 0 94
## SSI 0 0 4 5 0 0 0 9
## T 0 9 5 0 2 0 0 16
## TDS 0 11 124 65 4 0 0 204
## TG 0 18 208 176 20 2 0 424
## Sum 25 380 3698 2445 211 7 1 6767
round(prop.table(dt,2)*100,2)
## X0 X1 X2 X3 X4 X5 X6
## AE 0.00 7.89 9.55 7.98 9.95 0.00 0.00
## AEV 8.00 2.89 3.62 4.25 2.37 14.29 0.00
## ARQ 0.00 3.42 4.27 4.34 3.32 0.00 0.00
## CP 8.00 14.21 9.38 5.64 3.79 14.29 0.00
## CS 4.00 3.95 4.49 5.24 6.64 0.00 0.00
## CYT 0.00 2.63 4.11 7.03 9.95 0.00 100.00
## GA 0.00 0.26 0.03 0.20 0.00 0.00 0.00
## GC 0.00 0.26 0.43 0.70 1.42 0.00 0.00
## GE 4.00 2.37 0.81 0.82 0.00 0.00 0.00
## GEM 8.00 3.16 2.22 2.29 0.47 14.29 0.00
## GETH 16.00 6.84 4.38 5.85 10.43 14.29 0.00
## HYT 8.00 6.05 6.00 6.09 8.53 0.00 0.00
## II 12.00 5.53 6.52 5.69 3.79 0.00 0.00
## IM 0.00 2.89 4.95 5.60 4.27 0.00 0.00
## IT 4.00 3.42 2.03 0.94 1.90 0.00 0.00
## LF 0.00 0.79 0.57 0.25 0.00 0.00 0.00
## LLE 0.00 2.11 2.38 1.60 0.47 0.00 0.00
## M 0.00 2.89 4.49 4.05 4.74 0.00 0.00
## NI 24.00 14.47 17.36 17.71 12.80 0.00 0.00
## NIV 0.00 1.05 1.33 1.43 0.95 0.00 0.00
## P 4.00 1.84 0.43 0.82 0.95 14.29 0.00
## PT 0.00 1.05 1.43 1.43 0.95 0.00 0.00
## SSI 0.00 0.00 0.11 0.20 0.00 0.00 0.00
## T 0.00 2.37 0.14 0.00 0.95 0.00 0.00
## TDS 0.00 2.89 3.35 2.66 1.90 0.00 0.00
## TG 0.00 4.74 5.62 7.20 9.48 28.57 0.00
round(prop.table(dt,1)*100,2)
## X0 X1 X2 X3 X4 X5 X6
## AE 0.00 5.01 58.93 32.55 3.51 0.00 0.00
## AEV 0.78 4.28 52.14 40.47 1.95 0.39 0.00
## ARQ 0.00 4.58 55.63 37.32 2.46 0.00 0.00
## CP 0.36 9.82 63.09 25.09 1.45 0.18 0.00
## CS 0.31 4.63 51.23 39.51 4.32 0.00 0.00
## CYT 0.00 2.81 42.70 48.31 5.90 0.00 0.28
## GA 0.00 14.29 14.29 71.43 0.00 0.00 0.00
## GC 0.00 2.70 43.24 45.95 8.11 0.00 0.00
## GE 1.67 15.00 50.00 33.33 0.00 0.00 0.00
## GEM 1.30 7.79 53.25 36.36 0.65 0.65 0.00
## GETH 1.12 7.26 45.25 39.94 6.15 0.28 0.00
## HYT 0.48 5.56 53.62 35.99 4.35 0.00 0.00
## II 0.73 5.10 58.50 33.74 1.94 0.00 0.00
## IM 0.00 3.24 53.82 40.29 2.65 0.00 0.00
## IT 0.86 11.21 64.66 19.83 3.45 0.00 0.00
## LF 0.00 10.00 70.00 20.00 0.00 0.00 0.00
## LLE 0.00 5.88 64.71 28.68 0.74 0.00 0.00
## M 0.00 3.85 58.04 34.62 3.50 0.00 0.00
## NI 0.52 4.73 55.20 37.23 2.32 0.00 0.00
## NIV 0.00 4.44 54.44 38.89 2.22 0.00 0.00
## P 2.13 14.89 34.04 42.55 4.26 2.13 0.00
## PT 0.00 4.26 56.38 37.23 2.13 0.00 0.00
## SSI 0.00 0.00 44.44 55.56 0.00 0.00 0.00
## T 0.00 56.25 31.25 0.00 12.50 0.00 0.00
## TDS 0.00 5.39 60.78 31.86 1.96 0.00 0.00
## TG 0.00 4.25 49.06 41.51 4.72 0.47 0.00
round(prop.table(dt)*100,2)
## X0 X1 X2 X3 X4 X5 X6
## AE 0.00 0.44 5.22 2.88 0.31 0.00 0.00
## AEV 0.03 0.16 1.98 1.54 0.07 0.01 0.00
## ARQ 0.00 0.19 2.33 1.57 0.10 0.00 0.00
## CP 0.03 0.80 5.13 2.04 0.12 0.01 0.00
## CS 0.01 0.22 2.45 1.89 0.21 0.00 0.00
## CYT 0.00 0.15 2.25 2.54 0.31 0.00 0.01
## GA 0.00 0.01 0.01 0.07 0.00 0.00 0.00
## GC 0.00 0.01 0.24 0.25 0.04 0.00 0.00
## GE 0.01 0.13 0.44 0.30 0.00 0.00 0.00
## GEM 0.03 0.18 1.21 0.83 0.01 0.01 0.00
## GETH 0.06 0.38 2.39 2.11 0.33 0.01 0.00
## HYT 0.03 0.34 3.28 2.20 0.27 0.00 0.00
## II 0.04 0.31 3.56 2.05 0.12 0.00 0.00
## IM 0.00 0.16 2.70 2.02 0.13 0.00 0.00
## IT 0.01 0.19 1.11 0.34 0.06 0.00 0.00
## LF 0.00 0.04 0.31 0.09 0.00 0.00 0.00
## LLE 0.00 0.12 1.30 0.58 0.01 0.00 0.00
## M 0.00 0.16 2.45 1.46 0.15 0.00 0.00
## NI 0.09 0.81 9.49 6.40 0.40 0.00 0.00
## NIV 0.00 0.06 0.72 0.52 0.03 0.00 0.00
## P 0.01 0.10 0.24 0.30 0.03 0.01 0.00
## PT 0.00 0.06 0.78 0.52 0.03 0.00 0.00
## SSI 0.00 0.00 0.06 0.07 0.00 0.00 0.00
## T 0.00 0.13 0.07 0.00 0.03 0.00 0.00
## TDS 0.00 0.16 1.83 0.96 0.06 0.00 0.00
## TG 0.00 0.27 3.07 2.60 0.30 0.03 0.00
library(gplots)
##
## Attaching package: 'gplots'
## The following object is masked from 'package:stats':
##
## lowess
balloonplot(t(dt), main ="Base 1", xlab ="", ylab="",
label = FALSE, show.margins = FALSE, label.size = 1)
library(reshape)
library(lattice)
datosf <- melt(prop.table(dt))
barchart(value ~ X1|X2, data = datosf, layout=c(4,1), xlab="Programa", main="Perfiles Fila")
library(reshape)
library(lattice)
datosf <- melt(prop.table(dt))
barchart(value ~ X2|X1, data = datosf, layout=c(4,1), xlab="Estrato", main="Perfiles Columna")
library("FactoMineR")
library("factoextra")
res.ca <- CA(base1, graph = FALSE)
fviz_ca_biplot(res.ca, repel = TRUE)
fviz_ca_biplot(res.ca,
map="rowprincipal", arrow=c(TRUE,TRUE),
repel=TRUE)
De acuerdo a los resultados se evidencia que hay una marcada tendencia a que los individuos se situen en lso estratos 2 y 3 en todos los programas esto se evidencia en la gráfica biplot, ya que la mayoría de datos se encuentra en el origen y lo que demuestra en algunos casos muy puntuales son algunos datos atípicos.
Respecto al análisis se evidencia una relación entre el programa T y el estrato 1, esta como la unica aosciación que se puede evidenciar claramente con los resultados.
Teneindo en cuenta el resultado se rechaza la hipotesis teniendo en cuenta que el Pvalor es menor al 5%, por lo tanto las variables son dependientes.
chisq <- chisq.test(base1)
chisq
##
## Pearson's Chi-squared test
##
## data: base1
## X-squared = 392.99, df = 150, p-value < 2.2e-16