Censo das Turmas Estatística (EST 105)

Prof. Fernando Bastos - Darah Moreira

2024-02-26

Introdução

O objetivo desses slides é apresentar um resumo tabular e gráfico dos dados coletados via questionário apresentado pelo professor Fernando Bastos aos estudantes de Estatística Básica da Universidade Federal de Viçosa. A utilização de tabelas de frequência e gráficos distintos na análise estatística é essencial para facilitar a leitura e a interpretação de dados de forma rápida e eficiente. No contexto da Estatística Básica, é fundamental que os estudantes compreendam o processo de coleta, limpeza e organização dos dados, a fim de extrair informações relevantes e aplicá-las em suas análises. Através dessas ferramentas visuais e descritivas, como gráficos de barras, histogramas e tabelas de frequência, os estudantes da Universidade Federal de Viçosa poderão desenvolver habilidades práticas para resumir e apresentar grandes volumes de dados de forma clara e objetiva, tornando-se aptos a tomar decisões informadas e baseadas em evidências no futuro.

Distribuição de Frequência da Residência dos Estudantes

Pergunta: Qual a Sua Cidade de Residência?

##########----------------------------------------------------------------------
#####Distribuicao de Frequencia - RESIDENCIA
##########----------------------------------------------------------------------
tab1 <- df %>% group_by(RESIDENCIA) %>% summarise(Freq=n(), .groups = 'drop' )
tab1$FreqR <- round(tab1$Freq/sum(tab1$Freq), digits = 2)

tab1$FreqACM <- cumsum(tab1$Freq)
tab1$FreqRACM <- cumsum(tab1$FreqR)
Total <- c("Total", sum(tab1$Freq), sum(tab1$FreqR), "-", "-")
tab1 <- rbind(tab1, Total)

tab1%>% 
  addHtmlTableStyle(col.rgroup = c("none", "#F9FAF0"),
                    col.columns = c("none", "#F1F0FA")) %>% 
  htmlTable(total = TRUE, rnames = FALSE,
            caption = "Tabela de Frequencia")

Observação: Em geral, é necessário fazer correções!

Tabela de Frequencia
RESIDENCIA Freq FreqR FreqACM FreqRACM
BARBACENA 1 0.03 1 0.03
BELO HORIZONTE 2 0.06 3 0.09
BUENOPOLIS 1 0.03 4 0.12
CACHOEIRO DE ITAPEMIRIM 1 0.03 5 0.15
CANAA 1 0.03 6 0.18
CAPELINHA 1 0.03 7 0.21
CORONEL FABRICIANO 1 0.03 8 0.24
ERVALIA 2 0.06 10 0.3
LINHARES 1 0.03 11 0.33
PIRANGA 1 0.03 12 0.36
PIRANGA MG 1 0.03 13 0.39
PONTE NOVA 2 0.06 15 0.45
PORTO FIRME 1 0.03 16 0.48
RECREIO 1 0.03 17 0.51
SABINOPOLIS MG 1 0.03 18 0.54
SANTANA DO MANHUACU 1 0.03 19 0.57
SETE LAGOAS 2 0.06 21 0.63
TEIXEIRAS 1 0.03 22 0.66
VICOSA 9 0.28 31 0.94
VITORIA 1 0.03 32 0.97
Total 32 0.97 - -

Gráfico de Barras Horizontal

Pergunta: Qual a Sua Cidade de Residência?

#Grafico------------------------------------------------------------------------
ggplot(df) +
  aes(x = RESIDENCIA, fill = RESIDENCIA) +
  geom_bar(position = "dodge") +
  scale_fill_hue(direction = 1) +
  labs(
    x = "Residência",
    y = "Número de Estudantes",
    title = "Cidade de Residência dos Estudantes"
  ) +
  coord_flip() +
  theme_minimal() +
  theme(legend.position = "none")

Distribuição de Frequência do Estado dos Estudantes

Pergunta: Caso Seja brasileiro, Cite Qual Estado Sua Cidade de Residência Pertence. Caso Seja Estrangeiro, Cite Qual o País!

Tabela de Frequencia
ESTADO Freq FreqR FreqACM FreqRACM
ESPIRITO SANTO 3 0.09 3 0.09
MG 28 0.88 31 0.97
PIRANGA MG 1 0.03 32 1
Total 32 1 - -

Gráfico de Barras Vertical

Pergunta: Caso Seja brasileiro, Cite Qual Estado Sua Cidade de Residência Pertence. Caso Seja Estrangeiro, Cite Qual o País!

plot1 <- df %>% group_by(ESTADO) %>% summarise(count=n(), .groups = 'drop') %>% 
  ggplot(aes(reorder(ESTADO, count), text = paste("ESTADO: ", ESTADO, "<br>",
                                                 "Número de estudantes: ",
                                                 count), count, fill=ESTADO)) + 
  geom_col(show.legend = F) + 
  geom_text(aes(label = count), nudge_y = 1, size=5) + 
  theme(axis.text.x = element_text(angle = 30, vjust = 1, hjust=1)) + 
  ylab("Quantidade de Estudantes") + 
  xlab("Estado") + 
  ggtitle("Estado dos Estudantes")
