rm(list=ls())
getwd()
## [1] "C:/temp/2018/3.DADOS"
setwd("C:/temp/2018/3.DADOS/")
enade <- read.table("C:/temp/2018/3.DADOS/enade_2018.txt",header = TRUE, sep=";", dec = ",", colClasses=c(DS_VT_ACE_OFG="character",DS_VT_ACE_OCE="character"))#1
presente <- enade[enade$TP_PRES == 555,]#7 Compareceram e tiveram o resultado válido
attach(presente)#2
summary(presente)
## NU_ANO CO_IES CO_CATEGAD CO_ORGACAD
## Min. :2018 Min. : 1 Min. : 93 Min. :10019
## 1st Qu.:2018 1st Qu.: 322 1st Qu.:10002 1st Qu.:10022
## Median :2018 Median : 666 Median :10005 Median :10022
## Mean :2018 Mean : 1503 Mean : 8016 Mean :10024
## 3rd Qu.:2018 3rd Qu.: 1563 3rd Qu.:10007 3rd Qu.:10028
## Max. :2018 Max. :23410 Max. :17634 Max. :10028
##
## CO_GRUPO CO_CURSO CO_MODALIDADE CO_MUNIC_CURSO
## Min. : 1.00 Min. : 1 Min. :1.000 Min. :1100023
## 1st Qu.: 2.00 1st Qu.: 20516 1st Qu.:1.000 1st Qu.:3106200
## Median : 13.00 Median : 74548 Median :1.000 Median :3529005
## Mean : 64.82 Mean : 328455 Mean :1.167 Mean :3463975
## 3rd Qu.: 38.00 3rd Qu.: 114506 3rd Qu.:1.000 3rd Qu.:4113700
## Max. :804.00 Max. :5001389 Max. :2.000 Max. :5300108
##
## CO_UF_CURSO CO_REGIAO_CURSO NU_IDADE TP_SEXO
## Min. :11.00 Min. :1.000 Min. : 4.00 Length:462241
## 1st Qu.:31.00 1st Qu.:3.000 1st Qu.:23.00 Class :character
## Median :35.00 Median :3.000 Median :26.00 Mode :character
## Mean :34.46 Mean :3.108 Mean :29.04
## 3rd Qu.:41.00 3rd Qu.:4.000 3rd Qu.:33.00
## Max. :53.00 Max. :5.000 Max. :86.00
##
## ANO_FIM_EM ANO_IN_GRAD CO_TURNO_GRADUACAO TP_INSCRICAO_ADM
## Min. :1000 Min. :1978 Min. :1.000 Min. :0.0e+00
## 1st Qu.:2006 1st Qu.:2014 1st Qu.:3.000 1st Qu.:0.0e+00
## Median :2011 Median :2014 Median :4.000 Median :0.0e+00
## Mean :2008 Mean :2014 Mean :3.347 Mean :4.3e-06
## 3rd Qu.:2013 3rd Qu.:2015 3rd Qu.:4.000 3rd Qu.:0.0e+00
## Max. :2686 Max. :2099 Max. :4.000 Max. :2.0e+00
##
## TP_INSCRICAO NU_ITEM_OFG NU_ITEM_OFG_Z NU_ITEM_OFG_X NU_ITEM_OFG_N
## Min. :0 Min. :8 Min. :0 Min. :0 Min. :0
## 1st Qu.:0 1st Qu.:8 1st Qu.:0 1st Qu.:0 1st Qu.:0
## Median :0 Median :8 Median :0 Median :0 Median :0
## Mean :0 Mean :8 Mean :0 Mean :0 Mean :0
## 3rd Qu.:0 3rd Qu.:8 3rd Qu.:0 3rd Qu.:0 3rd Qu.:0
## Max. :0 Max. :8 Max. :0 Max. :0 Max. :0
##
## NU_ITEM_OCE NU_ITEM_OCE_Z NU_ITEM_OCE_X NU_ITEM_OCE_N DS_VT_GAB_OFG_ORIG
## Min. :27 Min. :0.0000 Min. :0.000 Min. :0 Length:462241
## 1st Qu.:27 1st Qu.:0.0000 1st Qu.:4.000 1st Qu.:0 Class :character
## Median :27 Median :0.0000 Median :8.000 Median :0 Mode :character
## Mean :27 Mean :0.4927 Mean :6.569 Mean :0
## 3rd Qu.:27 3rd Qu.:1.0000 3rd Qu.:8.000 3rd Qu.:0
## Max. :27 Max. :2.0000 Max. :9.000 Max. :0
##
## DS_VT_GAB_OFG_FIN DS_VT_GAB_OCE_ORIG DS_VT_GAB_OCE_FIN DS_VT_ESC_OFG
## Length:462241 Length:462241 Length:462241 Length:462241
## Class :character Class :character Class :character Class :character
## Mode :character Mode :character Mode :character Mode :character
##
##
##
##
## DS_VT_ACE_OFG DS_VT_ESC_OCE DS_VT_ACE_OCE TP_PRES
## Length:462241 Length:462241 Length:462241 Min. :555
## Class :character Class :character Class :character 1st Qu.:555
## Mode :character Mode :character Mode :character Median :555
## Mean :555
## 3rd Qu.:555
## Max. :555
##
## TP_PR_GER TP_PR_OB_FG TP_PR_DI_FG TP_PR_OB_CE
## Min. :333.0 Min. :333.0 Min. :333.0 Min. :333.0
## 1st Qu.:555.0 1st Qu.:555.0 1st Qu.:555.0 1st Qu.:555.0
## Median :555.0 Median :555.0 Median :555.0 Median :555.0
## Mean :554.8 Mean :554.7 Mean :538.7 Mean :554.7
## 3rd Qu.:555.0 3rd Qu.:555.0 3rd Qu.:555.0 3rd Qu.:555.0
## Max. :555.0 Max. :555.0 Max. :555.0 Max. :555.0
##
## TP_PR_DI_CE TP_SFG_D1 TP_SFG_D2 TP_SCE_D1
## Min. :333.0 Min. :333.0 Min. :333.0 Min. :333.0
## 1st Qu.:555.0 1st Qu.:555.0 1st Qu.:555.0 1st Qu.:555.0
## Median :555.0 Median :555.0 Median :555.0 Median :555.0
## Mean :532.9 Mean :526.2 Mean :526.6 Mean :508.2
## 3rd Qu.:555.0 3rd Qu.:555.0 3rd Qu.:555.0 3rd Qu.:555.0
## Max. :555.0 Max. :555.0 Max. :555.0 Max. :555.0
##
## TP_SCE_D2 TP_SCE_D3 NT_GER NT_FG
## Min. :333.0 Min. :333.0 Min. : 0.0 Min. : 0.00
## 1st Qu.:336.0 1st Qu.:555.0 1st Qu.:31.2 1st Qu.:32.80
## Median :555.0 Median :555.0 Median :41.0 Median :45.10
## Mean :495.5 Mean :509.5 Mean :41.8 Mean :45.84
## 3rd Qu.:555.0 3rd Qu.:555.0 3rd Qu.:51.7 3rd Qu.:58.60
## Max. :555.0 Max. :555.0 Max. :93.7 Max. :99.20
## NA's :146 NA's :146
## NT_OBJ_FG NT_DIS_FG NT_FG_D1 NT_FG_D1_PT
## Min. : 0.00 Min. : 0.0 Min. : 0.00 Min. : 0.0
## 1st Qu.: 37.50 1st Qu.:28.5 1st Qu.: 27.00 1st Qu.: 50.0
## Median : 50.00 Median :41.0 Median : 42.00 Median : 65.0
## Mean : 50.73 Mean :38.5 Mean : 39.21 Mean : 56.7
## 3rd Qu.: 62.50 3rd Qu.:51.5 3rd Qu.: 55.00 3rd Qu.: 75.0
## Max. :100.00 Max. :98.0 Max. :100.00 Max. :100.0
## NA's :146 NA's :146 NA's :146 NA's :146
## NT_FG_D1_CT NT_FG_D2 NT_FG_D2_PT NT_FG_D2_CT
## Min. : 0.00 Min. : 0.00 Min. : 0.00 Min. : 0.00
## 1st Qu.: 20.00 1st Qu.:26.00 1st Qu.: 50.00 1st Qu.: 20.00
## Median : 35.00 Median :39.00 Median : 65.00 Median : 35.00
## Mean : 34.91 Mean :37.78 Mean : 55.74 Mean : 33.36
## 3rd Qu.: 50.00 3rd Qu.:52.00 3rd Qu.: 75.00 3rd Qu.: 50.00
## Max. :100.00 Max. :99.00 Max. :100.00 Max. :100.00
## NA's :146 NA's :146 NA's :146 NA's :146
## NT_CE NT_OBJ_CE NT_DIS_CE NT_CE_D1
## Min. : 0.00 Min. : 0.00 Min. : 0.00 Min. : 0.00
## 1st Qu.:28.90 1st Qu.: 31.30 1st Qu.: 10.00 1st Qu.: 0.00
## Median :39.70 Median : 42.10 Median : 25.00 Median : 25.00
## Mean :40.44 Mean : 42.99 Mean : 25.95 Mean : 27.78
## 3rd Qu.:51.20 3rd Qu.: 55.00 3rd Qu.: 40.00 3rd Qu.: 50.00
## Max. :97.50 Max. :100.00 Max. :100.00 Max. :100.00
## NA's :146 NA's :146 NA's :146 NA's :146
## NT_CE_D2 NT_CE_D3 CO_RS_I1 CO_RS_I2
## Min. : 0.00 Min. : 0.00 Length:462241 Length:462241
## 1st Qu.: 0.00 1st Qu.: 0.00 Class :character Class :character
## Median : 15.00 Median : 25.00 Mode :character Mode :character
## Mean : 22.94 Mean : 27.13
## 3rd Qu.: 40.00 3rd Qu.: 50.00
## Max. :100.00 Max. :100.00
## NA's :146 NA's :146
## CO_RS_I3 CO_RS_I4 CO_RS_I5 CO_RS_I6
## Length:462241 Length:462241 Length:462241 Length:462241
## Class :character Class :character Class :character Class :character
## Mode :character Mode :character Mode :character Mode :character
##
##
##
##
## CO_RS_I7 CO_RS_I8 CO_RS_I9 QE_I01
## Length:462241 Length:462241 Length:462241 Length:462241
## Class :character Class :character Class :character Class :character
## Mode :character Mode :character Mode :character Mode :character
##
##
##
##
## QE_I02 QE_I03 QE_I04 QE_I05
## Length:462241 Length:462241 Length:462241 Length:462241
## Class :character Class :character Class :character Class :character
## Mode :character Mode :character Mode :character Mode :character
##
##
##
##
## QE_I06 QE_I07 QE_I08 QE_I09
## Length:462241 Length:462241 Length:462241 Length:462241
## Class :character Class :character Class :character Class :character
## Mode :character Mode :character Mode :character Mode :character
##
##
##
##
## QE_I10 QE_I11 QE_I12 QE_I13
## Length:462241 Length:462241 Length:462241 Length:462241
## Class :character Class :character Class :character Class :character
## Mode :character Mode :character Mode :character Mode :character
##
##
##
##
## QE_I14 QE_I15 QE_I16 QE_I17
## Length:462241 Length:462241 Min. :11.00 Length:462241
## Class :character Class :character 1st Qu.:28.00 Class :character
## Mode :character Mode :character Median :33.00 Mode :character
## Mean :33.13
## 3rd Qu.:41.00
## Max. :99.00
## NA's :2534
## QE_I18 QE_I19 QE_I20 QE_I21
## Length:462241 Length:462241 Length:462241 Length:462241
## Class :character Class :character Class :character Class :character
## Mode :character Mode :character Mode :character Mode :character
##
##
##
##
## QE_I22 QE_I23 QE_I24 QE_I25
## Length:462241 Length:462241 Length:462241 Length:462241
## Class :character Class :character Class :character Class :character
## Mode :character Mode :character Mode :character Mode :character
##
##
##
##
## QE_I26 QE_I27 QE_I28 QE_I29
## Length:462241 Min. :1.00 Min. :1.000 Min. :1.000
## Class :character 1st Qu.:5.00 1st Qu.:5.000 1st Qu.:4.000
## Mode :character Median :6.00 Median :6.000 Median :5.000
## Mean :5.26 Mean :5.083 Mean :5.001
## 3rd Qu.:6.00 3rd Qu.:6.000 3rd Qu.:6.000
## Max. :6.00 Max. :6.000 Max. :6.000
## NA's :6499 NA's :17422 NA's :6497
## QE_I30 QE_I31 QE_I32 QE_I33
## Min. :1.000 Min. :1.000 Min. :1.000 Min. :1.000
## 1st Qu.:4.000 1st Qu.:5.000 1st Qu.:5.000 1st Qu.:5.000
## Median :5.000 Median :6.000 Median :6.000 Median :6.000
## Mean :4.927 Mean :5.308 Mean :5.155 Mean :5.296
## 3rd Qu.:6.000 3rd Qu.:6.000 3rd Qu.:6.000 3rd Qu.:6.000
## Max. :6.000 Max. :6.000 Max. :6.000 Max. :6.000
## NA's :7452 NA's :6347 NA's :11037 NA's :5652
## QE_I34 QE_I35 QE_I36 QE_I37
## Min. :1.000 Min. :1.000 Min. :1.000 Min. :1.000
## 1st Qu.:5.000 1st Qu.:5.000 1st Qu.:5.000 1st Qu.:4.000
## Median :6.000 Median :6.000 Median :6.000 Median :5.000
## Mean :5.266 Mean :5.195 Mean :5.202 Mean :4.889
## 3rd Qu.:6.000 3rd Qu.:6.000 3rd Qu.:6.000 3rd Qu.:6.000
## Max. :6.000 Max. :6.000 Max. :6.000 Max. :6.000
## NA's :6940 NA's :6418 NA's :6190 NA's :8779
## QE_I38 QE_I39 QE_I40 QE_I41
## Min. :1.000 Min. :1.000 Min. :1.000 Min. :1.000
## 1st Qu.:4.000 1st Qu.:4.000 1st Qu.:4.000 1st Qu.:4.000
## Median :5.000 Median :5.000 Median :5.000 Median :5.000
## Mean :4.919 Mean :5.016 Mean :4.633 Mean :4.833
## 3rd Qu.:6.000 3rd Qu.:6.000 3rd Qu.:6.000 3rd Qu.:6.000
## Max. :6.000 Max. :6.000 Max. :6.000 Max. :6.000
## NA's :7107 NA's :9830 NA's :24533 NA's :9263
## QE_I42 QE_I43 QE_I44 QE_I45
## Min. :1.000 Min. :1.000 Min. :1.00 Min. :1.000
## 1st Qu.:5.000 1st Qu.:4.000 1st Qu.:4.00 1st Qu.:4.000
## Median :6.000 Median :5.000 Median :5.00 Median :5.000
## Mean :5.157 Mean :4.735 Mean :4.65 Mean :4.875
## 3rd Qu.:6.000 3rd Qu.:6.000 3rd Qu.:6.00 3rd Qu.:6.000
## Max. :6.000 Max. :6.000 Max. :6.00 Max. :6.000
## NA's :5591 NA's :29633 NA's :37501 NA's :20098
## QE_I46 QE_I47 QE_I48 QE_I49
## Min. :1.0 Min. :1.000 Min. :1.000 Min. :1.000
## 1st Qu.:3.0 1st Qu.:4.000 1st Qu.:4.000 1st Qu.:5.000
## Median :5.0 Median :5.000 Median :5.000 Median :6.000
## Mean :4.4 Mean :4.828 Mean :4.653 Mean :5.068
## 3rd Qu.:6.0 3rd Qu.:6.000 3rd Qu.:6.000 3rd Qu.:6.000
## Max. :6.0 Max. :6.000 Max. :6.000 Max. :6.000
## NA's :82720 NA's :17926 NA's :19243 NA's :8118
## QE_I50 QE_I51 QE_I52 QE_I53
## Min. :1.00 Min. :1.00 Min. :1.00 Min. :1.00
## 1st Qu.:5.00 1st Qu.:5.00 1st Qu.:2.00 1st Qu.:1.00
## Median :6.00 Median :6.00 Median :5.00 Median :4.00
## Mean :5.03 Mean :5.14 Mean :4.04 Mean :3.75
## 3rd Qu.:6.00 3rd Qu.:6.00 3rd Qu.:6.00 3rd Qu.:6.00
## Max. :6.00 Max. :6.00 Max. :6.00 Max. :6.00
## NA's :77521 NA's :46616 NA's :109314 NA's :127025
## QE_I54 QE_I55 QE_I56 QE_I57
## Min. :1.000 Min. :1.000 Min. :1.000 Min. :1.000
## 1st Qu.:5.000 1st Qu.:5.000 1st Qu.:4.000 1st Qu.:5.000
## Median :6.000 Median :6.000 Median :5.000 Median :6.000
## Mean :5.059 Mean :5.102 Mean :4.859 Mean :5.166
## 3rd Qu.:6.000 3rd Qu.:6.000 3rd Qu.:6.000 3rd Qu.:6.000
## Max. :6.000 Max. :6.000 Max. :6.000 Max. :6.000
## NA's :23102 NA's :9150 NA's :18979 NA's :6456
## QE_I58 QE_I59 QE_I60 QE_I61
## Min. :1.000 Min. :1.0 Min. :1.00 Min. :1.000
## 1st Qu.:5.000 1st Qu.:4.0 1st Qu.:4.00 1st Qu.:4.000
## Median :6.000 Median :5.0 Median :5.00 Median :5.000
## Mean :5.079 Mean :4.9 Mean :4.69 Mean :4.883
## 3rd Qu.:6.000 3rd Qu.:6.0 3rd Qu.:6.00 3rd Qu.:6.000
## Max. :6.000 Max. :6.0 Max. :6.00 Max. :6.000
## NA's :16077 NA's :13621 NA's :32892 NA's :12134
## QE_I62 QE_I63 QE_I64 QE_I65
## Min. :1.00 Min. :1.0 Min. :1.000 Min. :1.00
## 1st Qu.:4.00 1st Qu.:4.0 1st Qu.:4.000 1st Qu.:4.00
## Median :5.00 Median :5.0 Median :6.000 Median :6.00
## Mean :4.88 Mean :4.9 Mean :4.932 Mean :4.95
## 3rd Qu.:6.00 3rd Qu.:6.0 3rd Qu.:6.000 3rd Qu.:6.00
## Max. :6.00 Max. :6.0 Max. :6.000 Max. :6.00
## NA's :40857 NA's :47400 NA's :18996 NA's :40617
## QE_I66 QE_I67 QE_I68
## Min. :1.000 Min. :1.00 Min. :1.000
## 1st Qu.:5.000 1st Qu.:4.00 1st Qu.:4.000
## Median :6.000 Median :5.00 Median :6.000
## Mean :5.148 Mean :4.71 Mean :4.924
## 3rd Qu.:6.000 3rd Qu.:6.00 3rd Qu.:6.000
## Max. :6.000 Max. :6.00 Max. :6.000
## NA's :19788 NA's :37882 NA's :18496
qqnorm(NT_GER)
qqline(NT_GER)
library(ggplot2)
ggplot(presente)+
aes(x=NT_GER, color = NT_GER, fill = NT_GER)+
geom_density(alpha = 0.25)
## Warning: Removed 146 rows containing non-finite values (stat_density).
cores=c('blue', 'red', 'pink', 'orange', 'gray',
'#fb5772', '#d953bd', '#c26a31', '#919c75', '#d312b4',
'#4549e5', '#6f95ef', '#f15050', '#54c2de', '#8f2e78',
'#1412ef', '#9f8e03', '#e86255', '#6e2802', '#318f5d',
'#9d0cee', '#95b631', '#376ab5', '#ed53c0', '#a76600')
boxplot(NT_GER~CO_UF_CURSO, ylab = "notas", xlab = "UF", col = cores)
11 = Rondônia (RO)
12 = Acre (AC)
13 = Amazonas (AM)
14 = Roraima (RR)
15 = Pará (PA)
16 = Amapa (AP)
17 = Tocantins (TO)
21 = Maranhão (MA)
22= Piauí (PI)
23 = Ceará (CE)
24 = Rio Grande do Norte (RN)
25 = Paraíba (PB)
26 = Pernambuco (PE)
27 = Alagoas (AL)
28 = Sergipe (SE)
29 = Bahia (BA)
31 = Minas gerais (MG)
32 = Espírito Santo (ES)
33 = Rio de Janeiro (RJ)
35 = São Paulo (SP)
41 = Paraná (PR)
42 = Santa Catarina (SC)
43 = Rio Grande do Sul (RS)
50 = Mato Grosso do Sul (MS)
51 = Mato Grosso (MT)
52 = Goiás (GO)
53 = Distrito federal (DF)
with(presente,tapply(NT_GER,CO_UF_CURSO,mean,na.rm=T))
## 11 12 13 14 15 16 17 21
## 40.03613 41.53357 39.60202 37.24309 41.92964 39.59247 36.93470 40.94839
## 22 23 24 25 26 27 28 29
## 40.45117 43.56311 42.32794 42.60988 41.19575 40.13705 41.77534 41.11277
## 31 32 33 35 41 42 43 50
## 43.79389 45.69736 43.31639 41.88049 39.86093 40.81255 43.51007 38.06465
## 51 52 53
## 38.72868 39.57230 43.76826
A = Muito fácil.
B = Fácil.
C = Médio.
D = Difícil.
E = Muito difícil.
. = Sem resposta.
* = Resposta anulada.
with(presente,tapply(NT_GER,CO_RS_I1,mean,na.rm=T))
## * . A B C D E
## 36.89067 39.18383 40.70552 48.38982 42.73278 39.44207 36.63789
H0: A média das notas dos alunos que acharam a prova fácil foi igual à dos alunos que acharam a prova muito fácil.
H1: A média das notas dos alunos que acharam a prova fácil foi diferente das médias dos alunos que acharam a prova muito fácil.
Para realização do bootstrap utilizamos os alunos que responderam as alternativas “B” e “A”.
x1 <- presente[presente$CO_RS_I1 == "B","NT_GER"]
x1 <- na.exclude(x1)
n1 <- length(x1)
x2 <- presente[presente$CO_RS_I1 == "A","NT_GER"]
x2 <- na.exclude(x2)
n2 <- length(x2)
theta <- as.vector(NULL)# Um vetor para receber as diferenças de médias
for (i in 1:1000){
xx1 <- sample(x1, n1, replace=TRUE)
xx2 <- sample(x2, n2, replace = TRUE)
theta[i] <- mean(xx1)-mean(xx2)
}
quantile(theta, probs = c(.025,0.975), na.rm = T)# Efron percentile CI on difference in means
## 2.5% 97.5%
## 7.284054 8.078462
Como podemos observar resultado, a diferença entre as notas ficou no intervalo entre 7.29 e 8.06. Com 95% de confiança podemos afirmar que não temos elementos suficientes para aceitar a hipótese nula em que as médias das notas dos dois grupos são iguais. O valor zero não consta no intervalo de confiança.
a <- presente[presente$CO_RS_I1 == "A" | presente$CO_RS_I1 == "B" ,]
ggplot(a)+
geom_histogram(aes(x = NT_GER), color = "blue", fill = "white") +
facet_wrap(~CO_RS_I1, nrow = 2)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 11 rows containing non-finite values (stat_bin).
boxplot(NT_GER~CO_RS_I1, ylab = "notas", xlab = "Alternativas", col = cores)
1 - Discordo totalmente
2 - Discordo
…
5 - Concordo
6 - Concordo totalmente
7 - Não se aplica
8 - Não sei responder
Notas médias por alternativa:
with(presente,tapply(NT_GER,QE_I37,mean,na.rm=T))
## 1 2 3 4 5 6
## 41.98554 43.89769 42.94129 42.97092 42.21688 40.98283
a <- presente[presente$QE_I37 >= 1 & presente$QE_I37 < 7 , ]
a <- na.exclude(a)
ggplot(a)+
geom_histogram(aes(x = NT_GER), color = "blue", fill = "white") +
facet_wrap(~QE_I37, nrow = 2)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
boxplot(NT_GER~QE_I37, ylab = "notas", xlab = "Alternativas", col = cores)
H0: A média das notas dos alunos que concordaram que a relação professor-aluno influenciou no resultado é igual à média das notas dos alunos que não concordaram.
H1: A média das notas dos alunos que concordaram que a relação professor-aluno influenciou no resultado é diferente da média das notas dos alunos que não concordaram.
A aplicação do Bootstrap foi entre os grupos que de alguma forma concordaram (parcial ou total) e os grupos que discordaram (parcial ou total)
x1 <- presente[presente$QE_I37 >= 1 & presente$QE_I37 < 4,"NT_GER"]
x1 <- na.exclude(x1)
n1 <- length(x1)
x2 <- presente[presente$QE_I37 >= 4 & presente$QE_I37 < 7,"NT_GER"]
x2 <- na.exclude(x2)
n2 <- length(x2)
theta <- as.vector(NULL)# Um vetor para receber as diferenças de médias
for (i in 1:1000){
xx1 <- sample(x1, n1, replace=TRUE)
xx2 <- sample(x2, n2, replace = TRUE)
theta[i] <- mean(xx1)-mean(xx2)
}
quantile(theta, probs = c(.025,0.975), na.rm = T)# Efron percentile CI on difference in means
## 2.5% 97.5%
## 0.9896324 1.2343133
Com 95% de confiança podemos afirmar que não há elementos suficientes para aceitar a hipótese nula. O IC não passa por zero.
1 = Discordo totalmente.
2 = Discordo.
3 = Discordo parcialmente.
4 = Concordo parcialmente.
5 = Concordo.
6 = Concordo totalmente.
7 = Não se aplica.
8 = Não sei responder.
with(presente,tapply(NT_GER,QE_I27,mean,na.rm=T))
## 1 2 3 4 5 6
## 41.73196 41.12207 41.10781 41.84237 42.35511 41.75037
a <- presente[presente$QE_I27 >= 1 & presente$QE_I37 < 7 , ]
a <- na.exclude(a)
ggplot(a)+
geom_histogram(aes(x = NT_GER), color = "blue", fill = "white") +
facet_wrap(~QE_I27, nrow = 2)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
boxplot(NT_GER~QE_I27, ylab = "notas", xlab = "Alternativas", col = cores)
H0: Alunos que concordaram com a afirmação de que houve uso de TIC’s tiveram notas iguais aos que discordaram que houve uso de TIC’s pelos professores.
H1: Alunos que concordaram com a afirmação de que houve uso de TIC’s tiveram notas diferentes dos que discordaram que houve uso de TIC’s pelos professores.
A aplicação do Bootstrap foi entre os grupos que de alguma forma concordaram (parcial ou total) e os grupos que discordaram (parcial ou total)
x1 <- presente[presente$QE_I27 >= 1 & presente$QE_I27 < 4,"NT_GER"]
x1 <- na.exclude(x1)
n1 <- length(x1)
x2 <- presente[presente$QE_I27 >= 4 & presente$QE_I27 < 7,"NT_GER"]
x2 <- na.exclude(x2)
n2 <- length(x2)
theta <- as.vector(NULL)# Um vetor para receber as diferenças de médias
for (i in 1:1000){
xx1 <- sample(x1, n1, replace=TRUE)
xx2 <- sample(x2, n2, replace = TRUE)
theta[i] <- mean(xx2)-mean(xx1)
}
quantile(theta, probs = c(.025,0.975), na.rm = T)# Efron percentile CI on difference in means
## 2.5% 97.5%
## 0.3806443 0.7098353
Com 95% de confiança podemos afirmar que há elementos suficientes que nos permitam rejeitar a hipótese nula, o IC não passa por zero.
A = Inserção no mercado de trabalho.
B = Influência familiar.
C = Valorização profissional.
D = Prestígio Social.
E = Vocação.
F = Oferecido na modalidade a distância.
G = Baixa concorrência para ingresso.
H = Outro motivo.
Média das notas por alternativa:
with(presente,tapply(NT_GER,QE_I25,mean,na.rm=T))
## A B C D E F G
## 36.80122 40.37911 39.02810 40.12752 40.68909 45.28459 40.92798 45.02110
## H
## 42.24489
a <- presente[presente$QE_I25 == "E" | presente$QE_I25 == "B" ,]
ggplot(a)+
geom_histogram(aes(x = NT_GER), color = "blue", fill = "white") +
facet_wrap(~QE_I25, nrow = 2)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 34 rows containing non-finite values (stat_bin).
boxplot(NT_GER~QE_I25, ylab = "notas", xlab = "Alternativas", col = cores)
H0: As médias das notas dos alunos que escolheram o curso por influência familiar é igual aos que escolheram por vocação.
H1: As médias das notas dos alunos que escolheram o curso por influência familiar é diferente dos que escolheram por vocação.
A aplicação do bootstrap fois para os alunos que responderam as alternativas “B” e “E”
x1 <- presente[presente$QE_I25 == "E","NT_GER"]
x1 <- na.exclude(x1)
n1 <- length(x1)
x2 <- presente[presente$QE_I25 == "B","NT_GER"]
x2 <- na.exclude(x2)
n2 <- length(x2)
theta <- as.vector(NULL)# Um vetor para receber as diferenças de médias
for (i in 1:1000){
xx1 <- sample(x1, n1, replace=TRUE)
xx2 <- sample(x2, n2, replace = TRUE)
theta[i] <- mean(xx1)-mean(xx2)
}
quantile(theta, probs = c(.025,0.975), na.rm = T)# Efron percentile CI on difference in means
## 2.5% 97.5%
## 6.094480 6.440654
Com confiança de 95% podemos rejeitar a hipótese nula que afirma que a média das notas dos dois grupos são iguais.
4.1) Alunos que escolheram o curso por prestígio social tiveram notas diferentes dos que escolheram pela inserção no mercado de trabalho?
H0: A média das notas dos alunos que escolheram o curso por prestígio social é igual a média das notas dos que escolheram por inserção no mercado de trabalho.
H1: A média das notas dos alunos que escolheram o curso por prestígio social é diferente da média das notas dos que escolheram por inserção no mercado de trabalho.
a <- presente[presente$QE_I25 == "A" | presente$QE_I25 == "D" ,]
ggplot(a)+
geom_histogram(aes(x = NT_GER), color = "blue", fill = "white") +
facet_wrap(~QE_I25, nrow = 2)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 56 rows containing non-finite values (stat_bin).
A aplicação do bootstrap foi para os alunos que responderam a alternativas “A” e “D”.
x1 <- presente[presente$QE_I25 == "A","NT_GER"]
x1 <- na.exclude(x1)
n1 <- length(x1)
x2 <- presente[presente$QE_I25 == "D","NT_GER"]
x2 <- na.exclude(x2)
n2 <- length(x2)
theta <- as.vector(NULL)# Um vetor para receber as diferenças de médias
for (i in 1:1000){
xx1 <- sample(x1, n1, replace=TRUE)
xx2 <- sample(x2, n2, replace = TRUE)
theta[i] <- mean(xx1)-mean(xx2)
}
quantile(theta, probs = c(.025,0.975), na.rm = T)# Efron percentile CI on difference in means
## 2.5% 97.5%
## -0.68025678 0.05579244
Com 95% de confiança podemos afirmar que não há elementos suficientes que nos permitam rejeitar a hipótese nula, o IC passa por zero.
A = Todo em escola pública.
B = Todo em escola privada (particular).
C = Todo no exterior.
D = A maior parte em escola pública.
E = A maior parte em escola privada (particular).
F = Parte no Brasil e parte no exterior.
Nota média por alternativa:
with(presente,tapply(NT_GER,QE_I17,mean,na.rm=T))
## A B C D E F
## 36.80122 40.35699 46.43330 43.85876 39.33717 41.75436 48.21188
a <- presente[presente$QE_I17 == "A" | presente$QE_I17 == "F" ,]
ggplot(a)+
geom_histogram(aes(x = NT_GER), color = "blue", fill = "white") +
facet_wrap(~QE_I17, nrow = 2)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 109 rows containing non-finite values (stat_bin).
boxplot(NT_GER~QE_I17, ylab = "notas", xlab = "Alternativas", col = cores)
H0: A média das notas dos alunos que cursaram o ensino médio todo em escola pública é igual aos que cursaram parte no Brasil e parte no exterior. H1: A média das notas dos alunos dos dois grupos são diferentes.
A realização do Bootstrap será com os dois grupos que responderam as alternativas “A” e “F”
x1 <- presente[presente$QE_I17 == "F","NT_GER"]
x1 <- na.exclude(x1)
n1 <- length(x1)
x2 <- presente[presente$QE_I17 == "A","NT_GER"]
x2 <- na.exclude(x2)
n2 <- length(x2)
theta <- as.vector(NULL)# Um vetor para receber as diferenças de médias
for (i in 1:1000){
xx1 <- sample(x1, n1, replace=TRUE)
xx2 <- sample(x2, n2, replace = TRUE)
theta[i] <- mean(xx1)-mean(xx2)
}
quantile(theta, probs = c(.025,0.975), na.rm = T)# Efron percentile CI on difference in means
## 2.5% 97.5%
## 6.987991 8.707394
Ao nível de 95% podemos rejeitar a hipótese nula que afirma que as notas médias dos dois grupos são iguais, tendo em vista que o IC não contém zero.