Análisis Univariante

Gráficos

Con la función ‘multiplot’ puedes dibujar varios gráficos de ggplot2 en una misma página. Utilizamos además la inclinación de las etiquetas de los ejes, para que sean visibles.

source("multiplot.r")
g1=ggplot(dat,aes(x=sexo))+geom_bar(aes(fill=sexo))
g2=ggplot(dat,aes(x=edad))+geom_bar(aes(fill=edad))+
  theme(axis.text.x = element_text(angle = 20, size = 6,hjust = 1, vjust = 1))

multiplot(g1,g2,cols=2)

Gráficos de quesos

dat.opi <- dat %>% 
  group_by(sexo) %>% 
  count() %>% 
  ungroup() %>% 
  mutate(per=round(`n`/sum(`n`)*100,2)) %>% 
  arrange(per)
dat.opi$label <- paste(dat.opi$per,rep("%",dim(dat.opi)[1]))

ggplot(data=dat.opi)+
  geom_bar(aes(x="", y=per, fill=sexo), stat="identity", width = 1)+
  coord_polar("y", start=0,direction=-1)+
  theme_void()+
  scale_fill_discrete(name="Composición por Sexo",
                       breaks=as.character(dat.opi$sexo),
                       labels=paste(as.character(dat.opi$sexo),dat.opi$label))

Gráficos de estrellas

stars(dat[,9:13],frame.plot = TRUE, main="Competencia Digital Docente",labels=NULL)

Diagramas de barras en porcentajes

ggplot(dat, aes(x = habil.tecno.edu)) + 
  geom_bar(aes(y = ..prop.. , group = 1),fill = "pink", width = 0.5) + 
  scale_y_continuous(labels = scales::percent) +
  coord_flip() + 
  xlab("") + ylab("Porcentaje")+ggtitle("Habilidades tecnológicas educativas")+
  theme_bw() 

ggplot(dat, aes(x = habil.tecno.edu)) + 
  geom_bar(aes(y = ..prop.. , group = 1),fill = "pink", width = 0.5) + 
  scale_y_continuous(labels = scales::percent) +
  coord_flip() + 
  facet_grid(~habil.tecno)+
  xlab("") + ylab("Porcentaje")+ggtitle("Habilidades tecnológicas educativas versus genéricas (2 al 5)")+
  theme_bw()

Diagramas de barras a partir de frecuencias

Boxplots

ggplot(competencias, aes(x =area,y=comp)) + 
  geom_boxplot(aes(fill=area))+
  xlab("Área Competencial") + ylab("Nivel competencial")+
  ggtitle("Nivel Competencial en las 5 áreas competenciales")+
  theme(legend.position = "NONE")

Tablas

rama median q25 q75 min max n
ARTE-ARQUITECTURA 4.00 3.0825 4.5850 2.00 5.00 14
CIENCIAS 3.67 3.0000 3.6700 2.67 4.33 29
HUMANIDADES 3.00 2.6700 3.7525 1.33 5.00 28
INGENIERIA 3.67 3.0000 4.0000 2.00 5.00 26
SOCIALES 3.33 3.0000 3.6700 1.00 5.00 65