plotly::ggplotly(plot1, tooltip = "text") %>% 
  plotly::layout(showlegend=FALSE)

Gráfico de Barras Horizontal

Pergunta: Caso Seja brasileiro, Cite Qual Estado Sua Cidade de Residência Pertence. Caso Seja Estrangeiro, Cite Qual o País!

ggplot(df) +
  aes(x = ESTADO, fill = ESTADO) +
  geom_bar(position = "dodge") +
  scale_fill_hue(direction = 1) +
  labs(
    x = "Estados",
    y = "Número de Estudantes",
    title = "Estado dos Estudantes"
  ) +
  coord_flip() +
  theme_minimal() +
  theme(legend.position = "none")

Distribuição de Frequência do Curso dos Estudantes

Pergunta: Em Qual Curso Você Está Matriculado?

Tabela de Frequencia
CURSO Freq FreqR FreqACM FreqRACM
ADMINISTRACAO 1 0.03 1 0.03
ADMINISTRACAO ( NOTURNO) 1 0.03 2 0.06
AGRONEGOCIO 1 0.03 3 0.09
AGRONOMIA 9 0.28 12 0.37
BIOLOGIA 3 0.09 15 0.46
CIENCIAS BIOLOGICAS 2 0.06 17 0.52
CIENCIAS CONTABEIS 4 0.12 21 0.64
CONTABEIS 1 0.03 22 0.67
ENGENHARIA DE PRODUCAO 1 0.03 23 0.7
ENGENHEIRA FLORESTAL 1 0.03 24 0.73
LICENCIATURA EM CIENCIAS BIOLOGICAS 3 0.09 27 0.82
LICENCIATURA EM MATEMATICA 1 0.03 28 0.85
LICENCIATURA EM QUIMICA 1 0.03 29 0.88
MATEMATICA 1 0.03 30 0.91
QUIMICA 1 0.03 31 0.94
ZOOTECNIA 1 0.03 32 0.97
Total 32 0.97 - -

Gráfico de Barras Vertical

plot1 <- df %>% group_by(CURSO) %>% summarise(count=n(), .groups = 'drop') %>% 
  ggplot(aes(reorder(CURSO, count), text = paste("Curso: ",
                                                 CURSO, 
                                                 "<br>", 
                                                 "Número de estudantes: ", 
                                                 count), 
             count, 
             fill=CURSO)) + 
  geom_col(show.legend = F) + 
  geom_text(aes(label = count), nudge_y = 1, size=5) + 
  theme(axis.text.x = element_text(angle = 30, vjust = 1, hjust=1)) + 
  ylab("Quantidade de Estudantes") + 
  xlab("Cursos") + 
  ggtitle("Número de Estudantes por curso da\n Disciplina Estatística")
plotly::ggplotly(plot1, tooltip = "text") %>% 
  plotly::layout(showlegend=FALSE)

Gráfico de Barras Horizontal

plot <- df %>% 
  group_by(CURSO) %>% 
  summarise(count=n(), .groups = 'drop') %>% 
  ggplot(aes(reorder(CURSO, count), 
             text = paste("Curso: ", 
                          CURSO, "<br>",
                          "Número de estudantes: ", 
                          count), 
             count, 
             fill=CURSO)) + 
  geom_col(position = "dodge", show.legend = F) + 
  geom_text(aes(label = count), nudge_y = 1, size=5) +
  coord_flip() + xlab("Curso") + ylab("Nº de Estudantes") +
  ggtitle("Número de Estudantes\n por Curso")

plot %>% plotly::ggplotly(tooltip = "text") %>% 
  plotly::layout(showlegend=FALSE)

Treemap de alunos por curso

library(treemap)
df2 <- df %>% 
  group_by(CURSO) %>% 
  summarise(quant=n(),fac=sum(1*(FACILIDADE=="SIM")))
df2$escala <- scale(df2$fac)
treemap(df2,
        index=c("CURSO"),
        vSize="quant",
        vColor="escala",
        type="value", 
        palette = "-RdGy", 
        lowerbound.cex.labels = 0.1, 
        overlap.labels = 0.05,
        title = "Treemap dos Cursos com Alunos Matriculados em EST 106")

Distribuição de Frequência do Ano de Ingresso dos Estudantes ao Curso

Pergunta: Em Que Ano Você Iniciou o Curso Atual?

Tabela de Frequencia
ANOINICIO Freq FreqR FreqACM FreqRACM
2019 2 0.06 2 0.06
2020 2 0.06 4 0.12
2021 4 0.12 8 0.24
2022 5 0.16 13 0.4
2022/1 1 0.03 14 0.43
2023 13 0.41 27 0.84
2024 4 0.12 31 0.96
2033 1 0.03 32 0.99
Total 32 0.99 - -

