Compiled first analysis results
This commit is contained in:
356
RProject/desc_analysis.R
Normal file
356
RProject/desc_analysis.R
Normal file
@ -0,0 +1,356 @@
|
|||||||
|
##############################################################################
|
||||||
|
#----------------------------------------------------------------------------#
|
||||||
|
############################ BOXPLOTS H0 SCENARIOS ###########################
|
||||||
|
#----------------------------------------------------------------------------#
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
|
## Proportion of rejected h0 per dif value in h0 scenarios (A) by DIF size
|
||||||
|
|
||||||
|
res.null <- res.dat[res.dat$eff.size==0,]
|
||||||
|
boxplot(h0.rejected.p~dif.size,data=res.null,col=c(3,2,1),xlab='DIF size',ylab='H0 rejection proportion in target scenario')
|
||||||
|
res.null0 <- res.dat[res.dat$eff.size==0 & res.dat$dif.size==0,]
|
||||||
|
points(y=res.null0$h0.rejected.p,x=rep(3,nrow(res.null0)),col='gray',pch=3)
|
||||||
|
res.null3 <- res.dat[res.dat$eff.size==0 & res.dat$dif.size==-0.3,]
|
||||||
|
points(y=res.null3$h0.rejected.p,x=rep(2,nrow(res.null3)),col='#590b0c',pch=3)
|
||||||
|
res.null5 <- res.dat[res.dat$eff.size==0 & res.dat$dif.size==-0.5,]
|
||||||
|
points(y=res.null5$h0.rejected.p,x=rep(1,nrow(res.null5)),col='#053305',pch=3)
|
||||||
|
|
||||||
|
## Proportion of rejected h0 per dif value in h0 scenarios (A) by DIF size
|
||||||
|
|
||||||
|
par(mfrow=c(2,2))
|
||||||
|
|
||||||
|
# 0 item
|
||||||
|
res.null <- res.dat[res.dat$eff.size==0 & res.dat$nb.dif==0,]
|
||||||
|
boxplot(h0.rejected.p~dif.size,data=res.null,col=c(2),xlab='DIF size',
|
||||||
|
ylab='H0 rejection proportion in target scenario',main='No DIF',ylim=c(0,1))
|
||||||
|
points(y=res.null$h0.rejected.p,x=rep(1,nrow(res.null)),col='#590b0c',pch=3)
|
||||||
|
|
||||||
|
# 1 item
|
||||||
|
res.null <- res.dat[res.dat$eff.size==0 & res.dat$nb.dif==1,]
|
||||||
|
boxplot(h0.rejected.p~dif.size,data=res.null,col=c(3,2),xlab='DIF size',
|
||||||
|
ylab='H0 rejection proportion in target scenario',main='DIF on 1 item',ylim=c(0,1))
|
||||||
|
res.null3 <- res.null[res.null$dif.size==-0.3,]
|
||||||
|
points(y=res.null3$h0.rejected.p,x=rep(2,nrow(res.null3)),col='#590b0c',pch=3)
|
||||||
|
res.null5 <- res.null[res.null$dif.size==-0.5,]
|
||||||
|
points(y=res.null5$h0.rejected.p,x=rep(1,nrow(res.null5)),col='#053305',pch=3)
|
||||||
|
|
||||||
|
# 2 items
|
||||||
|
res.null <- res.dat[res.dat$eff.size==0 & res.dat$nb.dif==2,]
|
||||||
|
boxplot(h0.rejected.p~dif.size,data=res.null,col=c(3,2),xlab='DIF size',
|
||||||
|
ylab='H0 rejection proportion in target scenario',main='DIF on 2 items',ylim=c(0,1))
|
||||||
|
res.null3 <- res.null[res.null$dif.size==-0.3,]
|
||||||
|
points(y=res.null3$h0.rejected.p,x=rep(2,nrow(res.null3)),col='#590b0c',pch=3)
|
||||||
|
res.null5 <- res.null[res.null$dif.size==-0.5,]
|
||||||
|
points(y=res.null5$h0.rejected.p,x=rep(1,nrow(res.null5)),col='#053305',pch=3)
|
||||||
|
|
||||||
|
# 3 items
|
||||||
|
res.null <- res.dat[res.dat$eff.size==0 & res.dat$nb.dif==3,]
|
||||||
|
boxplot(h0.rejected.p~dif.size,data=res.null,col=c(3,2),xlab='DIF size',
|
||||||
|
ylab='H0 rejection proportion in target scenario',main='DIF on 3 items',ylim=c(0,1))
|
||||||
|
res.null3 <- res.null[res.null$dif.size==-0.3,]
|
||||||
|
points(y=res.null3$h0.rejected.p,x=rep(2,nrow(res.null3)),col='#590b0c',pch=3)
|
||||||
|
res.null5 <- res.null[res.null$dif.size==-0.5,]
|
||||||
|
points(y=res.null5$h0.rejected.p,x=rep(1,nrow(res.null5)),col='#053305',pch=3)
|
||||||
|
|
||||||
|
par(mfrow=c(1,1))
|
||||||
|
|
||||||
|
## Proportion of rejected h0 per dif value in h0 scenarios (A) by DIF size (1 item) J=4
|
||||||
|
|
||||||
|
par(mfrow=c(2,2))
|
||||||
|
|
||||||
|
# 0 item
|
||||||
|
res.null <- res.dat[res.dat$eff.size==0 & res.dat$nb.dif==0 & res.dat$J==4,]
|
||||||
|
boxplot(h0.rejected.p~dif.size,data=res.null,col=c(2),xlab='DIF size',
|
||||||
|
ylab='H0 rejection proportion in target scenario',main='No DIF',ylim=c(0,1))
|
||||||
|
points(y=res.null$h0.rejected.p,x=rep(1,nrow(res.null)),col='#590b0c',pch=3)
|
||||||
|
|
||||||
|
# 1 item
|
||||||
|
res.null <- res.dat[res.dat$eff.size==0 & res.dat$nb.dif==1 & res.dat$J==4,]
|
||||||
|
boxplot(h0.rejected.p~dif.size,data=res.null,col=c(3,2),xlab='DIF size',
|
||||||
|
ylab='H0 rejection proportion in target scenario',main='DIF on 1 item',ylim=c(0,1))
|
||||||
|
res.null3 <- res.null[res.null$dif.size==-0.3,]
|
||||||
|
points(y=res.null3$h0.rejected.p,x=rep(2,nrow(res.null3)),col='#590b0c',pch=3)
|
||||||
|
res.null5 <- res.null[res.null$dif.size==-0.5,]
|
||||||
|
points(y=res.null5$h0.rejected.p,x=rep(1,nrow(res.null5)),col='#053305',pch=3)
|
||||||
|
|
||||||
|
# 2 items
|
||||||
|
res.null <- res.dat[res.dat$eff.size==0 & res.dat$nb.dif==2 & res.dat$J==4,]
|
||||||
|
boxplot(h0.rejected.p~dif.size,data=res.null,col=c(3,2),xlab='DIF size',
|
||||||
|
ylab='H0 rejection proportion in target scenario',main='DIF on 2 items',ylim=c(0,1))
|
||||||
|
res.null3 <- res.null[res.null$dif.size==-0.3,]
|
||||||
|
points(y=res.null3$h0.rejected.p,x=rep(2,nrow(res.null3)),col='#590b0c',pch=3)
|
||||||
|
res.null5 <- res.null[res.null$dif.size==-0.5,]
|
||||||
|
points(y=res.null5$h0.rejected.p,x=rep(1,nrow(res.null5)),col='#053305',pch=3)
|
||||||
|
|
||||||
|
par(mfrow=c(1,1))
|
||||||
|
|
||||||
|
|
||||||
|
## Proportion of rejected h0 per dif value in h0 scenarios (A) by DIF size (1 item) J=7
|
||||||
|
|
||||||
|
par(mfrow=c(2,2))
|
||||||
|
|
||||||
|
# 0 item
|
||||||
|
res.null <- res.dat[res.dat$eff.size==0 & res.dat$nb.dif==0 & res.dat$J==7,]
|
||||||
|
nrow(res.null)
|
||||||
|
boxplot(h0.rejected.p~dif.size,data=res.null,col=c(2),xlab='DIF size',
|
||||||
|
ylab='H0 rejection proportion in target scenario',main='No DIF',ylim=c(0,1))
|
||||||
|
points(y=res.null$h0.rejected.p,x=rep(1,nrow(res.null)),col='#590b0c',pch=3)
|
||||||
|
|
||||||
|
# 2 items
|
||||||
|
res.null <- res.dat[res.dat$eff.size==0 & res.dat$nb.dif==2 & res.dat$J==7,]
|
||||||
|
boxplot(h0.rejected.p~dif.size,data=res.null,col=c(3,2),xlab='DIF size',
|
||||||
|
ylab='H0 rejection proportion in target scenario',main='DIF on 2 items',ylim=c(0,1))
|
||||||
|
res.null3 <- res.null[res.null$dif.size==-0.3,]
|
||||||
|
points(y=res.null3$h0.rejected.p,x=rep(2,nrow(res.null3)),col='#590b0c',pch=3)
|
||||||
|
res.null5 <- res.null[res.null$dif.size==-0.5,]
|
||||||
|
points(y=res.null5$h0.rejected.p,x=rep(1,nrow(res.null5)),col='#053305',pch=3)
|
||||||
|
|
||||||
|
# 3 items
|
||||||
|
res.null <- res.dat[res.dat$eff.size==0 & res.dat$nb.dif==3 & res.dat$J==7,]
|
||||||
|
boxplot(h0.rejected.p~dif.size,data=res.null,col=c(3,2),xlab='DIF size',
|
||||||
|
ylab='H0 rejection proportion in target scenario',main='DIF on 3 items',ylim=c(0,1))
|
||||||
|
res.null3 <- res.null[res.null$dif.size==-0.3,]
|
||||||
|
points(y=res.null3$h0.rejected.p,x=rep(2,nrow(res.null3)),col='#590b0c',pch=3)
|
||||||
|
res.null5 <- res.null[res.null$dif.size==-0.5,]
|
||||||
|
points(y=res.null5$h0.rejected.p,x=rep(1,nrow(res.null5)),col='#053305',pch=3)
|
||||||
|
|
||||||
|
par(mfrow=c(1,1))
|
||||||
|
|
||||||
|
############# By N
|
||||||
|
|
||||||
|
####### N=100
|
||||||
|
|
||||||
|
|
||||||
|
par(mfrow=c(2,2))
|
||||||
|
|
||||||
|
# 0 item
|
||||||
|
res.null <- res.dat[res.dat$eff.size==0 & res.dat$nb.dif==0 & res.dat$N==100,]
|
||||||
|
boxplot(h0.rejected.p~dif.size,data=res.null,col=c(2),xlab='DIF size',
|
||||||
|
ylab='H0 rejection proportion in target scenario',main='No DIF',ylim=c(0,1))
|
||||||
|
points(y=res.null$h0.rejected.p,x=rep(1,nrow(res.null)),col='#590b0c',pch=3)
|
||||||
|
|
||||||
|
# 1 item
|
||||||
|
res.null <- res.dat[res.dat$eff.size==0 & res.dat$nb.dif==1 & res.dat$N==100,]
|
||||||
|
boxplot(h0.rejected.p~dif.size,data=res.null,col=c(3,2),xlab='DIF size',
|
||||||
|
ylab='H0 rejection proportion in target scenario',main='DIF on 1 item',ylim=c(0,1))
|
||||||
|
res.null3 <- res.null[res.null$dif.size==-0.3,]
|
||||||
|
points(y=res.null3$h0.rejected.p,x=rep(2,nrow(res.null3)),col='#590b0c',pch=3)
|
||||||
|
res.null5 <- res.null[res.null$dif.size==-0.5,]
|
||||||
|
points(y=res.null5$h0.rejected.p,x=rep(1,nrow(res.null5)),col='#053305',pch=3)
|
||||||
|
|
||||||
|
# 2 items
|
||||||
|
res.null <- res.dat[res.dat$eff.size==0 & res.dat$nb.dif==2 & res.dat$N==100,]
|
||||||
|
boxplot(h0.rejected.p~dif.size,data=res.null,col=c(3,2),xlab='DIF size',
|
||||||
|
ylab='H0 rejection proportion in target scenario',main='DIF on 2 items',ylim=c(0,1))
|
||||||
|
res.null3 <- res.null[res.null$dif.size==-0.3,]
|
||||||
|
points(y=res.null3$h0.rejected.p,x=rep(2,nrow(res.null3)),col='#590b0c',pch=3)
|
||||||
|
res.null5 <- res.null[res.null$dif.size==-0.5,]
|
||||||
|
points(y=res.null5$h0.rejected.p,x=rep(1,nrow(res.null5)),col='#053305',pch=3)
|
||||||
|
|
||||||
|
# 3 items
|
||||||
|
res.null <- res.dat[res.dat$eff.size==0 & res.dat$nb.dif==3 & res.dat$N==100,]
|
||||||
|
boxplot(h0.rejected.p~dif.size,data=res.null,col=c(3,2),xlab='DIF size',
|
||||||
|
ylab='H0 rejection proportion in target scenario',main='DIF on 3 items',ylim=c(0,1))
|
||||||
|
res.null3 <- res.null[res.null$dif.size==-0.3,]
|
||||||
|
points(y=res.null3$h0.rejected.p,x=rep(2,nrow(res.null3)),col='#590b0c',pch=3)
|
||||||
|
res.null5 <- res.null[res.null$dif.size==-0.5,]
|
||||||
|
points(y=res.null5$h0.rejected.p,x=rep(1,nrow(res.null5)),col='#053305',pch=3)
|
||||||
|
|
||||||
|
par(mfrow=c(1,1))
|
||||||
|
|
||||||
|
|
||||||
|
####### N=200
|
||||||
|
|
||||||
|
|
||||||
|
par(mfrow=c(2,2))
|
||||||
|
|
||||||
|
# 0 item
|
||||||
|
res.null <- res.dat[res.dat$eff.size==0 & res.dat$nb.dif==0 & res.dat$N==200,]
|
||||||
|
boxplot(h0.rejected.p~dif.size,data=res.null,col=c(2),xlab='DIF size',
|
||||||
|
ylab='H0 rejection proportion in target scenario',main='No DIF',ylim=c(0,1))
|
||||||
|
points(y=res.null$h0.rejected.p,x=rep(1,nrow(res.null)),col='#590b0c',pch=3)
|
||||||
|
|
||||||
|
# 1 item
|
||||||
|
res.null <- res.dat[res.dat$eff.size==0 & res.dat$nb.dif==1 & res.dat$N==200,]
|
||||||
|
boxplot(h0.rejected.p~dif.size,data=res.null,col=c(3,2),xlab='DIF size',
|
||||||
|
ylab='H0 rejection proportion in target scenario',main='DIF on 1 item',ylim=c(0,1))
|
||||||
|
res.null3 <- res.null[res.null$dif.size==-0.3,]
|
||||||
|
points(y=res.null3$h0.rejected.p,x=rep(2,nrow(res.null3)),col='#590b0c',pch=3)
|
||||||
|
res.null5 <- res.null[res.null$dif.size==-0.5,]
|
||||||
|
points(y=res.null5$h0.rejected.p,x=rep(1,nrow(res.null5)),col='#053305',pch=3)
|
||||||
|
|
||||||
|
# 2 items
|
||||||
|
res.null <- res.dat[res.dat$eff.size==0 & res.dat$nb.dif==2 & res.dat$N==200,]
|
||||||
|
boxplot(h0.rejected.p~dif.size,data=res.null,col=c(3,2),xlab='DIF size',
|
||||||
|
ylab='H0 rejection proportion in target scenario',main='DIF on 2 items',ylim=c(0,1))
|
||||||
|
res.null3 <- res.null[res.null$dif.size==-0.3,]
|
||||||
|
points(y=res.null3$h0.rejected.p,x=rep(2,nrow(res.null3)),col='#590b0c',pch=3)
|
||||||
|
res.null5 <- res.null[res.null$dif.size==-0.5,]
|
||||||
|
points(y=res.null5$h0.rejected.p,x=rep(1,nrow(res.null5)),col='#053305',pch=3)
|
||||||
|
|
||||||
|
# 3 items
|
||||||
|
res.null <- res.dat[res.dat$eff.size==0 & res.dat$nb.dif==3 & res.dat$N==200,]
|
||||||
|
boxplot(h0.rejected.p~dif.size,data=res.null,col=c(3,2),xlab='DIF size',
|
||||||
|
ylab='H0 rejection proportion in target scenario',main='DIF on 3 items',ylim=c(0,1))
|
||||||
|
res.null3 <- res.null[res.null$dif.size==-0.3,]
|
||||||
|
points(y=res.null3$h0.rejected.p,x=rep(2,nrow(res.null3)),col='#590b0c',pch=3)
|
||||||
|
res.null5 <- res.null[res.null$dif.size==-0.5,]
|
||||||
|
points(y=res.null5$h0.rejected.p,x=rep(1,nrow(res.null5)),col='#053305',pch=3)
|
||||||
|
|
||||||
|
par(mfrow=c(1,1))
|
||||||
|
|
||||||
|
|
||||||
|
####### N=300
|
||||||
|
|
||||||
|
|
||||||
|
par(mfrow=c(2,2))
|
||||||
|
|
||||||
|
# 0 item
|
||||||
|
res.null <- res.dat[res.dat$eff.size==0 & res.dat$nb.dif==0 & res.dat$N==300,]
|
||||||
|
boxplot(h0.rejected.p~dif.size,data=res.null,col=c(2),xlab='DIF size',
|
||||||
|
ylab='H0 rejection proportion in target scenario',main='No DIF',ylim=c(0,1))
|
||||||
|
points(y=res.null$h0.rejected.p,x=rep(1,nrow(res.null)),col='#590b0c',pch=3)
|
||||||
|
|
||||||
|
# 1 item
|
||||||
|
res.null <- res.dat[res.dat$eff.size==0 & res.dat$nb.dif==1 & res.dat$N==300,]
|
||||||
|
boxplot(h0.rejected.p~dif.size,data=res.null,col=c(3,2),xlab='DIF size',
|
||||||
|
ylab='H0 rejection proportion in target scenario',main='DIF on 1 item',ylim=c(0,1))
|
||||||
|
res.null3 <- res.null[res.null$dif.size==-0.3,]
|
||||||
|
points(y=res.null3$h0.rejected.p,x=rep(2,nrow(res.null3)),col='#590b0c',pch=3)
|
||||||
|
res.null5 <- res.null[res.null$dif.size==-0.5,]
|
||||||
|
points(y=res.null5$h0.rejected.p,x=rep(1,nrow(res.null5)),col='#053305',pch=3)
|
||||||
|
|
||||||
|
# 2 items
|
||||||
|
res.null <- res.dat[res.dat$eff.size==0 & res.dat$nb.dif==2 & res.dat$N==300,]
|
||||||
|
boxplot(h0.rejected.p~dif.size,data=res.null,col=c(3,2),xlab='DIF size',
|
||||||
|
ylab='H0 rejection proportion in target scenario',main='DIF on 2 items',ylim=c(0,1))
|
||||||
|
res.null3 <- res.null[res.null$dif.size==-0.3,]
|
||||||
|
points(y=res.null3$h0.rejected.p,x=rep(2,nrow(res.null3)),col='#590b0c',pch=3)
|
||||||
|
res.null5 <- res.null[res.null$dif.size==-0.5,]
|
||||||
|
points(y=res.null5$h0.rejected.p,x=rep(1,nrow(res.null5)),col='#053305',pch=3)
|
||||||
|
|
||||||
|
# 3 items
|
||||||
|
res.null <- res.dat[res.dat$eff.size==0 & res.dat$nb.dif==3 & res.dat$N==300,]
|
||||||
|
boxplot(h0.rejected.p~dif.size,data=res.null,col=c(3,2),xlab='DIF size',
|
||||||
|
ylab='H0 rejection proportion in target scenario',main='DIF on 3 items',ylim=c(0,1))
|
||||||
|
res.null3 <- res.null[res.null$dif.size==-0.3,]
|
||||||
|
points(y=res.null3$h0.rejected.p,x=rep(2,nrow(res.null3)),col='#590b0c',pch=3)
|
||||||
|
res.null5 <- res.null[res.null$dif.size==-0.5,]
|
||||||
|
points(y=res.null5$h0.rejected.p,x=rep(1,nrow(res.null5)),col='#053305',pch=3)
|
||||||
|
|
||||||
|
par(mfrow=c(1,1))
|
||||||
|
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
#----------------------------------------------------------------------------#
|
||||||
|
########################## SYSTEMATIC ERROR BOXPLOTS #########################
|
||||||
|
#----------------------------------------------------------------------------#
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
|
# Overall
|
||||||
|
|
||||||
|
boxplot(true.value.in.ci.p~dif.size,data=res.dat,col=c(2,3),xlab='DIF size',
|
||||||
|
ylab='Proportion of true beta value in CI in target scenario',main='DIF on 3 items',ylim=c(0,1))
|
||||||
|
res.null3 <- res.dat[res.dat$dif.size==-0.5,]
|
||||||
|
points(y=res.null3$true.value.in.ci.p,x=rep(1,nrow(res.null3)),col='#590b0c',pch=3)
|
||||||
|
res.null3 <- res.dat[res.dat$dif.size==0.5,]
|
||||||
|
points(y=res.null3$true.value.in.ci.p,x=rep(5,nrow(res.null3)),col='#590b0c',pch=3)
|
||||||
|
res.null3 <- res.dat[res.dat$dif.size==-0.3,]
|
||||||
|
points(y=res.null3$true.value.in.ci.p,x=rep(2,nrow(res.null3)),col='#053305',pch=3)
|
||||||
|
res.null3 <- res.dat[res.dat$dif.size==0.3,]
|
||||||
|
points(y=res.null3$true.value.in.ci.p,x=rep(4,nrow(res.null3)),col='#053305',pch=3)
|
||||||
|
res.null3 <- res.dat[res.dat$dif.size==0,]
|
||||||
|
points(y=res.null3$true.value.in.ci.p,x=rep(3,nrow(res.null3)),col='gray',pch=3)
|
||||||
|
|
||||||
|
# J=4
|
||||||
|
res.dat.temp <- res.dat[res.dat$J==4,]
|
||||||
|
|
||||||
|
boxplot(true.value.in.ci.p~dif.size,data=res.dat.temp,col=c(2,3),xlab='DIF size',
|
||||||
|
ylab='Proportion of true beta value in CI in target scenario',main='DIF on 3 items',ylim=c(0,1))
|
||||||
|
res.null3 <- res.dat.temp[res.dat.temp$dif.size==-0.5,]
|
||||||
|
points(y=res.null3$true.value.in.ci.p,x=rep(1,nrow(res.null3)),col='#590b0c',pch=3)
|
||||||
|
res.null3 <- res.dat.temp[res.dat.temp$dif.size==0.5,]
|
||||||
|
points(y=res.null3$true.value.in.ci.p,x=rep(5,nrow(res.null3)),col='#590b0c',pch=3)
|
||||||
|
res.null3 <- res.dat.temp[res.dat.temp$dif.size==-0.3,]
|
||||||
|
points(y=res.null3$true.value.in.ci.p,x=rep(2,nrow(res.null3)),col='#053305',pch=3)
|
||||||
|
res.null3 <- res.dat.temp[res.dat.temp$dif.size==0.3,]
|
||||||
|
points(y=res.null3$true.value.in.ci.p,x=rep(4,nrow(res.null3)),col='#053305',pch=3)
|
||||||
|
res.null3 <- res.dat.temp[res.dat.temp$dif.size==0,]
|
||||||
|
points(y=res.null3$true.value.in.ci.p,x=rep(3,nrow(res.null3)),col='gray',pch=3)
|
||||||
|
|
||||||
|
|
||||||
|
# J=7
|
||||||
|
res.dat.temp <- res.dat[res.dat$J==7,]
|
||||||
|
|
||||||
|
boxplot(true.value.in.ci.p~dif.size,data=res.dat.temp,col=c(2,3),xlab='DIF size',
|
||||||
|
ylab='Proportion of true beta value in CI in target scenario',main='DIF on 3 items',ylim=c(0,1))
|
||||||
|
res.null3 <- res.dat.temp[res.dat.temp$dif.size==-0.5,]
|
||||||
|
points(y=res.null3$true.value.in.ci.p,x=rep(1,nrow(res.null3)),col='#590b0c',pch=3)
|
||||||
|
res.null3 <- res.dat.temp[res.dat.temp$dif.size==0.5,]
|
||||||
|
points(y=res.null3$true.value.in.ci.p,x=rep(5,nrow(res.null3)),col='#590b0c',pch=3)
|
||||||
|
res.null3 <- res.dat.temp[res.dat.temp$dif.size==-0.3,]
|
||||||
|
points(y=res.null3$true.value.in.ci.p,x=rep(2,nrow(res.null3)),col='#053305',pch=3)
|
||||||
|
res.null3 <- res.dat.temp[res.dat.temp$dif.size==0.3,]
|
||||||
|
points(y=res.null3$true.value.in.ci.p,x=rep(4,nrow(res.null3)),col='#053305',pch=3)
|
||||||
|
res.null3 <- res.dat.temp[res.dat.temp$dif.size==0,]
|
||||||
|
points(y=res.null3$true.value.in.ci.p,x=rep(3,nrow(res.null3)),col='gray',pch=3)
|
||||||
|
|
||||||
|
# J=4 / 1 DIF
|
||||||
|
res.dat.temp <- res.dat[res.dat$J==4 & res.dat$nb.dif==1,]
|
||||||
|
|
||||||
|
boxplot(true.value.in.ci.p~dif.size,data=res.dat.temp,col=c(2,3,3,2),xlab='DIF size',
|
||||||
|
ylab='Proportion of true beta value in CI in target scenario',main='DIF on 3 items',ylim=c(0,1))
|
||||||
|
res.null3 <- res.dat.temp[res.dat.temp$dif.size==-0.5,]
|
||||||
|
points(y=res.null3$true.value.in.ci.p,x=rep(1,nrow(res.null3)),col='#590b0c',pch=3)
|
||||||
|
res.null3 <- res.dat.temp[res.dat.temp$dif.size==0.5,]
|
||||||
|
points(y=res.null3$true.value.in.ci.p,x=rep(4,nrow(res.null3)),col='#590b0c',pch=3)
|
||||||
|
res.null3 <- res.dat.temp[res.dat.temp$dif.size==-0.3,]
|
||||||
|
points(y=res.null3$true.value.in.ci.p,x=rep(2,nrow(res.null3)),col='#053305',pch=3)
|
||||||
|
res.null3 <- res.dat.temp[res.dat.temp$dif.size==0.3,]
|
||||||
|
points(y=res.null3$true.value.in.ci.p,x=rep(3,nrow(res.null3)),col='#053305',pch=3)
|
||||||
|
|
||||||
|
# J=4 / 2 DIF
|
||||||
|
res.dat.temp <- res.dat[res.dat$J==4 & res.dat$nb.dif==2,]
|
||||||
|
|
||||||
|
boxplot(true.value.in.ci.p~dif.size,data=res.dat.temp,col=c(2,3,3,2),xlab='DIF size',
|
||||||
|
ylab='Proportion of true beta value in CI in target scenario',main='DIF on 3 items',ylim=c(0,1))
|
||||||
|
res.null3 <- res.dat.temp[res.dat.temp$dif.size==-0.5,]
|
||||||
|
points(y=res.null3$true.value.in.ci.p,x=rep(1,nrow(res.null3)),col='#590b0c',pch=3)
|
||||||
|
res.null3 <- res.dat.temp[res.dat.temp$dif.size==0.5,]
|
||||||
|
points(y=res.null3$true.value.in.ci.p,x=rep(4,nrow(res.null3)),col='#590b0c',pch=3)
|
||||||
|
res.null3 <- res.dat.temp[res.dat.temp$dif.size==-0.3,]
|
||||||
|
points(y=res.null3$true.value.in.ci.p,x=rep(2,nrow(res.null3)),col='#053305',pch=3)
|
||||||
|
res.null3 <- res.dat.temp[res.dat.temp$dif.size==0.3,]
|
||||||
|
points(y=res.null3$true.value.in.ci.p,x=rep(3,nrow(res.null3)),col='#053305',pch=3)
|
||||||
|
|
||||||
|
|
||||||
|
# J=7 / 2 DIF
|
||||||
|
|
||||||
|
res.dat.temp <- res.dat[res.dat$J==7 & res.dat$nb.dif==2,]
|
||||||
|
|
||||||
|
boxplot(true.value.in.ci.p~dif.size,data=res.dat.temp,col=c(2,3,3,2),xlab='DIF size',
|
||||||
|
ylab='Proportion of true beta value in CI in target scenario',main='DIF on 3 items',ylim=c(0,1))
|
||||||
|
res.null3 <- res.dat.temp[res.dat.temp$dif.size==-0.5,]
|
||||||
|
points(y=res.null3$true.value.in.ci.p,x=rep(1,nrow(res.null3)),col='#590b0c',pch=3)
|
||||||
|
res.null3 <- res.dat.temp[res.dat.temp$dif.size==0.5,]
|
||||||
|
points(y=res.null3$true.value.in.ci.p,x=rep(4,nrow(res.null3)),col='#590b0c',pch=3)
|
||||||
|
res.null3 <- res.dat.temp[res.dat.temp$dif.size==-0.3,]
|
||||||
|
points(y=res.null3$true.value.in.ci.p,x=rep(2,nrow(res.null3)),col='#053305',pch=3)
|
||||||
|
res.null3 <- res.dat.temp[res.dat.temp$dif.size==0.3,]
|
||||||
|
points(y=res.null3$true.value.in.ci.p,x=rep(3,nrow(res.null3)),col='#053305',pch=3)
|
||||||
|
|
||||||
|
|
||||||
|
# J=7 / 3 DIF
|
||||||
|
|
||||||
|
res.dat.temp <- res.dat[res.dat$J==7 & res.dat$nb.dif==3,]
|
||||||
|
|
||||||
|
boxplot(true.value.in.ci.p~dif.size,data=res.dat.temp,col=c(2,3,3,2),xlab='DIF size',
|
||||||
|
ylab='Proportion of true beta value in CI in target scenario',main='DIF on 3 items',ylim=c(0,1))
|
||||||
|
res.null3 <- res.dat.temp[res.dat.temp$dif.size==-0.5,]
|
||||||
|
points(y=res.null3$true.value.in.ci.p,x=rep(1,nrow(res.null3)),col='#590b0c',pch=3)
|
||||||
|
res.null3 <- res.dat.temp[res.dat.temp$dif.size==0.5,]
|
||||||
|
points(y=res.null3$true.value.in.ci.p,x=rep(4,nrow(res.null3)),col='#590b0c',pch=3)
|
||||||
|
res.null3 <- res.dat.temp[res.dat.temp$dif.size==-0.3,]
|
||||||
|
points(y=res.null3$true.value.in.ci.p,x=rep(2,nrow(res.null3)),col='#053305',pch=3)
|
||||||
|
res.null3 <- res.dat.temp[res.dat.temp$dif.size==0.3,]
|
||||||
|
points(y=res.null3$true.value.in.ci.p,x=rep(3,nrow(res.null3)),col='#053305',pch=3)
|
114
RProject/pcm.R
114
RProject/pcm.R
@ -2146,6 +2146,7 @@ for (x in results[seq(2,length(results))]) {
|
|||||||
y <- compile_simulation(x)
|
y <- compile_simulation(x)
|
||||||
res.dat <- bind_rows(res.dat,y)
|
res.dat <- bind_rows(res.dat,y)
|
||||||
}
|
}
|
||||||
|
res.dat[res.dat$scenario.type=='A','dif.size'] <- -res.dat[res.dat$scenario.type=='A','dif.size']
|
||||||
res.dat[is.na(res.dat$dif.size),'dif.size'] <- 0
|
res.dat[is.na(res.dat$dif.size),'dif.size'] <- 0
|
||||||
res.dat[132:300,'nb.dif'] <- 2
|
res.dat[132:300,'nb.dif'] <- 2
|
||||||
res.dat[300:396,'nb.dif'] <- 3
|
res.dat[300:396,'nb.dif'] <- 3
|
||||||
@ -2155,116 +2156,3 @@ res.dat.simple <- res.dat[,c(1:8,13,16:18)]
|
|||||||
res.dat.simple$m.beta <- round(res.dat.simple$m.beta,3)
|
res.dat.simple$m.beta <- round(res.dat.simple$m.beta,3)
|
||||||
res.dat.simple
|
res.dat.simple
|
||||||
|
|
||||||
################ Boxplots of Rejected H0 in null scenarios
|
|
||||||
|
|
||||||
## Proportion of rejected h0 per dif value in h0 scenarios (A) by DIF size
|
|
||||||
|
|
||||||
res.null <- res.dat[res.dat$eff.size==0,]
|
|
||||||
boxplot(h0.rejected.p~dif.size,data=res.null,col=c(1,2,3),xlab='DIF size',ylab='H0 rejection proportion in target scenario')
|
|
||||||
res.null0 <- res.dat[res.dat$eff.size==0 & res.dat$dif.size==0,]
|
|
||||||
points(y=res.null0$h0.rejected.p,x=rep(1,nrow(res.null0)),col='gray',pch=3)
|
|
||||||
res.null3 <- res.dat[res.dat$eff.size==0 & res.dat$dif.size==0.3,]
|
|
||||||
points(y=res.null3$h0.rejected.p,x=rep(2,nrow(res.null3)),col='#590b0c',pch=3)
|
|
||||||
res.null5 <- res.dat[res.dat$eff.size==0 & res.dat$dif.size==0.5,]
|
|
||||||
points(y=res.null5$h0.rejected.p,x=rep(3,nrow(res.null5)),col='#053305',pch=3)
|
|
||||||
|
|
||||||
## Proportion of rejected h0 per dif value in h0 scenarios (A) by DIF size (1 item)
|
|
||||||
|
|
||||||
par(mfrow=c(2,2))
|
|
||||||
|
|
||||||
# 0 item
|
|
||||||
res.null <- res.dat[res.dat$eff.size==0 & res.dat$nb.dif==0,]
|
|
||||||
boxplot(h0.rejected.p~dif.size,data=res.null,col=c(2),xlab='DIF size',
|
|
||||||
ylab='H0 rejection proportion in target scenario',main='No DIF',ylim=c(0,1))
|
|
||||||
points(y=res.null$h0.rejected.p,x=rep(1,nrow(res.null)),col='#590b0c',pch=3)
|
|
||||||
|
|
||||||
# 1 item
|
|
||||||
res.null <- res.dat[res.dat$eff.size==0 & res.dat$nb.dif==1,]
|
|
||||||
boxplot(h0.rejected.p~dif.size,data=res.null,col=c(2,3),xlab='DIF size',
|
|
||||||
ylab='H0 rejection proportion in target scenario',main='DIF on 1 item',ylim=c(0,1))
|
|
||||||
res.null3 <- res.null[res.null$dif.size==0.3,]
|
|
||||||
points(y=res.null3$h0.rejected.p,x=rep(1,nrow(res.null3)),col='#590b0c',pch=3)
|
|
||||||
res.null5 <- res.null[res.null$dif.size==0.5,]
|
|
||||||
points(y=res.null5$h0.rejected.p,x=rep(2,nrow(res.null5)),col='#053305',pch=3)
|
|
||||||
|
|
||||||
# 2 items
|
|
||||||
res.null <- res.dat[res.dat$eff.size==0 & res.dat$nb.dif==2,]
|
|
||||||
boxplot(h0.rejected.p~dif.size,data=res.null,col=c(2,3),xlab='DIF size',
|
|
||||||
ylab='H0 rejection proportion in target scenario',main='DIF on 2 items',ylim=c(0,1))
|
|
||||||
res.null3 <- res.null[res.null$dif.size==0.3,]
|
|
||||||
points(y=res.null3$h0.rejected.p,x=rep(1,nrow(res.null3)),col='#590b0c',pch=3)
|
|
||||||
res.null5 <- res.null[res.null$dif.size==0.5,]
|
|
||||||
points(y=res.null5$h0.rejected.p,x=rep(2,nrow(res.null5)),col='#053305',pch=3)
|
|
||||||
|
|
||||||
# 3 items
|
|
||||||
res.null <- res.dat[res.dat$eff.size==0 & res.dat$nb.dif==3,]
|
|
||||||
boxplot(h0.rejected.p~dif.size,data=res.null,col=c(2,3),xlab='DIF size',
|
|
||||||
ylab='H0 rejection proportion in target scenario',main='DIF on 3 items',ylim=c(0,1))
|
|
||||||
res.null3 <- res.null[res.null$dif.size==0.3,]
|
|
||||||
points(y=res.null3$h0.rejected.p,x=rep(1,nrow(res.null3)),col='#590b0c',pch=3)
|
|
||||||
res.null5 <- res.null[res.null$dif.size==0.5,]
|
|
||||||
points(y=res.null5$h0.rejected.p,x=rep(2,nrow(res.null5)),col='#053305',pch=3)
|
|
||||||
|
|
||||||
par(mfrow=c(1,1))
|
|
||||||
|
|
||||||
## Proportion of rejected h0 per dif value in h0 scenarios (A) by DIF size (1 item) J=4
|
|
||||||
|
|
||||||
par(mfrow=c(2,2))
|
|
||||||
|
|
||||||
# 0 item
|
|
||||||
res.null <- res.dat[res.dat$eff.size==0 & res.dat$nb.dif==0 & res.dat$J==4,]
|
|
||||||
boxplot(h0.rejected.p~dif.size,data=res.null,col=c(2),xlab='DIF size',
|
|
||||||
ylab='H0 rejection proportion in target scenario',main='No DIF',ylim=c(0,1))
|
|
||||||
points(y=res.null$h0.rejected.p,x=rep(1,nrow(res.null)),col='#590b0c',pch=3)
|
|
||||||
|
|
||||||
# 1 item
|
|
||||||
res.null <- res.dat[res.dat$eff.size==0 & res.dat$nb.dif==1 & res.dat$J==4,]
|
|
||||||
boxplot(h0.rejected.p~dif.size,data=res.null,col=c(2,3),xlab='DIF size',
|
|
||||||
ylab='H0 rejection proportion in target scenario',main='DIF on 1 item',ylim=c(0,1))
|
|
||||||
res.null3 <- res.null[res.null$dif.size==0.3,]
|
|
||||||
points(y=res.null3$h0.rejected.p,x=rep(1,nrow(res.null3)),col='#590b0c',pch=3)
|
|
||||||
res.null5 <- res.null[res.null$dif.size==0.5,]
|
|
||||||
points(y=res.null5$h0.rejected.p,x=rep(2,nrow(res.null5)),col='#053305',pch=3)
|
|
||||||
|
|
||||||
# 2 items
|
|
||||||
res.null <- res.dat[res.dat$eff.size==0 & res.dat$nb.dif==2 & res.dat$J==4,]
|
|
||||||
boxplot(h0.rejected.p~dif.size,data=res.null,col=c(2,3),xlab='DIF size',
|
|
||||||
ylab='H0 rejection proportion in target scenario',main='DIF on 2 items',ylim=c(0,1))
|
|
||||||
res.null3 <- res.null[res.null$dif.size==0.3,]
|
|
||||||
points(y=res.null3$h0.rejected.p,x=rep(1,nrow(res.null3)),col='#590b0c',pch=3)
|
|
||||||
res.null5 <- res.null[res.null$dif.size==0.5,]
|
|
||||||
points(y=res.null5$h0.rejected.p,x=rep(2,nrow(res.null5)),col='#053305',pch=3)
|
|
||||||
|
|
||||||
par(mfrow=c(1,1))
|
|
||||||
|
|
||||||
|
|
||||||
## Proportion of rejected h0 per dif value in h0 scenarios (A) by DIF size (1 item) J=7
|
|
||||||
|
|
||||||
par(mfrow=c(2,2))
|
|
||||||
|
|
||||||
# 0 item
|
|
||||||
res.null <- res.dat[res.dat$eff.size==0 & res.dat$nb.dif==0 & res.dat$J==7,]
|
|
||||||
nrow(res.null)
|
|
||||||
boxplot(h0.rejected.p~dif.size,data=res.null,col=c(2),xlab='DIF size',
|
|
||||||
ylab='H0 rejection proportion in target scenario',main='No DIF',ylim=c(0,1))
|
|
||||||
points(y=res.null$h0.rejected.p,x=rep(1,nrow(res.null)),col='#590b0c',pch=3)
|
|
||||||
|
|
||||||
# 2 items
|
|
||||||
res.null <- res.dat[res.dat$eff.size==0 & res.dat$nb.dif==2 & res.dat$J==7,]
|
|
||||||
boxplot(h0.rejected.p~dif.size,data=res.null,col=c(2,3),xlab='DIF size',
|
|
||||||
ylab='H0 rejection proportion in target scenario',main='DIF on 2 items',ylim=c(0,1))
|
|
||||||
res.null3 <- res.null[res.null$dif.size==0.3,]
|
|
||||||
points(y=res.null3$h0.rejected.p,x=rep(1,nrow(res.null3)),col='#590b0c',pch=3)
|
|
||||||
res.null5 <- res.null[res.null$dif.size==0.5,]
|
|
||||||
points(y=res.null5$h0.rejected.p,x=rep(2,nrow(res.null5)),col='#053305',pch=3)
|
|
||||||
|
|
||||||
# 3 items
|
|
||||||
res.null <- res.dat[res.dat$eff.size==0 & res.dat$nb.dif==3 & res.dat$J==7,]
|
|
||||||
boxplot(h0.rejected.p~dif.size,data=res.null,col=c(2,3),xlab='DIF size',
|
|
||||||
ylab='H0 rejection proportion in target scenario',main='DIF on 3 items',ylim=c(0,1))
|
|
||||||
res.null3 <- res.null[res.null$dif.size==0.3,]
|
|
||||||
points(y=res.null3$h0.rejected.p,x=rep(1,nrow(res.null3)),col='#590b0c',pch=3)
|
|
||||||
res.null5 <- res.null[res.null$dif.size==0.5,]
|
|
||||||
points(y=res.null5$h0.rejected.p,x=rep(2,nrow(res.null5)),col='#053305',pch=3)
|
|
||||||
|
|
||||||
par(mfrow=c(1,1))
|
|
||||||
|
Reference in New Issue
Block a user