Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
tailineju committed Apr 20, 2021
1 parent 4a999d0 commit c37b837
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 16 deletions.
94 changes: 78 additions & 16 deletions Atividade4-2.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ a.100$LOCALIZACAO <- a.100$LOCALIZACAO %>%
str_replace("2", "Rural")

a.100$DEPENDENCIA_ADM <- a.100$DEPENDENCIA_ADM %>%
str_replace("1", "Federal")%>%
str_replace("2", "Estadual")%>%
str_replace("1", "Estadual + Federal")%>%
str_replace("2", "Estadual + Federal")%>%
str_replace("3", "Municipal")%>%
str_replace("4", "Privada")

Expand All @@ -43,16 +43,17 @@ a.30$LOCALIZACAO <- a.30$LOCALIZACAO %>%
str_replace("2", "Rural")

a.30$DEPENDENCIA_ADM <- a.30$DEPENDENCIA_ADM %>%
str_replace("1", "Federal")%>%
str_replace("2", "Estadual")%>%
str_replace("1", "Estadual + Federal")%>%
str_replace("2", "Estadual + Federal")%>%
str_replace("3", "Municipal")%>%
str_replace("4", "Privada")

# Amostra tam.100 ----

##################################################################
################## AMOSTRAS DE TAMANHO 100 ########################

# NOTA_MT e LOCALIZAÇÃO
# Gráficos

a.100 %>%
ggplot(aes(x=LOCALIZACAO, y=NOTA_MT)) +
geom_boxplot(fill=c("#7AA3CC"), width = 0.5) +
Expand All @@ -62,15 +63,30 @@ a.100 %>%
ggsave("Outros arquivos/imagens/loc_nmt100.png", width = 158, height = 93, units = "mm")

# Resumo
resumo1 <- c(summary(a.100$NOTA_MT),sd(a.100$NOTA_MT)^2)
urb.100 <- a.100[a.100$LOCALIZACAO == "Urbana",]
rural.100 <- a.100[a.100$LOCALIZACAO == "Rural",]

summary(urb.100$NOTA_MT)
sd(urb.100$NOTA_MT)

summary(rural.100$NOTA_MT)
sd(rural.100$NOTA_MT)
# Testes Associação


#T de Student
t.test(urb.100$NOTA_MT, rural.100$NOTA_MT)

#Wilcoxon
wilcox.test(urb.100$NOTA_MT, rural.100$NOTA_MT)

#Kolmogorov/Smirnov
ks.test(urb.100$NOTA_MT, rural.100$NOTA_MT)

# NOTA_LP e DEPENDENCIA_ADM
# Gráficos

# federal+estadual
a.100 %>%
#filter(DEPENDENCIA_ADM != "Privada") %>%
ggplot(aes(x=DEPENDENCIA_ADM, y=NOTA_LP)) +
geom_boxplot(fill=c("#7AA3CC"), width = 0.5) +
stat_summary(fun="mean", geom="point", shape=23, size=3, fill="white")+
Expand All @@ -79,11 +95,29 @@ a.100 %>%
ggsave("Outros arquivos/imagens/dep_nlp100.png", width = 158, height = 93, units = "mm")

# Resumo
resumo2 <- c(summary(a.100$NOTA_LP),sd(a.100$NOTA_LP)^2)
est.100 <- a.100[a.100$DEPENDENCIA_ADM == "Estadual + Federal",]
mun.100 <- a.100[a.100$DEPENDENCIA_ADM == "Municipal",]

summary(est.100$NOTA_LP)
sd(est.100$NOTA_LP)

summary(mun.100$NOTA_LP)
sd(mun.100$NOTA_LP)

# Testes Associação

# Amostra tam.30 ----
#T de Student
t.test(est.100$NOTA_LP, mun.100$NOTA_LP)

#Wilcoxon
wilcox.test(est.100$NOTA_LP, mun.100$NOTA_LP)

#Kolmogorov/Smirnov
ks.test(est.100$NOTA_LP, mun.100$NOTA_LP)


##################################################################
################## AMOSTRAS DE TAMANHO 30 ########################

# NOTA_MT e LOCALIZAÇÃO
# Gráficos
Expand All @@ -97,16 +131,30 @@ a.30 %>%
ggsave("Outros arquivos/imagens/loc_nmt30.png", width = 158, height = 93, units = "mm")

# Resumo
resumo1 <- c(summary(a.30$NOTA_MT),sd(a.30$NOTA_MT)^2)
urb.30 <- a.30[a.30$LOCALIZACAO == "Urbana",]
rural.30 <- a.30[a.30$LOCALIZACAO == "Rural",]

summary(urb.30$NOTA_MT)
sd(urb.30$NOTA_MT)

summary(rural.30$NOTA_MT)
sd(rural.30$NOTA_MT)

# Testes Associação

#T de Student
t.test(urb.30$NOTA_MT, rural.30$NOTA_MT)

#Wilcoxon
wilcox.test(urb.30$NOTA_MT, rural.30$NOTA_MT)

#Kolmogorov/Smirnov
ks.test(urb.30$NOTA_MT, rural.30$NOTA_MT)

# NOTA_LP e DEPENDENCIA_ADM
# Gráficos

# federal+estadual
a.30 %>%
#filter(DEPENDENCIA_ADM != "Privada") %>%
ggplot(aes(x=DEPENDENCIA_ADM, y=NOTA_LP)) +
geom_boxplot(fill=c("#7AA3CC"), width = 0.5) +
stat_summary(fun="mean", geom="point", shape=23, size=3, fill="white")+
Expand All @@ -115,7 +163,21 @@ a.30 %>%
ggsave("Outros arquivos/imagens/dep_nlp30.png", width = 158, height = 93, units = "mm")

# Resumo
resumo2 <- c(summary(a.30$NOTA_LP),sd(a.30$NOTA_LP)^2)
est.30 <- a.30[a.30$DEPENDENCIA_ADM == "Estadual + Federal",]
mun.30 <- a.30[a.30$DEPENDENCIA_ADM == "Municipal",]

summary(est.30$NOTA_LP)
sd(est.30$NOTA_LP)

summary(mun.30$NOTA_LP)
sd(mun.30$NOTA_LP)

# Testes Associação
#T de Student
t.test(est.30$NOTA_LP, mun.30$NOTA_LP)

#Wilcoxon
wilcox.test(est.30$NOTA_LP, mun.30$NOTA_LP)

# Testes Associação
#Kolmogorov/Smirnov
ks.test(est.30$NOTA_LP, mun.30$NOTA_LP)
Binary file modified Outros arquivos/imagens/dep_nlp100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Outros arquivos/imagens/dep_nlp30.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c37b837

Please sign in to comment.