Gráfico de Barras Vertical

plot1 <- df %>% group_by(ANOINICIO) %>% summarise(count=n(),
                                                  .groups = 'drop')%>% 
  ggplot(aes(reorder(ANOINICIO, count), text = paste("Ano: ",
                                                     ANOINICIO, 
                                                     "<br>", 
                                                     "Ingresso dos Estudantes: ", 
                                                     count), 
             count, 
             fill=ANOINICIO)) + 
  geom_col(show.legend = F) + 
  geom_text(aes(label = count), nudge_y = 1, size=5) + 
  theme(axis.text.x = element_text(angle = 30, vjust = 1, hjust=1)) + 
  ylab("Nº de Estudantes") + 
  xlab("Ano") + 
  ggtitle("Ingresso dos Estudantes")
plotly::ggplotly(plot1, tooltip = "text") %>% 
  plotly::layout(showlegend=FALSE)

Gráfico de Barras Horizontal

plot <- df %>% 
  group_by(ANOINICIO) %>% 
  summarise(count=n(), .groups = 'drop') %>% 
  ggplot(aes(reorder(ANOINICIO, count), 
             text = paste("Anoinicio: ", 
                          ANOINICIO, "<br>",
                          "Número de estudantes: ", 
                          count), 
             count, 
             fill=ANOINICIO)) + 
  geom_col(position = "dodge", show.legend = F) + 
  geom_text(aes(label = count), nudge_y = 1, size=5) +
  coord_flip() + xlab("Ano") + ylab("Nº de Estudantes")+
  ggtitle("Ingresso dos Estudantes")

plot %>% plotly::ggplotly(tooltip = "text") %>% 
  plotly::layout(showlegend=FALSE)

Distribuição de Frequência do Semestre dos Estudantes

Pergunta: Você Está Matriculado Em Qual Semestre do Seu Curso?

Tabela de Frequencia
SEMESTRE Freq FreqR FreqACM FreqRACM
2 3 0.09 3 0.09
3 2 0.06 5 0.15
4 15 0.47 20 0.62
5 1 0.03 21 0.65
6 8 0.25 29 0.9
7 1 0.03 30 0.93
8 2 0.06 32 0.99
Total 32 0.99 - -

Gráfico de Barras Horizontal

plot <- tab %>% 
  group_by(SEMESTRE) %>% 
  summarise(count=n(), .groups = 'drop') %>% 
  ggplot(aes(reorder(SEMESTRE, count), 
             text = paste("Semestre: ", 
                          SEMESTRE, "<br>",
                          "Número de estudantes: ", 
                          count), 
             count, 
             fill=SEMESTRE)) + 
  geom_col(position = "dodge", show.legend = F) + 
  geom_text(aes(label = count), nudge_y = 1, size=5) +
  coord_flip() + xlab("Semestre") + ylab("Nº de Estudantes") +
  ggtitle("Número de alunos por semestre")

plot %>% plotly::ggplotly(tooltip = "text") %>% 
  plotly::layout(showlegend=FALSE)

Gráfico de Barras Vertical

plot1 <- tab %>% group_by(SEMESTRE) %>% summarise(count=n(),
                                                  .groups = 'drop')%>% 
  ggplot(aes(reorder(SEMESTRE, count), text = paste("Semestre: ",
                                                    SEMESTRE, 
                                                     "<br>", 
                                                     "Estudantes por Semestre: ", 
                                                     count), 
             count, 
             fill=SEMESTRE)) + 
  geom_col(show.legend = F) + 
  geom_text(aes(label = count), nudge_y = 1, size=5) + 
  theme(axis.text.x = element_text(angle = 30, vjust = 1, hjust=1)) + 
  ylab("Nº de Estudantes") + 
  xlab("Ano") + 
  ggtitle("Estudantes por Semestre")
plotly::ggplotly(plot1, tooltip = "text") %>% 
  plotly::layout(showlegend=FALSE)

Distribuição de Frequência da Idade dos Estudantes

Pergunta: Qual a Sua Idade?

Tabela de Frequencia
IDADE Freq FreqR FreqACM FreqRACM
19 2 0.06 2 0.06
20 7 0.22 9 0.28
21 9 0.28 18 0.56
22 5 0.16 23 0.72
23 4 0.12 27 0.84
24 2 0.06 29 0.9
25 1 0.03 30 0.93
26 1 0.03 31 0.96
27 1 0.03 32 0.99
Total 32 0.99 - -

Boxplot da Idade dos Alunos

Pergunta: Qual a Sua Idade?

ggplot(data = df, aes(x = IDADE)) +
  geom_boxplot(color = 'black')+ 
  stat_boxplot(geom = "errorbar",
               width = 0.15) +
  ggtitle("Boxplot Idade")

