saresp2 <- read.table(file="/Users/Gustavo/Documents/unb/mestrado/TRI/saresp.txt")
gab2 <- read.table(file="/Users/Gustavo/Documents/unb/mestrado/TRI/gabarito.txt")
dados <- saresp2
manha <- dados[dados[,4]=="m07",]
tarde <- dados[dados[,4]=="t07",]
noite <- dados[dados[,4]=="n07",]
gab3 <- matrix(9,nrow(gab2),ncol(gab2))
for (i in 1:nrow(gab3)) {
for (j in 1:ncol(gab3)) {
if (gab2[i,j]=="A") gab3[i,j] <- 1
if (gab2[i,j]=="B") gab3[i,j] <- 2
if (gab2[i,j]=="C") gab3[i,j] <- 3
if (gab2[i,j]=="D") gab3[i,j] <- 4
}
}
resp.manha <- manha[,5:34]
resp.manha <- as.matrix(resp.manha)
resp.m <- matrix(9,nrow(resp.manha),ncol(resp.manha))
resp.m[resp.manha=="A"] <- 1
resp.m[resp.manha=="B"] <- 2
resp.m[resp.manha=="C"] <- 3
resp.m[resp.manha=="D"] <- 4
for (i in 1:nrow(resp.m)) {
for (j in 1:ncol(resp.m)) {
if ((resp.m[i,j]!=gab3[1,j])&&(resp.m[i,j]!=9)) resp.m[i,j] <- 0
if (resp.m[i,j]==gab3[1,j]) resp.m[i,j] <- 1
}
}
resp.m[resp.m==9] <- NA
resp.tarde <- tarde[,5:34]
resp.tarde <- as.matrix(resp.tarde)
resp.t <- matrix(9,nrow(resp.tarde),ncol(resp.tarde))
resp.t[resp.tarde=="A"] <- 1
resp.t[resp.tarde=="B"] <- 2
resp.t[resp.tarde=="C"] <- 3
resp.t[resp.tarde=="D"] <- 4
for (i in 1:nrow(resp.t)) {
for (j in 1:ncol(resp.t)) {
if ((resp.t[i,j]!=gab3[2,j])&&(resp.t[i,j]!=9)) resp.t[i,j] <- 0
if (resp.t[i,j]==gab3[2,j]) resp.t[i,j] <- 1
}
}
resp.t[resp.t==9] <- NA
resp.noite <- noite[,5:34]
resp.noite <- as.matrix(resp.noite)
resp.n <- matrix(9,nrow(resp.noite),ncol(resp.noite))
resp.n[resp.noite=="A"] <- 1
resp.n[resp.noite=="B"] <- 2
resp.n[resp.noite=="C"] <- 3
resp.n[resp.noite=="D"] <- 4
for (i in 1:nrow(resp.n)) {
for (j in 1:ncol(resp.n)) {
if ((resp.n[i,j]!=gab3[3,j])&&(resp.n[i,j]!=9)) resp.n[i,j] <- 0
if (resp.n[i,j]==gab3[3,j]) resp.n[i,j] <- 1
}
}
resp.n[resp.n==9] <- NA
library(irtoys)
## Loading required package: sm
## Package 'sm', version 2.2-5.4: type help(sm) for summary information
## Loading required package: ltm
## Loading required package: MASS
##
## Attaching package: 'MASS'
## The following object is masked from 'package:sm':
##
## muscle
## Loading required package: msm
## Loading required package: polycor
resp.m.tpm <- tpm(resp.m)
par.m.est <- coef(resp.m.tpm) # cc, bb, aa
theta.m.est <- eap(resp.m, cbind(par.m.est[,3],par.m.est[,2],par.m.est[,1]), qu=normal.qu())
prof.m.est <- theta.m.est[,1]
resp.t.tpm <- tpm(resp.t)
## Warning in tpm(resp.t): Hessian matrix at convergence is not positive definite; unstable solution.
par.t.est <- coef(resp.t.tpm) # cc, bb, aa
theta.t.est <- eap(resp.t, cbind(par.t.est[,3],par.t.est[,2],par.t.est[,1]), qu=normal.qu())
prof.t.est <- theta.t.est[,1]
resp.n.tpm <- tpm(resp.n)
par.n.est <- coef(resp.n.tpm) # cc, bb, aa
theta.n.est <- eap(resp.n, cbind(par.n.est[,3],par.n.est[,2],par.n.est[,1]), qu=normal.qu())
prof.n.est <- theta.n.est[,1]
plot(par.m.est[15:19,2],par.n.est[15:19,2])
reg.mn.b <- lm(par.n.est[15:19,2]~par.m.est[15:19,2])
abline(reg.mn.b$coefficients[1],reg.mn.b$coefficients[2])
par.n.est.b.eq <- (par.n.est[,2]-reg.mn.b$coefficients[1])/reg.mn.b$coefficients[2]
## proficiencia dos alunos da noite na escala da manha
prof.n.est.eq <- (prof.n.est-reg.mn.b$coefficients[1])/reg.mn.b$coefficients[2]
prof.n.est.eq[1:20]
## [1] 1.6004172 -0.6055275 1.3853699 0.8250475 -1.0598593 -0.1565616
## [7] -0.2563121 0.9526722 -1.0050790 -1.3323227 -1.3271198 0.7949739
## [13] 1.5312178 -0.3889048 -0.2397112 0.6087457 0.2131755 -0.8025215
## [19] -1.9648335 0.3050740
alfa <- sd(par.m.est[15:19,2])/sd(par.n.est[15:19,2])
beta <- mean(par.m.est[15:19,2])-alfa*mean(par.n.est[15:19,2])
## proficiencia dos alunos da noite na escala da manha
prof.nm <- alfa*prof.n.est+beta
prof.nm[1:20]
## [1] 1.55718582 -0.47810312 1.35877501 0.84180015 -0.89728698
## [6] -0.06386997 -0.15590362 0.95955156 -0.84674456 -1.14867209
## [11] -1.14387174 0.81405310 1.49333985 -0.27823869 -0.14058699
## [16] 0.64223180 0.27726364 -0.65985732 -1.73225073 0.36205270
plot(prof.n.est,prof.n.est.eq, main = "Via Regressão Linear", xlab = "Proficiência Original", ylab = "Proficiência Equalizada")
abline(0,1)
Com a equalização das proficiencias dos alunos da noite na escala do turno da manhã via regressão linear, vemos que as proficiências equalizadas, no geral, tiveram um valor inferior as proficiênciais originais…
plot(prof.n.est,prof.nm, main = "Via Média - Desvio", xlab = "Proficiência Original", ylab = "Proficiência Equalizada")
abline(0,1)
Com a equalização das proficiencias dos alunos da noite na escala do turno da manhã via média-desvio, vemos que as proficiências equalizadas, no geral, tiveram um valor inferior as proficiênciais originais, seguindo a mesma lógica da equalização via regressão linear.