Gráfico de Barras Vertical

Pergunta: Qual a Sua Idade?

plot1 <- df %>% group_by(IDADE) %>% summarise(count=n(), .groups = 'drop') %>% 
  ggplot(aes(reorder(IDADE, count), text = paste("IDADE: ", IDADE, "<br>",
                                                 "Número de estudantes: ", 
                                                 count),
             count, fill=IDADE)) + 
  geom_col(show.legend = F) + 
  geom_text(aes(label = count), nudge_y = 1, size=5) + 
  #theme(axis.text.x = element_text(angle = 30, vjust = 1, hjust=1)) + 
  ylab("Quantidade de Estudantes") + 
  xlab("Idade") + 
  ggtitle("Idade dos Estudantes")
plotly::ggplotly(plot1, tooltip = "text") %>% 
  plotly::layout(showlegend=FALSE)

Distribuição de Frequência do Tempo de Sono dos Estudantes

Pergunta: Quantas Horas Você Costuma Dormir por Noite?

Tabela de Frequencia
HORASSONO Freq FreqR FreqACM FreqRACM
10 1 0.03 1 0.03
4 1 0.03 2 0.06
6 10 0.31 12 0.37
7 7 0.22 19 0.59
8 12 0.38 31 0.97
9 1 0.03 32 1
Total 32 1 - -

Gráfico de Barras Vertical

Pergunta: Quantas Horas Você Costuma Dormir por Noite?

plot1 <- df %>% 
  group_by(HORASSONO=as.character(HORASSONO)) %>% 
  summarise(count=n(), 
            .groups = 'drop') %>% 
  ggplot(aes(reorder(as.character(HORASSONO), 
                     count), 
             text = paste("HORASSONO:", 
                          HORASSONO, 
                          "<br>",
                          "Número de estudantes: ", 
                          count),
             count, 
             fill=HORASSONO)) + 
  geom_col(show.legend = F) + 
  geom_text(aes(label = count), nudge_y = 1, size=5) + 
  #theme(axis.text.x = element_text(angle = 30, vjust = 1, hjust=1)) + 
  ylab("Quantidade de Estudantes") + 
  xlab("Horas") + 
  ggtitle("Tempo de Sono")
plotly::ggplotly(plot1, tooltip = "text") %>% 
  plotly::layout(showlegend=FALSE)

Gráfico de Barras Horizontal

Pergunta: Quantas Horas Você Costuma Dormir por Noite?

plot <- df %>% 
  group_by(HORASSONO=as.character(HORASSONO)) %>% 
  summarise(count=n(), .groups = 'drop') %>% 
  ggplot(aes(reorder(HORASSONO, count), 
             text = paste("Horas: ", 
                          HORASSONO, "<br>",
                          "Número de estudantes: ", 
                          count), 
             count, 
             fill=HORASSONO)) + 
  geom_col(position = "dodge", show.legend = F) + 
  geom_text(aes(label = count), nudge_y = 1, size=5) +
  coord_flip() + xlab("Horas") + ylab("Nº de Estudantes") +
  ggtitle("Tempo de Sono")

plot %>% plotly::ggplotly(tooltip = "text") %>% 
  plotly::layout(showlegend=FALSE)

Distribuição de Frequência do Recebimento de Assistência Estudantil dos Estudantes

Pergunta: Você Recebe Algum Tipo de Assistência Estudantil?

Tabela de Frequencia
ASSISTENCIA Freq FreqR FreqACM FreqRACM
NAO 23 0.72 23 0.72
SIM 9 0.28 32 1
Total 32 1 - -

Gráfico de Setores

Pergunta: Você Recebe Algum Tipo de Assistência Estudantil?

#Grafico de setores------------------------------------------------------------- 

tab1 <- df %>% group_by(ASSISTENCIA) %>% summarise(Freq=n(), .groups = 'drop' )
library(scales)
pizza <- ggplot(tab1, aes(x="", y=Freq, fill=ASSISTENCIA))+
  geom_bar(width = 1, stat = "identity")+
  coord_polar("y")+ggtitle("Assistência Estudantil")

pizza + scale_fill_brewer(palette="Dark2") +
  theme(axis.text.x=element_blank()) +
  geom_text(aes(y = Freq/2, 
                label = Freq), data = tab1, size=5)

Gráfico de Setores (Algumas Alterações)

Pergunta: Você Recebe Algum Tipo de Assistência Estudantil?

ni<-table(df$ASSISTENCIA) 
fi<-prop.table(ni) # Tabela de frequências relativas (f_i)
p_fi<-100*prop.table(ni) # Porcentagem (100 f_i)

# Adiciona linhas de total
ni<-c(ni,sum(ni)) 
fi<-c(fi,sum(fi))
p_fi<-c(p_fi,sum(p_fi))
names(ni)[3]<-"Total"
df2<-cbind(ni,fi=round(fi,digits=2),p_fi=round(p_fi,digits=2))
labs<-paste(1:3,"(",df2[1:3,1],";",round(df2[1:3,3],1),"%)",sep="")
pie(table(df$ASSISTENCIA),labels=labs, main =
      "Gráfico em setores para Assistência Estudantil.",
    sub = "Fonte: Censo EST 106")
#title("Figura 2.3: Gráfico em setores para a variável Y: grau de instrução")
legend(-1.1,-0.8,legend=c("1=Não, 2=Sim"),border=NA,box.col=NA)

Gráfico de Barras Horizontal

Pergunta: Você Recebe Algum Tipo de Assistência Estudantil?

#Grafico Assistencia por Curso--------------------------------------------------

teste <- df %>% 
  group_by(CURSO,ASSISTENCIA) %>% 
  summarise("quant"=n())


ggplot(teste,aes(CURSO,quant,fill=ASSISTENCIA))+
  geom_col() +
  coord_flip() +
  geom_text(aes(label=quant), position = position_stack(vjust = 1.2))+
  labs(title = "Alunos com Assistência\n Estudantil por Curso")

Gráfico de Barras Horizontal (Alterado)

#Algumas Alterações-------------------------------------------------------------

ggplot(teste,aes(CURSO,quant,fill=ASSISTENCIA))+
  geom_col(position = "dodge") +
  coord_flip() +
  geom_text(aes(label=quant),position = position_dodge(0.9),hjust = -1) +
  labs(title = "Alunos com Assistência\n Estudantil por Curso")

Distribuição de Frequência do Estudo Antecipado dos Estudantes

Pergunta: Você Tem Costume de Estudar Antecipadamente Para as Provas ou Somente na Véspera?

Tabela de Frequencia
ESTUDOANTECIPADO Freq FreqR FreqACM FreqRACM
AS VEZES ESTUDO ANTECIPADAMENTE A PROVA 15 0.47 15 0.47
NUNCA ESTUDO ANTECIPADAMENTE AS PROVAS 4 0.12 19 0.59
SEMPRE ESTUDO ANTECIPADAMENTE AS PROVAS 13 0.41 32 1
Total 32 1 - -

Gráfico de Barras Vertical

#Grafico------------------------------------------------------------------------

plot1 <- df %>% 
  group_by(ESTUDOANTECIPADO=as.character(ESTUDOANTECIPADO)) %>% 
  summarise(count=n(), 
            .groups = 'drop') %>% 
  ggplot(aes(reorder(as.character(ESTUDOANTECIPADO),
                     count), 
             text = paste("ESTUDOANTECIPADO:", 
                          ESTUDOANTECIPADO, 
                          "<br>",
                          "Número de estudantes: ",
                          count), 
             count, 
             fill=ESTUDOANTECIPADO)) + 
  geom_col(show.legend = F) + 
  geom_text(aes(label = count), nudge_y = 1, size=5) + 
  #theme(axis.text.x = element_text(angle = 30, vjust = 1, hjust=1)) + 
  ylab("Quantidade de Estudantes") + 
  xlab(" ") + 
  ggtitle("Estudo Antecipado")
plotly::ggplotly(plot1, tooltip = "text") %>% 
  plotly::layout(showlegend=FALSE)

Gráfico de Barras Vertical (Alterado)

Pergunta: Você Tem Costume de Estudar Antecipadamente Para as Provas ou Somente na Véspera?

#Alteração do Grafico-----------------------------------------------------------

plot1 <- df %>% 
  group_by(ESTUDOANTECIPADO=as.character(ESTUDOANTECIPADO)) %>% 
  summarise(count=n(), 
            .groups = 'drop') %>% 
  ggplot(aes(reorder(as.character(ESTUDOANTECIPADO),
                     count), 
             text = paste("ESTUDOANTECIPADO:", 
                          ESTUDOANTECIPADO, 
                          "<br>",
                          "Número de estudantes: ",
                          count), 
             count, 
             fill=ESTUDOANTECIPADO)) + 
  geom_col(show.legend = F) + 
  geom_text(aes(label = count), nudge_y = 1, size=5) + 
  theme(axis.text.x = element_text(angle = 30, vjust = 1, hjust=1)) + 
  ylab("Quantidade de Estudantes") + 
  xlab(" ") + 
  ggtitle("Estudo Antecipado")
plotly::ggplotly(plot1, tooltip = "text") %>% 
  plotly::layout(showlegend=FALSE)

Distribuição de Frequência do Tempo de Estudo dos Estudantes

Pergunta: Quantas Horas Semanais Você Dedica aos Estudos, Exceto Aulas?

Tabela de Frequencia
HORASESTUDO Freq FreqR FreqACM FreqRACM
0 2 0.06 2 0.06
10 3 0.09 5 0.15
12 3 0.09 8 0.24
16 1 0.03 9 0.27
2 2 0.06 11 0.33
20 4 0.12 15 0.45
26 1 0.03 16 0.48
28 1 0.03 17 0.51
3 1 0.03 18 0.54
30 1 0.03 19 0.57
4 7 0.22 26 0.79
5 2 0.06 28 0.85
6 3 0.09 31 0.94
8 1 0.03 32 0.97
Total 32 0.97 - -

Histograma

Pergunta: Quantas Horas Semanais Você Dedica aos Estudos, Exceto Aulas?

#Histograma---------------------------------------------------------------------


df$HORASESTUDO <- as.numeric(as.character(df$HORASESTUDO))
attach(df)
hist(HORASESTUDO, 
     xlab = "Estudantes", 
     ylab = "Frenquência", col = "red", border = "black", 
     xlim = c(0,50), ylim = c(0,50), breaks = 5, 
     main = "Histograma de Horas de Estudo", labels = TRUE)

Histograma com ggplot

Pergunta: Quantas Horas Semanais Você Dedica aos Estudos, Exceto Aulas?

#Histograma pelo ggplot---------------------------------------------------------

ggplot(data = df, aes(x = HORASESTUDO)) +
  geom_histogram(color = 'black',bins = 5)+  ylim(0,20)+
  stat_bin(bins = 5, geom="text", aes(label=..count..), vjust=-1.5)+
  ggtitle("Histograma de Horas de Estudo")+
  xlab("Horas de Estudo") + 
  ylab("Estudantes")

Gráfico de Barras Vertical

Pergunta: Quantas Horas Semanais Você Dedica aos Estudos, Exceto Aulas?

#Grafico------------------------------------------------------------------------

plot1 <- df %>% group_by(HORASESTUDO) %>% summarise(count=n(),
                                                    .groups = 'drop') %>% 
  ggplot(aes(reorder(HORASESTUDO, count),
             text = paste("HORASESTUDO: ", 
                          HORASESTUDO, 
                          "<br>", 
                          "Número de estudantes: ", 
                          count), 
             count, 
             fill=HORASESTUDO)) + 
  geom_col(show.legend = F) + 
  geom_text(aes(label = count), nudge_y = 1, size=5) + 
  #theme(axis.text.x = element_text(angle = 30, vjust = 1, hjust=1)) + 
  ylab("Quantidade de Estudantes") + 
  xlab("Horas") + 
  ggtitle("Tempo de Estudo")
plotly::ggplotly(plot1, tooltip = "text") %>% 
  plotly::layout(showlegend=FALSE)

Distribuição de Frequência do Número de Créditos Cursado pelos Estudantes

Pergunta: Atualmente Você está Cursando Quantos Créditos?

Tabela de Frequencia
CREDITOS Freq FreqR FreqACM FreqRACM
12 2 0.06 2 0.06
15 1 0.03 3 0.09
16 7 0.22 10 0.31
18 1 0.03 11 0.34
19 2 0.06 13 0.4
20 3 0.09 16 0.49
21 1 0.03 17 0.52
22 4 0.12 21 0.64
23 2 0.06 23 0.7
24 3 0.09 26 0.79
25 2 0.06 28 0.85
26 1 0.03 29 0.88
27 2 0.06 31 0.94
28 1 0.03 32 0.97
Total 32 0.97 - -

Gráfico de Barras Vertical

Pergunta: Atualmente Você está Cursando Quantos Créditos?

#Grafico------------------------------------------------------------------------

plot1 <- df %>% group_by(CREDITOS) %>% summarise(count=n(),
                                                 .groups = 'drop') %>% 
  ggplot(aes(reorder(CREDITOS, count),
             text = paste("CREDITOS: ",
                          CREDITOS,
                          "<br>",
                          "Número de estudantes: ", 
                          count), 
             count, fill=CREDITOS)) + 
  geom_col(show.legend = F) + 
  geom_text(aes(label = count), nudge_y = 1, size=5) + 
  #theme(axis.text.x = element_text(angle = 30, vjust = 1, hjust=1)) + 
  ylab("Quantidade de Estudantes") + 
  xlab("Creditos") + 
  ggtitle("Numero de creditos cursados pelos alunos")
plotly::ggplotly(plot1, tooltip = "text") %>% 
  plotly::layout(showlegend=FALSE)

Histograma

Pergunta: Atualmente Você está Cursando Quantos Créditos?

#Histograma---------------------------------------------------------------------
df$CREDITOS <- as.numeric(as.character(df$CREDITOS))
attach(df)
hist(CREDITOS, 
     xlab = "Créditos", 
     ylab = "Nº de Estudantes", col = "blue", border = "black", 
     xlim = c(10,30), ylim = c(0,30), breaks = 5, 
     main = "Histograma de Número de Créditos", labels = TRUE)

Distribuição de Frequência do Interesse pela Área Acadêmica dos Estudantes

Pergunta: Você tem Interesse em Seguir na Área Acadêmica?

Tabela de Frequencia
INTERESSEAREAACADEMICA Freq FreqR FreqACM FreqRACM
N SEI 1 0.03 1 0.03
NAO 13 0.41 14 0.44
SIM 15 0.47 29 0.91
SIM, PROFESSOR DE FEDERAL 1 0.03 30 0.94
TALVEZ 2 0.06 32 1
Total 32 1 - -

Gráfico de Barras Vertical

Pergunta: Você tem Interesse em Seguir na Área Acadêmica?

#Grafico------------------------------------------------------------------------

plot1 <- df %>% group_by(INTERESSEAREAACADEMICA) %>% 
  summarise(count=n(),.groups = 'drop')%>% 
  ggplot(aes(reorder(INTERESSEAREAACADEMICA, count), 
               text = paste("INTERESSEAREAACADEMICA: ", 
                            INTERESSEAREAACADEMICA, "<br>",
                                                  "Número de estudantes: ",
                                                  count), count, 
             fill=INTERESSEAREAACADEMICA)) + 
  geom_col(show.legend = F) + 
  geom_text(aes(label = count), nudge_y = 1, size=5) + 
  theme(axis.text.x = element_text(angle = 30, vjust = 1, hjust=1)) + 
  ylab("Quantidade de Estudantes") + 
  xlab("") + 
  ggtitle("Interesse dos Estudantes\n Pela Área Acadêmica")
plotly::ggplotly(plot1, tooltip = "text") %>% 
  plotly::layout(showlegend=FALSE)

Gráfico de Barras Horizontal

Pergunta: Você tem Interesse em Seguir na Área Acadêmica?

#Grafico------------------------------------------------------------------------

plot <- df %>% 
  group_by(INTERESSEAREAACADEMICA=as.character(INTERESSEAREAACADEMICA)) %>% 
  summarise(count=n(), .groups = 'drop') %>% 
  ggplot(aes(reorder(INTERESSEAREAACADEMICA, count), 
             text = paste("Interesse: ", 
                          INTERESSEAREAACADEMICA, "<br>",
                          "Número de estudantes: ", 
                          count), 
             count, 
             fill=INTERESSEAREAACADEMICA)) + 
  geom_col(position = "dodge", show.legend = F) + 
  geom_text(aes(label = count), nudge_y = 1, size=5) +
  coord_flip() + xlab("") + ylab("Nº de Estudantes") +
  ggtitle("Interesse dos Estudantes pela Área Acadêmica")

plot %>% plotly::ggplotly(tooltip = "text") %>% 
  plotly::layout(showlegend=FALSE)

Distribuição de Frequência da Expectativa na Disciplina Pelos Estudantes

Pergunta: Você Acredita que Terá um Bom Resultado na Disciplina de EST?

Tabela de Frequencia
RESULTADOEST Freq FreqR FreqACM FreqRACM
DEPENDERA DO PROFESSOR! 6 0.19 6 0.19
NAO 2 0.06 8 0.25
SIM 24 0.75 32 1
Total 32 1 - -

Gráfico de Barras Vertical

Pergunta: Você Acredita que Terá um Bom Resultado na Disciplina de EST?

#Grafico------------------------------------------------------------------------

plot1 <- df %>% group_by(RESULTADOEST) %>% 
  summarise(count=n(),.groups = 'drop')%>% 
  ggplot(aes(reorder(RESULTADOEST, count), 
             text = paste("RESULTADOEST: ", 
                          RESULTADOEST, "<br>",
                          "Número de estudantes: ",
                          count), count, 
             fill=RESULTADOEST)) + 
  geom_col(show.legend = F) + 
  geom_text(aes(label = count), nudge_y = 1, size=5) + 
  theme(axis.text.x = element_text(angle = 30, vjust = 1, hjust=1)) + 
  ylab("Quantidade de Estudantes") + 
  xlab("") + 
  ggtitle("Expectativa dos Estudantes Pela Disciplina")
plotly::ggplotly(plot1, tooltip = "text") %>% 
  plotly::layout(showlegend=FALSE)

Gráfico de Barras Horizontal

#Grafico------------------------------------------------------------------------

plot <- df %>% 
  group_by(RESULTADOEST=as.character(RESULTADOEST)) %>% 
  summarise(count=n(), .groups = 'drop') %>% 
  ggplot(aes(reorder(RESULTADOEST, count), 
             text = paste("Resultado: ", 
                          RESULTADOEST, "<br>",
                          "Número de estudantes: ", 
                          count), 
             count, 
             fill=RESULTADOEST)) + 
  geom_col(position = "dodge", show.legend = F) + 
  geom_text(aes(label = count), nudge_y = 1, size=5) +
  coord_flip() + xlab("") + ylab("Nº de Estudantes") +
  ggtitle("Expectativa dos Alunos\n pela Disciplina")

plot %>% plotly::ggplotly(tooltip = "text") %>% 
  plotly::layout(showlegend=FALSE)

Distribuição de Frequência do Salário Atual dos Estudantes

Pergunta: Qual o Salário que Você Recebe Hoje?

Tabela de Frequencia
SALARIOHOJE Freq FreqR FreqACM FreqRACM
0 16 0.5 16 0.5
1980 1 0.03 17 0.53
1000 1 0.03 18 0.56
000 1 0.03 19 0.59
700 2 0.06 21 0.65
2300 1 0.03 22 0.68
1412 1 0.03 23 0.71
820 1 0.03 24 0.74
400 1 0.03 25 0.77
2058 1 0.03 26 0.8
800 2 0.06 28 0.86
1600 1 0.03 29 0.89
750 1 0.03 30 0.92
1560 1 0.03 31 0.95
1500 1 0.03 32 0.98
Total 32 0.98 - -

Gráfico de Barras Vertical

Pergunta: Qual o Salário que Você Recebe Hoje?

#Grafico------------------------------------------------------------------------
df$SALARIOHOJE <- as.numeric(as.character(df$SALARIOHOJE))
plot1 <- df %>% group_by(SALARIOHOJE) %>% 
  summarise(count=n(),.groups = 'drop')%>% 
  ggplot(aes(reorder(SALARIOHOJE, count), 
             text = paste("SALARIOHOJE: ", 
                          SALARIOHOJE, "<br>",
                          "Número de estudantes: ",
                          count), count, 
             fill=SALARIOHOJE)) + 
  geom_col(show.legend = F) + 
  geom_text(aes(label = count), nudge_y = 1, size=5) + 
  theme(axis.text.x = element_text(angle = 30, vjust = 1, hjust=1)) + 
  ylab("Quantidade de Estudantes") + 
  xlab("Valor em Real") + 
  ggtitle("Renda dos Estudantes")
plotly::ggplotly(plot1, tooltip = "text") %>% 
  plotly::layout(showlegend=FALSE)

Boxplot do Salário Atual dos Estudantes

Pergunta: Qual o Salário que Você Recebe Hoje?

#Grafico------------------------------------------------------------------------

ggplot(data = df, aes(x = SALARIOHOJE)) +
  geom_boxplot(color = 'black')+ 
  stat_boxplot(geom = "errorbar",
               width = 0.15) +
  ggtitle("Boxplot Salário Atual")

Distribuição de Frequência dao Salário Esperado pelos Estudantes

Pergunta: Qual o Salário que Você Acredita que Será Ofertado Para Você No Início de Sua Carreira Profissional (Após Formado)? Obs: Responda Um Número Inteiro Entre 0 e 10. Em que 0 Significa Nenhum Salário e 10 Significa 10 Salários Mínimos!

Tabela de Frequencia
SALARIOPOSFORMADO Freq FreqR FreqACM FreqRACM
1 1 0.03 1 0.03
2 8 0.25 9 0.28
3 8 0.25 17 0.53
4 2 0.06 19 0.59
5 9 0.28 28 0.87
6 1 0.03 29 0.9
7 1 0.03 30 0.93
8 1 0.03 31 0.96
10 1 0.03 32 0.99
Total 32 0.99 - -

Gráfico de Barras Vertical

#Grafico------------------------------------------------------------------------

plot1 <- df %>% group_by(SALARIOPOSFORMADO) %>% 
  summarise(count=n(),.groups = 'drop')%>% 
  ggplot(aes(reorder(SALARIOPOSFORMADO, count), 
             text = paste("SALARIOPOSFORMADO: ", 
                          SALARIOPOSFORMADO, "<br>",
                          "Número de estudantes: ",
                          count), count, 
             fill=SALARIOPOSFORMADO)) + 
  geom_col(show.legend = F) + 
  geom_text(aes(label = count), nudge_y = 1, size=5) + 
  #theme(axis.text.x = element_text(angle = 30, vjust = 1, hjust=1)) + 
  ylab("Quantidade de Estudantes") + 
  xlab("Valor em Real") + 
  ggtitle("Renda Esperada Pelos Estudantes")
plotly::ggplotly(plot1, tooltip = "text") %>% 
  plotly::layout(showlegend=FALSE)

Histograma

#Tabela com Respostas
#
table(df$SALARIOPOSFORMADO)
SALARIOPOSFORMADO <- df$SALARIOPOSFORMADO[df$SALARIOPOSFORMADO<100]
hist(SALARIOPOSFORMADO, 
     xlab = "Valor em Real por Salários Mínimos", 
     ylab = "Nº de Estudantes", col = "blue", border = "black", 
     xlim = c(0,20), ylim = c(0,30), breaks = 10, 
     main = "Histograma Renda Esperada\n Pelos Estudantes", labels = TRUE)