|
|
@ -17,7 +17,7 @@ lastChar <- function(str){
|
|
|
|
substr(str, nchar(str), nchar(str))
|
|
|
|
substr(str, nchar(str), nchar(str))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
source(paste0(getwd(),"/functions/resali.R"))
|
|
|
|
source(paste0(getwd(),"/Scripts/Analysis/functions/resali.R"))
|
|
|
|
|
|
|
|
|
|
|
|
##############################################################################
|
|
|
|
##############################################################################
|
|
|
|
#----------------------------------------------------------------------------#
|
|
|
|
#----------------------------------------------------------------------------#
|
|
|
@ -147,20 +147,19 @@ replicate_pcm_analysis<- function(df=NULL,treatment='TT',irtmodel='PCM2',method=
|
|
|
|
|
|
|
|
|
|
|
|
#### Create data.frame
|
|
|
|
#### Create data.frame
|
|
|
|
|
|
|
|
|
|
|
|
results <- c(sapply(1:4,function(x) paste0(x,c('A','B','C','D','E'))),sapply(5:9,function(x) paste0(x,c('A','B','C','D','E','F','G'))))
|
|
|
|
results <- c(sapply(c(2,4),function(x) paste0(x,c('A','B','C'))),sapply(c(6,8),function(x) paste0(x,c('A','B','C','D','E'))))
|
|
|
|
|
|
|
|
|
|
|
|
results2 <- c(sapply(10:20,function(x) paste0(x,c('A','B','C','D','E','F','G'))))
|
|
|
|
results2 <- c(sapply(seq(10,20,2),function(x) paste0(x,c('A','B','C','D','E'))))
|
|
|
|
|
|
|
|
|
|
|
|
results <- c(sapply(c(50,100,200,300),function(x) paste0(results,'_',x)))
|
|
|
|
results <- c(sapply(c(50,100,300),function(x) paste0(results,'_',x)))
|
|
|
|
|
|
|
|
|
|
|
|
results2 <- c(sapply(c(50,100,200,300),function(x) paste0(results2,'_',x)))
|
|
|
|
results2 <- c(sapply(c(50,100,300),function(x) paste0(results2,'_',x)))
|
|
|
|
|
|
|
|
|
|
|
|
results <- sort(results)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
results2 <- sort(results2)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
results <- c(results,results2)
|
|
|
|
results <- c(results,results2)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
results <- c(sapply(1:16,function(x) c(results[x],results[x+16],results[x+32])),
|
|
|
|
|
|
|
|
sapply(1:30,function(x) c(results[x+48],results[x+30+48],results[x+60+48]))
|
|
|
|
|
|
|
|
)
|
|
|
|
#### Compiler function
|
|
|
|
#### Compiler function
|
|
|
|
|
|
|
|
|
|
|
|
compile_simulation <- function(scenario) {
|
|
|
|
compile_simulation <- function(scenario) {
|
|
|
@ -241,33 +240,29 @@ compile_simulation <- function(scenario) {
|
|
|
|
|
|
|
|
|
|
|
|
#### Compiled results
|
|
|
|
#### Compiled results
|
|
|
|
|
|
|
|
|
|
|
|
res.dat <- compile_simulation('1A_100')
|
|
|
|
res.dat <- compile_simulation('2A_50')
|
|
|
|
|
|
|
|
|
|
|
|
for (x in results[seq(2,length(results))]) {
|
|
|
|
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[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[193:417,'nb.dif'] <- 2
|
|
|
|
res.dat[res.dat$scenario=="10B",]$dif.size <- 0.3
|
|
|
|
res.dat[417:528,'nb.dif'] <- 3
|
|
|
|
res.dat[substr(res.dat$scenario,1,1)%in%c("6","8"),'nb.dif'] <- 1
|
|
|
|
|
|
|
|
res.dat[substr(res.dat$scenario,1,2)%in%seq(10,16,2),'nb.dif'] <- 2
|
|
|
|
|
|
|
|
res.dat[substr(res.dat$scenario,1,2)%in%seq(18,20,2),'nb.dif'] <- 3
|
|
|
|
|
|
|
|
res.dat[res.dat$N==50,"dif.size"] <- res.dat[which(res.dat$N==50)+1,"dif.size"]
|
|
|
|
res.dat[res.dat$scenario.type=="B",]$eff.size <- 0.2
|
|
|
|
res.dat[res.dat$scenario.type=="B",]$eff.size <- 0.2
|
|
|
|
res.dat[res.dat$scenario.type=="C" & res.dat$dif.size==0,]$eff.size <- 0.4
|
|
|
|
res.dat[res.dat$scenario.type=="C" & res.dat$dif.size==0,]$eff.size <- 0.4
|
|
|
|
res.dat[res.dat$scenario.type=="C" & res.dat$dif.size!=0,]$eff.size <- 0.2
|
|
|
|
res.dat[res.dat$scenario.type=="C" & res.dat$dif.size!=0,]$eff.size <- 0.2
|
|
|
|
res.dat[res.dat$scenario.type=="D" & res.dat$dif.size==0,]$eff.size <- -0.2
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario.type=="D" & res.dat$dif.size!=0,]$eff.size <- 0.4
|
|
|
|
res.dat[res.dat$scenario.type=="D" & res.dat$dif.size!=0,]$eff.size <- 0.4
|
|
|
|
res.dat[res.dat$scenario.type=="E" & res.dat$dif.size==0,]$eff.size <- -0.4
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario.type=="E" & res.dat$dif.size!=0,]$eff.size <- 0.4
|
|
|
|
res.dat[res.dat$scenario.type=="E" & res.dat$dif.size!=0,]$eff.size <- 0.4
|
|
|
|
res.dat[res.dat$scenario.type=="F",]$eff.size <- -0.2
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario.type=="G",]$eff.size <- -0.4
|
|
|
|
|
|
|
|
View(res.dat)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
is.nan.data.frame <- function(x)
|
|
|
|
is.nan.data.frame <- function(x) {
|
|
|
|
do.call(cbind, lapply(x, is.nan))
|
|
|
|
do.call(cbind, lapply(x, is.nan))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res.dat[is.nan(res.dat)] <- NA
|
|
|
|
res.dat[is.nan(res.dat)] <- NA
|
|
|
@ -282,19 +277,21 @@ res.dat$bias <- res.dat$eff.size-res.dat$m.beta
|
|
|
|
|
|
|
|
|
|
|
|
#### Create data.frame
|
|
|
|
#### Create data.frame
|
|
|
|
|
|
|
|
|
|
|
|
results <- c(sapply(1:4,function(x) paste0(x,c('A','B','C','D','E'))),sapply(5:9,function(x) paste0(x,c('A','B','C','D','E','F','G'))))
|
|
|
|
results <- c(sapply(c(2,4),function(x) paste0(x,c('A','B','C'))),sapply(c(6,8),function(x) paste0(x,c('A','B','C','D','E'))))
|
|
|
|
|
|
|
|
|
|
|
|
results2 <- c(sapply(10:20,function(x) paste0(x,c('A','B','C','D','E','F','G'))))
|
|
|
|
results2 <- c(sapply(seq(10,20,2),function(x) paste0(x,c('A','B','C','D','E'))))
|
|
|
|
|
|
|
|
|
|
|
|
results <- c(sapply(c(50,100,200,300),function(x) paste0(results,'_',x)))
|
|
|
|
results <- c(sapply(c(50,100,300),function(x) paste0(results,'_',x)))
|
|
|
|
|
|
|
|
|
|
|
|
results2 <- c(sapply(c(50,100,200,300),function(x) paste0(results2,'_',x)))
|
|
|
|
results2 <- c(sapply(c(50,100,300),function(x) paste0(results2,'_',x)))
|
|
|
|
|
|
|
|
|
|
|
|
results <- sort(results)
|
|
|
|
results <- c(results,results2)
|
|
|
|
|
|
|
|
|
|
|
|
results2 <- sort(results2)
|
|
|
|
results <- c(sapply(1:16,function(x) c(results[x],results[x+16],results[x+32])),
|
|
|
|
|
|
|
|
sapply(1:30,function(x) c(results[x+48],results[x+30+48],results[x+60+48]))
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
results <- c(results,results2)[81:528]
|
|
|
|
results <- results[19:length(results)]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### Compiler function
|
|
|
|
#### Compiler function
|
|
|
@ -376,14 +373,23 @@ compile_simulation2 <- function(scenario) {
|
|
|
|
|
|
|
|
|
|
|
|
#### Compiled results
|
|
|
|
#### Compiled results
|
|
|
|
|
|
|
|
|
|
|
|
res.dat.dif <- compile_simulation2('5A_100')
|
|
|
|
res.dat.dif <- compile_simulation2('6A_50')
|
|
|
|
|
|
|
|
|
|
|
|
for (x in results[seq(2,length(results))]) {
|
|
|
|
for (x in results[seq(2,length(results))]) {
|
|
|
|
y <- compile_simulation2(x)
|
|
|
|
y <- compile_simulation2(x)
|
|
|
|
res.dat.dif <- bind_rows(res.dat.dif,y)
|
|
|
|
res.dat.dif <- bind_rows(res.dat.dif,y)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
res.dat$bias <- res.dat$eff.size-res.dat$m.beta
|
|
|
|
res.dat.dif[is.na(res.dat.dif$dif.size),'dif.size'] <- 0
|
|
|
|
|
|
|
|
res.dat.dif[substr(res.dat.dif$scenario,1,1)%in%c("6","8"),'nb.dif'] <- 1
|
|
|
|
|
|
|
|
res.dat.dif[substr(res.dat.dif$scenario,1,2)%in%seq(10,16,2),'nb.dif'] <- 2
|
|
|
|
|
|
|
|
res.dat.dif[substr(res.dat.dif$scenario,1,2)%in%seq(18,20,2),'nb.dif'] <- 3
|
|
|
|
|
|
|
|
res.dat.dif[res.dat.dif$N==50,"dif.size"] <- res.dat.dif[which(res.dat.dif$N==50)+1,"dif.size"]
|
|
|
|
|
|
|
|
res.dat.dif[res.dat.dif$scenario.type=="B",]$eff.size <- 0.2
|
|
|
|
|
|
|
|
res.dat.dif[res.dat.dif$scenario.type=="C" & res.dat.dif$dif.size!=0,]$eff.size <- 0.2
|
|
|
|
|
|
|
|
res.dat.dif[res.dat.dif$scenario.type=="D" & res.dat.dif$dif.size!=0,]$eff.size <- 0.4
|
|
|
|
|
|
|
|
res.dat.dif[res.dat.dif$scenario.type=="E" & res.dat.dif$dif.size!=0,]$eff.size <- 0.4
|
|
|
|
|
|
|
|
res.dat.dif[res.dat.dif$scenario=="10B",]$dif.size <- 0.3
|
|
|
|
res.dat.dif$bias <- res.dat.dif$eff.size-res.dat.dif$m.beta
|
|
|
|
res.dat.dif$bias <- res.dat.dif$eff.size-res.dat.dif$m.beta
|
|
|
|
|
|
|
|
|
|
|
|
##############################################################################
|
|
|
|
##############################################################################
|
|
|
@ -394,20 +400,19 @@ res.dat.dif$bias <- res.dat.dif$eff.size-res.dat.dif$m.beta
|
|
|
|
|
|
|
|
|
|
|
|
#### Create data.frame
|
|
|
|
#### Create data.frame
|
|
|
|
|
|
|
|
|
|
|
|
results <- c(sapply(1:4,function(x) paste0(x,c('A','B','C','D','E'))),sapply(5:9,function(x) paste0(x,c('A','B','C','D','E','F','G'))))
|
|
|
|
results <- c(sapply(c(2,4),function(x) paste0(x,c('A','B','C'))),sapply(c(6,8),function(x) paste0(x,c('A','B','C','D','E'))))
|
|
|
|
|
|
|
|
|
|
|
|
results2 <- c(sapply(10:20,function(x) paste0(x,c('A','B','C','D','E','F','G'))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
results <- c(sapply(c(50,100,200,300),function(x) paste0(results,'_',x)))
|
|
|
|
results2 <- c(sapply(seq(10,20,2),function(x) paste0(x,c('A','B','C','D','E'))))
|
|
|
|
|
|
|
|
|
|
|
|
results2 <- c(sapply(c(50,100,200,300),function(x) paste0(results2,'_',x)))
|
|
|
|
results <- c(sapply(c(50,100,300),function(x) paste0(results,'_',x)))
|
|
|
|
|
|
|
|
|
|
|
|
results <- sort(results)
|
|
|
|
results2 <- c(sapply(c(50,100,300),function(x) paste0(results2,'_',x)))
|
|
|
|
|
|
|
|
|
|
|
|
results2 <- sort(results2)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
results <- c(results,results2)
|
|
|
|
results <- c(results,results2)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
results <- c(sapply(1:16,function(x) c(results[x],results[x+16],results[x+32])),
|
|
|
|
|
|
|
|
sapply(1:30,function(x) c(results[x+48],results[x+30+48],results[x+60+48]))
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
#### Compiler function
|
|
|
|
#### Compiler function
|
|
|
|
|
|
|
|
|
|
|
@ -650,13 +655,33 @@ compile_simulation2_rosali <- function(scenario) {
|
|
|
|
|
|
|
|
|
|
|
|
#### Compiled results
|
|
|
|
#### Compiled results
|
|
|
|
|
|
|
|
|
|
|
|
res.dat.dif.rosali <- compile_simulation2_rosali('1A_100')
|
|
|
|
res.dat.dif.rosali <- compile_simulation2_rosali('2A_50')
|
|
|
|
|
|
|
|
|
|
|
|
for (x in results[seq(2,length(results))]) {
|
|
|
|
for (x in results[seq(2,length(results))]) {
|
|
|
|
y <- compile_simulation2_rosali(x)
|
|
|
|
y <- compile_simulation2_rosali(x)
|
|
|
|
res.dat.dif.rosali <- bind_rows(res.dat.dif.rosali,y)
|
|
|
|
res.dat.dif.rosali <- bind_rows(res.dat.dif.rosali,y)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res.dat.dif.rosali[res.dat.dif.rosali$scenario.type=='A','dif.size'] <- -res.dat.dif.rosali[res.dat.dif.rosali$scenario.type=='A','dif.size']
|
|
|
|
|
|
|
|
res.dat.dif.rosali[is.na(res.dat.dif.rosali$dif.size),'dif.size'] <- 0
|
|
|
|
|
|
|
|
res.dat.dif.rosali[substr(res.dat.dif.rosali$scenario,1,1)%in%c("6","8"),'nb.dif'] <- 1
|
|
|
|
|
|
|
|
res.dat.dif.rosali[substr(res.dat.dif.rosali$scenario,1,2)%in%seq(10,16,2),'nb.dif'] <- 2
|
|
|
|
|
|
|
|
res.dat.dif.rosali[substr(res.dat.dif.rosali$scenario,1,2)%in%seq(18,20,2),'nb.dif'] <- 3
|
|
|
|
|
|
|
|
res.dat.dif.rosali[res.dat.dif.rosali$N==50,"dif.size"] <- res.dat.dif.rosali[which(res.dat.dif.rosali$N==50)+1,"dif.size"]
|
|
|
|
|
|
|
|
res.dat.dif.rosali[res.dat.dif.rosali$scenario.type=="B",]$eff.size <- 0.2
|
|
|
|
|
|
|
|
res.dat.dif.rosali[res.dat.dif.rosali$scenario.type=="C" & res.dat.dif.rosali$dif.size==0,]$eff.size <- 0.4
|
|
|
|
|
|
|
|
res.dat.dif.rosali[res.dat.dif.rosali$scenario.type=="C" & res.dat.dif.rosali$dif.size!=0,]$eff.size <- 0.2
|
|
|
|
|
|
|
|
res.dat.dif.rosali[res.dat.dif.rosali$scenario.type=="D" & res.dat.dif.rosali$dif.size!=0,]$eff.size <- 0.4
|
|
|
|
|
|
|
|
res.dat.dif.rosali[res.dat.dif.rosali$scenario.type=="E" & res.dat.dif.rosali$dif.size!=0,]$eff.size <- 0.4
|
|
|
|
|
|
|
|
res.dat.dif.rosali[res.dat.dif.rosali$scenario=="10B",]$dif.size <- 0.3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
is.nan.data.frame <- function(x) {
|
|
|
|
|
|
|
|
do.call(cbind, lapply(x, is.nan))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res.dat.dif.rosali[is.nan(res.dat.dif.rosali)] <- NA
|
|
|
|
|
|
|
|
|
|
|
|
res.dat.dif.rosali$bias <- res.dat.dif.rosali$eff.size-res.dat.dif.rosali$m.beta
|
|
|
|
res.dat.dif.rosali$bias <- res.dat.dif.rosali$eff.size-res.dat.dif.rosali$m.beta
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -668,20 +693,21 @@ res.dat.dif.rosali$bias <- res.dat.dif.rosali$eff.size-res.dat.dif.rosali$m.beta
|
|
|
|
|
|
|
|
|
|
|
|
#### Create data.frame
|
|
|
|
#### Create data.frame
|
|
|
|
|
|
|
|
|
|
|
|
results <- c(sapply(1:4,function(x) paste0(x,c('A','B','C','D','E'))),sapply(5:9,function(x) paste0(x,c('A','B','C','D','E','F','G'))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
results2 <- c(sapply(10:20,function(x) paste0(x,c('A','B','C','D','E','F','G'))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
results <- c(sapply(c(50,100,200,300),function(x) paste0(results,'_',x)))
|
|
|
|
results <- c(sapply(c(2,4),function(x) paste0(x,c('A','B','C'))),sapply(c(6,8),function(x) paste0(x,c('A','B','C','D','E'))))
|
|
|
|
|
|
|
|
|
|
|
|
results2 <- c(sapply(c(50,100,200,300),function(x) paste0(results2,'_',x)))
|
|
|
|
results2 <- c(sapply(seq(10,20,2),function(x) paste0(x,c('A','B','C','D','E'))))
|
|
|
|
|
|
|
|
|
|
|
|
results <- sort(results)
|
|
|
|
results <- c(sapply(c(50,100,300),function(x) paste0(results,'_',x)))
|
|
|
|
|
|
|
|
|
|
|
|
results2 <- sort(results2)
|
|
|
|
results2 <- c(sapply(c(50,100,300),function(x) paste0(results2,'_',x)))
|
|
|
|
|
|
|
|
|
|
|
|
results <- c(results,results2)
|
|
|
|
results <- c(results,results2)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
results <- c(sapply(1:16,function(x) c(results[x],results[x+16],results[x+32])),
|
|
|
|
|
|
|
|
sapply(1:30,function(x) c(results[x+48],results[x+30+48],results[x+60+48]))
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### Compiler function
|
|
|
|
#### Compiler function
|
|
|
|
|
|
|
|
|
|
|
@ -920,13 +946,33 @@ compile_simulation2_resali <- function(scenario) {
|
|
|
|
|
|
|
|
|
|
|
|
#### Compiled results
|
|
|
|
#### Compiled results
|
|
|
|
|
|
|
|
|
|
|
|
res.dat.dif.resali <- compile_simulation2_resali('1A_100')
|
|
|
|
res.dat.dif.resali <- compile_simulation2_resali('2A_50')
|
|
|
|
|
|
|
|
|
|
|
|
for (x in results[seq(2,length(results))]) {
|
|
|
|
for (x in results[seq(2,length(results))]) {
|
|
|
|
y <- compile_simulation2_resali(x)
|
|
|
|
y <- compile_simulation2_resali(x)
|
|
|
|
res.dat.dif.resali <- bind_rows(res.dat.dif.resali,y)
|
|
|
|
res.dat.dif.resali <- bind_rows(res.dat.dif.resali,y)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res.dat.dif.resali[res.dat.dif.resali$scenario.type=='A','dif.size'] <- -res.dat.dif.resali[res.dat.dif.resali$scenario.type=='A','dif.size']
|
|
|
|
|
|
|
|
res.dat.dif.resali[is.na(res.dat.dif.resali$dif.size),'dif.size'] <- 0
|
|
|
|
|
|
|
|
res.dat.dif.resali[substr(res.dat.dif.resali$scenario,1,1)%in%c("6","8"),'nb.dif'] <- 1
|
|
|
|
|
|
|
|
res.dat.dif.resali[substr(res.dat.dif.resali$scenario,1,2)%in%seq(10,16,2),'nb.dif'] <- 2
|
|
|
|
|
|
|
|
res.dat.dif.resali[substr(res.dat.dif.resali$scenario,1,2)%in%seq(18,20,2),'nb.dif'] <- 3
|
|
|
|
|
|
|
|
res.dat.dif.resali[res.dat.dif.resali$N==50,"dif.size"] <- res.dat.dif.resali[which(res.dat.dif.resali$N==50)+1,"dif.size"]
|
|
|
|
|
|
|
|
res.dat.dif.resali[res.dat.dif.resali$scenario.type=="B",]$eff.size <- 0.2
|
|
|
|
|
|
|
|
res.dat.dif.resali[res.dat.dif.resali$scenario.type=="C" & res.dat.dif.resali$dif.size==0,]$eff.size <- 0.4
|
|
|
|
|
|
|
|
res.dat.dif.resali[res.dat.dif.resali$scenario.type=="C" & res.dat.dif.resali$dif.size!=0,]$eff.size <- 0.2
|
|
|
|
|
|
|
|
res.dat.dif.resali[res.dat.dif.resali$scenario.type=="D" & res.dat.dif.resali$dif.size!=0,]$eff.size <- 0.4
|
|
|
|
|
|
|
|
res.dat.dif.resali[res.dat.dif.resali$scenario.type=="E" & res.dat.dif.resali$dif.size!=0,]$eff.size <- 0.4
|
|
|
|
|
|
|
|
res.dat.dif.resali[res.dat.dif.resali$scenario=="10B",]$dif.size <- 0.3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
is.nan.data.frame <- function(x) {
|
|
|
|
|
|
|
|
do.call(cbind, lapply(x, is.nan))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res.dat.dif.resali[is.nan(res.dat.dif.resali)] <- NA
|
|
|
|
|
|
|
|
|
|
|
|
res.dat.dif.resali$bias <- res.dat.dif.resali$eff.size-res.dat.dif.resali$m.beta
|
|
|
|
res.dat.dif.resali$bias <- res.dat.dif.resali$eff.size-res.dat.dif.resali$m.beta
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -943,20 +989,6 @@ res.dat$theoretical.power <- 0
|
|
|
|
|
|
|
|
|
|
|
|
### Scénarios N=100
|
|
|
|
### Scénarios N=100
|
|
|
|
|
|
|
|
|
|
|
|
## Scénarios J=4 / M=2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(1,5,7,9,11),'A') & res.dat$N==100,]$theoretical.power <- 0.05
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(1,5,7,9,11),'B') & res.dat$N==100,]$theoretical.power <- 0.1543
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(5,7,9,11),'C') & res.dat$N==100,]$theoretical.power <- 0.1543
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(5,7,9,11),'D') & res.dat$N==100,]$theoretical.power <- 0.4627
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(5,7,9,11),'E') & res.dat$N==100,]$theoretical.power <- 0.4627
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(5,7,9,11),'F') & res.dat$N==100,]$theoretical.power <- 0.1543
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(5,7,9,11),'G') & res.dat$N==100,]$theoretical.power <- 0.4627
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(1,'C') & res.dat$N==100,]$theoretical.power <- 0.4627
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(1,'D') & res.dat$N==100,]$theoretical.power <- 0.1543
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(1,'E') & res.dat$N==100,]$theoretical.power <- 0.4627
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Scénarios J=4 / M=4
|
|
|
|
## Scénarios J=4 / M=4
|
|
|
|
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(2,6,8,10,12),'A') & res.dat$N==100,]$theoretical.power <- 0.05
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(2,6,8,10,12),'A') & res.dat$N==100,]$theoretical.power <- 0.05
|
|
|
@ -964,26 +996,8 @@ res.dat[res.dat$scenario %in% paste0(c(2,6,8,10,12),'B') & res.dat$N==100,]$theo
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(6,8,10,12),'C') & res.dat$N==100,]$theoretical.power <- 0.2177
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(6,8,10,12),'C') & res.dat$N==100,]$theoretical.power <- 0.2177
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(6,8,10,12),'D') & res.dat$N==100,]$theoretical.power <- 0.6586
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(6,8,10,12),'D') & res.dat$N==100,]$theoretical.power <- 0.6586
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(6,8,10,12),'E') & res.dat$N==100,]$theoretical.power <- 0.6586
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(6,8,10,12),'E') & res.dat$N==100,]$theoretical.power <- 0.6586
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(6,8,10,12),'F') & res.dat$N==100,]$theoretical.power <- 0.2177
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(6,8,10,12),'G') & res.dat$N==100,]$theoretical.power <- 0.6586
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(2,'C') & res.dat$N==100,]$theoretical.power <- 0.6586
|
|
|
|
res.dat[res.dat$scenario %in% paste0(2,'C') & res.dat$N==100,]$theoretical.power <- 0.6586
|
|
|
|
res.dat[res.dat$scenario %in% paste0(2,'D') & res.dat$N==100,]$theoretical.power <- 0.2177
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(2,'E') & res.dat$N==100,]$theoretical.power <- 0.6586
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Scénarios J=7 / M=2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(3,13,15,17,19),'A') & res.dat$N==100,]$theoretical.power <- 0.05
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(3,13,15,17,19),'B') & res.dat$N==100,]$theoretical.power <- 0.1870
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(13,15,17,19),'C') & res.dat$N==100,]$theoretical.power <- 0.1870
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(13,15,17,19),'D') & res.dat$N==100,]$theoretical.power <- 0.5666
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(13,15,17,19),'E') & res.dat$N==100,]$theoretical.power <- 0.5666
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(13,15,17,19),'F') & res.dat$N==100,]$theoretical.power <- 0.1870
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(13,15,17,19),'G') & res.dat$N==100,]$theoretical.power <- 0.5666
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(3,'C') & res.dat$N==100,]$theoretical.power <- 0.5666
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(3,'D') & res.dat$N==100,]$theoretical.power <- 0.1870
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(3,'E') & res.dat$N==100,]$theoretical.power <- 0.5666
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Scénarios J=7 / M=4
|
|
|
|
## Scénarios J=7 / M=4
|
|
|
|
|
|
|
|
|
|
|
@ -992,91 +1006,13 @@ res.dat[res.dat$scenario %in% paste0(c(4,14,16,18,20),'B') & res.dat$N==100,]$th
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(14,16,18,20),'C') & res.dat$N==100,]$theoretical.power <- 0.2450
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(14,16,18,20),'C') & res.dat$N==100,]$theoretical.power <- 0.2450
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(14,16,18,20),'D') & res.dat$N==100,]$theoretical.power <- 0.7136
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(14,16,18,20),'D') & res.dat$N==100,]$theoretical.power <- 0.7136
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(14,16,18,20),'E') & res.dat$N==100,]$theoretical.power <- 0.7136
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(14,16,18,20),'E') & res.dat$N==100,]$theoretical.power <- 0.7136
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(14,16,18,20),'F') & res.dat$N==100,]$theoretical.power <- 0.2450
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(14,16,18,20),'G') & res.dat$N==100,]$theoretical.power <- 0.7136
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(4,'C') & res.dat$N==100,]$theoretical.power <- 0.7136
|
|
|
|
res.dat[res.dat$scenario %in% paste0(4,'C') & res.dat$N==100,]$theoretical.power <- 0.7136
|
|
|
|
res.dat[res.dat$scenario %in% paste0(4,'D') & res.dat$N==100,]$theoretical.power <- 0.2450
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(4,'E') & res.dat$N==100,]$theoretical.power <- 0.7136
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### Scénarios N=200
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Scénarios J=4 / M=2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(1,5,7,9,11),'A') & res.dat$N==200,]$theoretical.power <- 0.05
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(1,5,7,9,11),'B') & res.dat$N==200,]$theoretical.power <- 0.2618
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(5,7,9,11),'C') & res.dat$N==200,]$theoretical.power <- 0.2618
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(5,7,9,11),'D') & res.dat$N==200,]$theoretical.power <- 0.7507
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(5,7,9,11),'E') & res.dat$N==200,]$theoretical.power <- 0.7507
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(5,7,9,11),'F') & res.dat$N==200,]$theoretical.power <- 0.2618
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(5,7,9,11),'G') & res.dat$N==200,]$theoretical.power <- 0.7507
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(1,'C') & res.dat$N==200,]$theoretical.power <- 0.7507
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(1,'D') & res.dat$N==200,]$theoretical.power <- 0.2618
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(1,'E') & res.dat$N==200,]$theoretical.power <- 0.7507
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Scénarios J=4 / M=4
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(2,6,8,10,12),'A') & res.dat$N==200,]$theoretical.power <- 0.05
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(2,6,8,10,12),'B') & res.dat$N==200,]$theoretical.power <- 0.3875
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(6,8,10,12),'C') & res.dat$N==200,]$theoretical.power <- 0.3875
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(6,8,10,12),'D') & res.dat$N==200,]$theoretical.power <- 0.9161
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(6,8,10,12),'E') & res.dat$N==200,]$theoretical.power <- 0.9161
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(6,8,10,12),'F') & res.dat$N==200,]$theoretical.power <- 0.3875
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(6,8,10,12),'G') & res.dat$N==200,]$theoretical.power <- 0.9161
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(2,'C') & res.dat$N==200,]$theoretical.power <- 0.9161
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(2,'D') & res.dat$N==200,]$theoretical.power <- 0.3875
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(2,'E') & res.dat$N==200,]$theoretical.power <- 0.9161
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Scénarios J=7 / M=2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(3,13,15,17,19),'A') & res.dat$N==200,]$theoretical.power <- 0.05
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(3,13,15,17,19),'B') & res.dat$N==200,]$theoretical.power <- 0.3258
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(13,15,17,19),'C') & res.dat$N==200,]$theoretical.power <- 0.3258
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(13,15,17,19),'D') & res.dat$N==200,]$theoretical.power <- 0.8538
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(13,15,17,19),'E') & res.dat$N==200,]$theoretical.power <- 0.8538
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(13,15,17,19),'F') & res.dat$N==200,]$theoretical.power <- 0.3258
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(13,15,17,19),'G') & res.dat$N==200,]$theoretical.power <- 0.8538
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(3,'C') & res.dat$N==200,]$theoretical.power <- 0.8538
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(3,'D') & res.dat$N==200,]$theoretical.power <- 0.3258
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(3,'E') & res.dat$N==200,]$theoretical.power <- 0.8538
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Scénarios J=7 / M=4
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(4,14,16,18,20),'A') & res.dat$N==200,]$theoretical.power <- 0.05
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(4,14,16,18,20),'B') & res.dat$N==200,]$theoretical.power <- 0.4321
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(14,16,18,20),'C') & res.dat$N==200,]$theoretical.power <- 0.4321
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(14,16,18,20),'D') & res.dat$N==200,]$theoretical.power <- 0.9471
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(14,16,18,20),'E') & res.dat$N==200,]$theoretical.power <- 0.9471
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(14,16,18,20),'F') & res.dat$N==200,]$theoretical.power <- 0.4321
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(14,16,18,20),'G') & res.dat$N==200,]$theoretical.power <- 0.9471
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(4,'C') & res.dat$N==200,]$theoretical.power <- 0.9471
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(4,'D') & res.dat$N==200,]$theoretical.power <- 0.4321
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(4,'E') & res.dat$N==200,]$theoretical.power <- 0.9471
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### Scénarios N=300
|
|
|
|
### Scénarios N=300
|
|
|
|
|
|
|
|
|
|
|
|
## Scénarios J=4 / M=2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(1,5,7,9,11),'A') & res.dat$N==300,]$theoretical.power <- 0.05
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(1,5,7,9,11),'B') & res.dat$N==300,]$theoretical.power <- 0.3660
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(5,7,9,11),'C') & res.dat$N==300,]$theoretical.power <- 0.3660
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(5,7,9,11),'D') & res.dat$N==300,]$theoretical.power <- 0.8981
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(5,7,9,11),'E') & res.dat$N==300,]$theoretical.power <- 0.8981
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(5,7,9,11),'F') & res.dat$N==300,]$theoretical.power <- 0.3660
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(5,7,9,11),'G') & res.dat$N==300,]$theoretical.power <- 0.8981
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(1,'C') & res.dat$N==300,]$theoretical.power <- 0.8981
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(1,'D') & res.dat$N==300,]$theoretical.power <- 0.3660
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(1,'E') & res.dat$N==300,]$theoretical.power <- 0.8981
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Scénarios J=4 / M=4
|
|
|
|
## Scénarios J=4 / M=4
|
|
|
|
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(2,6,8,10,12),'A') & res.dat$N==300,]$theoretical.power <- 0.05
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(2,6,8,10,12),'A') & res.dat$N==300,]$theoretical.power <- 0.05
|
|
|
@ -1084,26 +1020,8 @@ res.dat[res.dat$scenario %in% paste0(c(2,6,8,10,12),'B') & res.dat$N==300,]$theo
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(6,8,10,12),'C') & res.dat$N==300,]$theoretical.power <- 0.5373
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(6,8,10,12),'C') & res.dat$N==300,]$theoretical.power <- 0.5373
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(6,8,10,12),'D') & res.dat$N==300,]$theoretical.power <- 0.9834
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(6,8,10,12),'D') & res.dat$N==300,]$theoretical.power <- 0.9834
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(6,8,10,12),'E') & res.dat$N==300,]$theoretical.power <- 0.9834
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(6,8,10,12),'E') & res.dat$N==300,]$theoretical.power <- 0.9834
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(6,8,10,12),'F') & res.dat$N==300,]$theoretical.power <- 0.5373
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(6,8,10,12),'G') & res.dat$N==300,]$theoretical.power <- 0.9834
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(2,'C') & res.dat$N==300,]$theoretical.power <- 0.9834
|
|
|
|
res.dat[res.dat$scenario %in% paste0(2,'C') & res.dat$N==300,]$theoretical.power <- 0.9834
|
|
|
|
res.dat[res.dat$scenario %in% paste0(2,'D') & res.dat$N==300,]$theoretical.power <- 0.5373
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(2,'E') & res.dat$N==300,]$theoretical.power <- 0.9834
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Scénarios J=7 / M=2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(3,13,15,17,19),'A') & res.dat$N==300,]$theoretical.power <- 0.05
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(3,13,15,17,19),'B') & res.dat$N==300,]$theoretical.power <- 0.4550
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(13,15,17,19),'C') & res.dat$N==300,]$theoretical.power <- 0.4550
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(13,15,17,19),'D') & res.dat$N==300,]$theoretical.power <- 0.9584
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(13,15,17,19),'E') & res.dat$N==300,]$theoretical.power <- 0.9584
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(13,15,17,19),'F') & res.dat$N==300,]$theoretical.power <- 0.4550
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(13,15,17,19),'G') & res.dat$N==300,]$theoretical.power <- 0.9584
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(3,'C') & res.dat$N==300,]$theoretical.power <- 0.9584
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(3,'D') & res.dat$N==300,]$theoretical.power <- 0.4550
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(3,'E') & res.dat$N==300,]$theoretical.power <- 0.9584
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Scénarios J=7 / M=4
|
|
|
|
## Scénarios J=7 / M=4
|
|
|
|
|
|
|
|
|
|
|
@ -1112,30 +1030,12 @@ res.dat[res.dat$scenario %in% paste0(c(4,14,16,18,20),'B') & res.dat$N==300,]$th
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(14,16,18,20),'C') & res.dat$N==300,]$theoretical.power <- 0.5907
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(14,16,18,20),'C') & res.dat$N==300,]$theoretical.power <- 0.5907
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(14,16,18,20),'D') & res.dat$N==300,]$theoretical.power <- 0.9919
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(14,16,18,20),'D') & res.dat$N==300,]$theoretical.power <- 0.9919
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(14,16,18,20),'E') & res.dat$N==300,]$theoretical.power <- 0.9919
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(14,16,18,20),'E') & res.dat$N==300,]$theoretical.power <- 0.9919
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(14,16,18,20),'F') & res.dat$N==300,]$theoretical.power <- 0.5907
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(14,16,18,20),'G') & res.dat$N==300,]$theoretical.power <- 0.9919
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(4,'C') & res.dat$N==300,]$theoretical.power <- 0.9919
|
|
|
|
res.dat[res.dat$scenario %in% paste0(4,'C') & res.dat$N==300,]$theoretical.power <- 0.9919
|
|
|
|
res.dat[res.dat$scenario %in% paste0(4,'D') & res.dat$N==300,]$theoretical.power <- 0.5907
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(4,'E') & res.dat$N==300,]$theoretical.power <- 0.9919
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### Scénarios N=50
|
|
|
|
### Scénarios N=50
|
|
|
|
|
|
|
|
|
|
|
|
## Scénarios J=4 / M=2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(1,5,7,9,11),'A') & res.dat$N==50,]$theoretical.power <- 0.05
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(1,5,7,9,11),'B') & res.dat$N==50,]$theoretical.power <- 0.1013
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(5,7,9,11),'C') & res.dat$N==50,]$theoretical.power <- 0.1013
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(5,7,9,11),'D') & res.dat$N==50,]$theoretical.power <- 0.2615
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(5,7,9,11),'E') & res.dat$N==50,]$theoretical.power <- 0.2615
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(5,7,9,11),'F') & res.dat$N==50,]$theoretical.power <- 0.1013
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(5,7,9,11),'G') & res.dat$N==50,]$theoretical.power <- 0.2615
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(1,'C') & res.dat$N==50,]$theoretical.power <- 0.2615
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(1,'D') & res.dat$N==50,]$theoretical.power <- 0.1013
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(1,'E') & res.dat$N==50,]$theoretical.power <- 0.2615
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Scénarios J=4 / M=4
|
|
|
|
## Scénarios J=4 / M=4
|
|
|
|
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(2,6,8,10,12),'A') & res.dat$N==50,]$theoretical.power <- 0.05
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(2,6,8,10,12),'A') & res.dat$N==50,]$theoretical.power <- 0.05
|
|
|
@ -1143,26 +1043,8 @@ res.dat[res.dat$scenario %in% paste0(c(2,6,8,10,12),'B') & res.dat$N==50,]$theor
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(6,8,10,12),'C') & res.dat$N==50,]$theoretical.power <- 0.1339
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(6,8,10,12),'C') & res.dat$N==50,]$theoretical.power <- 0.1339
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(6,8,10,12),'D') & res.dat$N==50,]$theoretical.power <- 0.3863
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(6,8,10,12),'D') & res.dat$N==50,]$theoretical.power <- 0.3863
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(6,8,10,12),'E') & res.dat$N==50,]$theoretical.power <- 0.3863
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(6,8,10,12),'E') & res.dat$N==50,]$theoretical.power <- 0.3863
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(6,8,10,12),'F') & res.dat$N==50,]$theoretical.power <- 0.1339
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(6,8,10,12),'G') & res.dat$N==50,]$theoretical.power <- 0.3863
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(2,'C') & res.dat$N==50,]$theoretical.power <- 0.3863
|
|
|
|
res.dat[res.dat$scenario %in% paste0(2,'C') & res.dat$N==50,]$theoretical.power <- 0.3863
|
|
|
|
res.dat[res.dat$scenario %in% paste0(2,'D') & res.dat$N==50,]$theoretical.power <- 0.1339
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(2,'E') & res.dat$N==50,]$theoretical.power <- 0.3863
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Scénarios J=7 / M=2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(3,13,15,17,19),'A') & res.dat$N==50,]$theoretical.power <- 0.05
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(3,13,15,17,19),'B') & res.dat$N==50,]$theoretical.power <- 0.1171
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(13,15,17,19),'C') & res.dat$N==50,]$theoretical.power <- 0.1171
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(13,15,17,19),'D') & res.dat$N==50,]$theoretical.power <- 0.3236
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(13,15,17,19),'E') & res.dat$N==50,]$theoretical.power <- 0.3236
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(13,15,17,19),'F') & res.dat$N==50,]$theoretical.power <- 0.1171
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(13,15,17,19),'G') & res.dat$N==50,]$theoretical.power <- 0.3236
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(3,'C') & res.dat$N==50,]$theoretical.power <- 0.3236
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(3,'D') & res.dat$N==50,]$theoretical.power <- 0.1171
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(3,'E') & res.dat$N==50,]$theoretical.power <- 0.3236
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Scénarios J=7 / M=4
|
|
|
|
## Scénarios J=7 / M=4
|
|
|
|
|
|
|
|
|
|
|
@ -1171,17 +1053,12 @@ res.dat[res.dat$scenario %in% paste0(c(4,14,16,18,20),'B') & res.dat$N==50,]$the
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(14,16,18,20),'C') & res.dat$N==50,]$theoretical.power <- 0.1448
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(14,16,18,20),'C') & res.dat$N==50,]$theoretical.power <- 0.1448
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(14,16,18,20),'D') & res.dat$N==50,]$theoretical.power <- 0.4328
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(14,16,18,20),'D') & res.dat$N==50,]$theoretical.power <- 0.4328
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(14,16,18,20),'E') & res.dat$N==50,]$theoretical.power <- 0.4328
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(14,16,18,20),'E') & res.dat$N==50,]$theoretical.power <- 0.4328
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(14,16,18,20),'F') & res.dat$N==50,]$theoretical.power <- 0.1448
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(c(14,16,18,20),'G') & res.dat$N==50,]$theoretical.power <- 0.4328
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(4,'C') & res.dat$N==50,]$theoretical.power <- 0.4328
|
|
|
|
res.dat[res.dat$scenario %in% paste0(4,'C') & res.dat$N==50,]$theoretical.power <- 0.4328
|
|
|
|
res.dat[res.dat$scenario %in% paste0(4,'D') & res.dat$N==50,]$theoretical.power <- 0.1448
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario %in% paste0(4,'E') & res.dat$N==50,]$theoretical.power <- 0.4328
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### DIF scenarios
|
|
|
|
### DIF scenarios
|
|
|
|
|
|
|
|
|
|
|
|
res.dat.dif$theoretical.power <- res.dat[81:nrow(res.dat),]$theoretical.power
|
|
|
|
res.dat.dif$theoretical.power <- res.dat[res.dat$dif.size!=0,]$theoretical.power
|
|
|
|
res.dat.dif.rosali$theoretical.power <- res.dat$theoretical.power
|
|
|
|
res.dat.dif.rosali$theoretical.power <- res.dat$theoretical.power
|
|
|
|
res.dat.dif.resali$theoretical.power <- res.dat$theoretical.power
|
|
|
|
res.dat.dif.resali$theoretical.power <- res.dat$theoretical.power
|
|
|
|
|
|
|
|
|
|
|
@ -1200,37 +1077,178 @@ res.dat.dif.rosali$method <- "ROSALI"
|
|
|
|
res.dat.dif.resali$method <- "RESIDUS"
|
|
|
|
res.dat.dif.resali$method <- "RESIDUS"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Correction of N=50 scenarios
|
|
|
|
# Items polytomiques
|
|
|
|
|
|
|
|
|
|
|
|
res.dat[res.dat$N==50,]$dif.size <- sapply(which(res.dat$N==50),function(k) res.dat[k-1,]$dif.size)
|
|
|
|
|
|
|
|
res.dat.dif[res.dat.dif$N==50,]$dif.size <- sapply(which(res.dat.dif$N==50),function(k) res.dat.dif[k-1,]$dif.size)
|
|
|
|
|
|
|
|
res.dat.dif.rosali[res.dat.dif.rosali$N==50,]$dif.size <- sapply(which(res.dat.dif.rosali$N==50),function(k) res.dat.dif.rosali[k-1,]$dif.size)
|
|
|
|
|
|
|
|
res.dat.dif.resali[res.dat.dif.resali$N==50,]$dif.size <- sapply(which(res.dat.dif.resali$N==50),function(k) res.dat.dif.resali[k-1,]$dif.size)
|
|
|
|
|
|
|
|
res.dat[res.dat$dif.size!=0 & res.dat$nb.dif==0,]$nb.dif <- 1
|
|
|
|
|
|
|
|
res.dat.dif <- res.dat.dif %>%
|
|
|
|
|
|
|
|
relocate(method, .after = theoretical.power)
|
|
|
|
|
|
|
|
res.dat[res.dat$scenario=="10B",]$dif.size <- 0.3
|
|
|
|
|
|
|
|
res.dat.dif[res.dat.dif$scenario=="10B",]$dif.size <- 0.3
|
|
|
|
|
|
|
|
res.dat.dif.rosali[res.dat.dif.rosali$scenario=="10B",]$dif.size <- 0.3
|
|
|
|
|
|
|
|
res.dat.dif.resali[res.dat.dif.resali$scenario=="10B",]$dif.size <- 0.3
|
|
|
|
|
|
|
|
res.dat.dif[res.dat.dif$N=="50" & res.dat.dif$nb.dif>0,]$eff.size <- rep(c(0,0.2,0.2,0.4,0.4,-0.2,-0.4),16)
|
|
|
|
|
|
|
|
res.dat.dif[res.dat.dif$N=="50" & res.dat.dif$nb.dif>0 & res.dat.dif$scenario.type=="C",]$bias <- res.dat.dif[res.dat.dif$N=="50" & res.dat.dif$nb.dif>0 & res.dat.dif$scenario.type=="C",]$bias -0.2
|
|
|
|
|
|
|
|
res.dat.dif[res.dat.dif$N=="50" & res.dat.dif$nb.dif>0 & res.dat.dif$scenario.type=="D",]$bias <- res.dat.dif[res.dat.dif$N=="50" & res.dat.dif$nb.dif>0 & res.dat.dif$scenario.type=="D",]$bias +0.6
|
|
|
|
|
|
|
|
res.dat.dif[res.dat.dif$N=="50" & res.dat.dif$nb.dif>0 & res.dat.dif$scenario.type=="E",]$bias <- res.dat.dif[res.dat.dif$N=="50" & res.dat.dif$nb.dif>0 & res.dat.dif$scenario.type=="E",]$bias +0.8
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res.dat[res.dat$N=="50" & res.dat$nb.dif>0,]$eff.size <- rep(c(0,0.2,0.2,0.4,0.4,-0.2,-0.4),16)
|
|
|
|
|
|
|
|
res.dat[res.dat$N=="50" & res.dat$nb.dif>0 & res.dat$scenario.type=="C",]$bias <- res.dat[res.dat$N=="50" & res.dat$nb.dif>0 & res.dat$scenario.type=="C",]$bias -0.2
|
|
|
|
|
|
|
|
res.dat[res.dat$N=="50" & res.dat$nb.dif>0 & res.dat$scenario.type=="D",]$bias <- res.dat[res.dat$N=="50" & res.dat$nb.dif>0 & res.dat$scenario.type=="D",]$bias +0.6
|
|
|
|
|
|
|
|
res.dat[res.dat$N=="50" & res.dat$nb.dif>0 & res.dat$scenario.type=="E",]$bias <- res.dat[res.dat$N=="50" & res.dat$nb.dif>0 & res.dat$scenario.type=="E",]$bias +0.8
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res.dat.dicho <- res.dat[res.dat$M==2,]
|
|
|
|
res.dat.full <- res.dat[res.dat$M==4,]
|
|
|
|
res.dat.dicho <- rbind(res.dat.dicho,res.dat.dif[res.dat.dif$M==2,])
|
|
|
|
res.dat.full <- rbind(res.dat.full,res.dat.dif[res.dat.dif$M==4,])
|
|
|
|
res.dat.dicho <- rbind.fill(res.dat.dicho,res.dat.dif.rosali[res.dat.dif.rosali$M==2,])
|
|
|
|
res.dat.full <- rbind.fill(res.dat.full,res.dat.dif.rosali[res.dat.dif.rosali$M==4,])
|
|
|
|
res.dat.dicho <- rbind.fill(res.dat.dicho,res.dat.dif.resali[res.dat.dif.resali$M==2,])
|
|
|
|
res.dat.full <- rbind.fill(res.dat.full,res.dat.dif.resali[res.dat.dif.resali$M==4,])
|
|
|
|
|
|
|
|
|
|
|
|
# Items polytomiques
|
|
|
|
##############################################################################
|
|
|
|
|
|
|
|
#----------------------------------------------------------------------------#
|
|
|
|
|
|
|
|
############################ ARTICLE TABLE OUTPUT ############################
|
|
|
|
|
|
|
|
#----------------------------------------------------------------------------#
|
|
|
|
|
|
|
|
##############################################################################
|
|
|
|
|
|
|
|
|
|
|
|
res.dat.poly <- res.dat[res.dat$M==4,]
|
|
|
|
# STRATEGY 1 - IGNORE DIF
|
|
|
|
res.dat.poly <- rbind(res.dat.poly,res.dat.dif[res.dat.dif$M==4,])
|
|
|
|
|
|
|
|
res.dat.poly <- rbind.fill(res.dat.poly,res.dat.dif.rosali[res.dat.dif.rosali$M==4,])
|
|
|
|
res.dat.article <- res.dat[,c("N","J","eff.size","nb.dif","dif.size",
|
|
|
|
res.dat.poly <- rbind.fill(res.dat.poly,res.dat.dif.resali[res.dat.dif.resali$M==4,])
|
|
|
|
"m.beta","bias","true.value.in.ci.p","h0.rejected.p",
|
|
|
|
|
|
|
|
"theoretical.power")]
|
|
|
|
|
|
|
|
colnames(res.dat.article)[3] <- "true.beta"
|
|
|
|
|
|
|
|
colnames(res.dat.article)[5] <- "true.gamma"
|
|
|
|
|
|
|
|
colnames(res.dat.article)[6] <- "betahat"
|
|
|
|
|
|
|
|
colnames(res.dat.article)[8] <- "coverage"
|
|
|
|
|
|
|
|
colnames(res.dat.article)[9] <- "power"
|
|
|
|
|
|
|
|
res.dat.article[,6:10] <- round(res.dat.article[,6:10],2)
|
|
|
|
|
|
|
|
res.dat.article[res.dat.article$true.beta==0,"typeIerror"] <- res.dat.article[res.dat.article$true.beta==0,"power"]
|
|
|
|
|
|
|
|
res.dat.article[res.dat.article$true.beta==0,"power"] <- NA
|
|
|
|
|
|
|
|
res.dat.article <- res.dat.article[,c(1:7,11,9:10,8)]
|
|
|
|
|
|
|
|
res.dat.article[res.dat.article$nb.dif==0,"true.gamma"] <- NA
|
|
|
|
|
|
|
|
res.dat.article[is.na(res.dat.article)] <- " "
|
|
|
|
|
|
|
|
res.dat.article$bias <- -1*res.dat.article$bias
|
|
|
|
|
|
|
|
res.dat.article.ignore <- reshape(res.dat.article[res.dat.article$nb.dif>0,],
|
|
|
|
|
|
|
|
direction = "wide", idvar = c("J","true.beta","nb.dif",'true.gamma'),timevar = "N" )
|
|
|
|
|
|
|
|
write.csv(res.dat.article.ignore,"/home/corentin/Documents/These/Valorisation/Articles/Simulations 1/Tables/res_ignoreDIF.csv")
|
|
|
|
|
|
|
|
res.dat.article.nodif.long <- res.dat.article[res.dat.article$nb.dif==0,]
|
|
|
|
|
|
|
|
res.dat.article.nodif <- reshape(res.dat.article[res.dat.article$nb.dif==0,],
|
|
|
|
|
|
|
|
direction = "wide", idvar = c("J","true.beta","nb.dif",'true.gamma'),timevar = "N" )
|
|
|
|
|
|
|
|
write.csv(res.dat.article.nodif,"/home/corentin/Documents/These/Valorisation/Articles/Simulations 1/Tables/res_noDIF.csv")
|
|
|
|
|
|
|
|
res.dat.article <- reshape(res.dat.article[res.dat.article$nb.dif==0,],
|
|
|
|
|
|
|
|
direction = "wide", idvar = c("J","true.beta","nb.dif",'true.gamma'),timevar = "N" )
|
|
|
|
|
|
|
|
write.csv(res.dat.article.nodif,"/home/corentin/Documents/These/Valorisation/Articles/Simulations 1/Tables/res_noDIF.csv")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res.dat.article.2 <- res.dat[,c("N","J","eff.size","nb.dif","dif.size",
|
|
|
|
|
|
|
|
"m.beta","bias","true.value.in.ci.p","h0.rejected.p",
|
|
|
|
|
|
|
|
"theoretical.power")]
|
|
|
|
|
|
|
|
colnames(res.dat.article.2)[3] <- "true.beta"
|
|
|
|
|
|
|
|
colnames(res.dat.article.2)[5] <- "true.gamma"
|
|
|
|
|
|
|
|
colnames(res.dat.article.2)[6] <- "betahat"
|
|
|
|
|
|
|
|
colnames(res.dat.article.2)[8] <- "coverage"
|
|
|
|
|
|
|
|
colnames(res.dat.article.2)[9] <- "power"
|
|
|
|
|
|
|
|
res.dat.article.2[,6:10] <- round(res.dat.article.2[,6:10],2)
|
|
|
|
|
|
|
|
res.dat.article.2[res.dat.article.2$true.beta==0,"typeIerror"] <- res.dat.article.2[res.dat.article.2$true.beta==0,"power"]
|
|
|
|
|
|
|
|
res.dat.article.2[res.dat.article.2$true.beta==0,"power"] <- NA
|
|
|
|
|
|
|
|
res.dat.article.2 <- res.dat.article.2[,c(1:7,11,9:10,8)]
|
|
|
|
|
|
|
|
res.dat.article.2[res.dat.article.2$nb.dif==0,"true.gamma"] <- NA
|
|
|
|
|
|
|
|
res.dat.article.2[is.na(res.dat.article.2)] <- " "
|
|
|
|
|
|
|
|
res.dat.article.2$bias <- -1*res.dat.article.2$bias
|
|
|
|
|
|
|
|
res.dat.article.nodif.2 <- res.dat.article.2[res.dat.article.2$nb.dif==0,]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# STRATEGY 2 - ROSALI
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res.dat.article.rosali <- res.dat.dif.rosali[,c("N","J","eff.size","nb.dif","dif.size",
|
|
|
|
|
|
|
|
"m.beta","bias","true.value.in.ci.p","h0.rejected.p",
|
|
|
|
|
|
|
|
"theoretical.power")]
|
|
|
|
|
|
|
|
colnames(res.dat.article.rosali)[3] <- "true.beta"
|
|
|
|
|
|
|
|
colnames(res.dat.article.rosali)[5] <- "true.gamma"
|
|
|
|
|
|
|
|
colnames(res.dat.article.rosali)[6] <- "betahat"
|
|
|
|
|
|
|
|
colnames(res.dat.article.rosali)[8] <- "coverage"
|
|
|
|
|
|
|
|
colnames(res.dat.article.rosali)[9] <- "power"
|
|
|
|
|
|
|
|
res.dat.article.rosali[res.dat.article.rosali$true.beta==0,"typeIerror"] <- res.dat.article.rosali[res.dat.article.rosali$true.beta==0,"power"]
|
|
|
|
|
|
|
|
res.dat.article.rosali[res.dat.article.rosali$true.beta==0,"power"] <- NA
|
|
|
|
|
|
|
|
res.dat.article.rosali <- res.dat.article.rosali[,c(1:7,11,9:10,8)]
|
|
|
|
|
|
|
|
res.dat.article.rosali[res.dat.article.rosali$nb.dif==0,"true.gamma"] <- NA
|
|
|
|
|
|
|
|
res.dat.article.rosali[is.na(res.dat.article.rosali)] <- " "
|
|
|
|
|
|
|
|
res.dat.article.rosali$bias <- -1*res.dat.article.rosali$bias
|
|
|
|
|
|
|
|
res.dat.article.rosali <- reshape(res.dat.article.rosali,
|
|
|
|
|
|
|
|
direction = "wide", idvar = c("J","true.beta","nb.dif",'true.gamma'),timevar = "N" )
|
|
|
|
|
|
|
|
res.dat.article.rosali.dif <- res.dat.article.rosali[res.dat.article.rosali$nb.dif>0,]
|
|
|
|
|
|
|
|
write.csv(res.dat.article.rosali.dif,"/home/corentin/Documents/These/Valorisation/Articles/Simulations 1/Tables/res_ROSALI_DIF.csv")
|
|
|
|
|
|
|
|
res.dat.article.rosali.nodif <- res.dat.article.rosali[res.dat.article.rosali$nb.dif==0,]
|
|
|
|
|
|
|
|
write.csv(res.dat.article.rosali.nodif,"/home/corentin/Documents/These/Valorisation/Articles/Simulations 1/Tables/res_ROSALI_noDIF.csv")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res.dat.article.rosali.2 <- res.dat.dif.rosali[,c("N","J","eff.size","nb.dif","dif.size",
|
|
|
|
|
|
|
|
"m.beta","bias","true.value.in.ci.p","h0.rejected.p",
|
|
|
|
|
|
|
|
"theoretical.power")]
|
|
|
|
|
|
|
|
colnames(res.dat.article.rosali.2)[3] <- "true.beta"
|
|
|
|
|
|
|
|
colnames(res.dat.article.rosali.2)[5] <- "true.gamma"
|
|
|
|
|
|
|
|
colnames(res.dat.article.rosali.2)[6] <- "betahat"
|
|
|
|
|
|
|
|
colnames(res.dat.article.rosali.2)[8] <- "coverage"
|
|
|
|
|
|
|
|
colnames(res.dat.article.rosali.2)[9] <- "power"
|
|
|
|
|
|
|
|
res.dat.article.rosali.2[res.dat.article.rosali.2$true.beta==0,"typeIerror"] <- res.dat.article.rosali.2[res.dat.article.rosali.2$true.beta==0,"power"]
|
|
|
|
|
|
|
|
res.dat.article.rosali.2[res.dat.article.rosali.2$true.beta==0,"power"] <- NA
|
|
|
|
|
|
|
|
res.dat.article.rosali.2 <- res.dat.article.rosali.2[,c(1:7,11,9:10,8)]
|
|
|
|
|
|
|
|
res.dat.article.rosali.2[res.dat.article.rosali.2$nb.dif==0,"true.gamma"] <- NA
|
|
|
|
|
|
|
|
res.dat.article.rosali.2[is.na(res.dat.article.rosali.2)] <- " "
|
|
|
|
|
|
|
|
res.dat.article.rosali.2$bias <- -1*res.dat.article.rosali.2$bias
|
|
|
|
|
|
|
|
res.dat.article.rosali.2.nodif <- res.dat.article.rosali.2[res.dat.article.rosali.2$nb.dif==0,]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# STRATEGY 3 - RESIDIF
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res.dat.article.residif <- res.dat.dif.resali[,c("N","J","eff.size","nb.dif","dif.size",
|
|
|
|
|
|
|
|
"m.beta","bias","true.value.in.ci.p","h0.rejected.p",
|
|
|
|
|
|
|
|
"theoretical.power")]
|
|
|
|
|
|
|
|
colnames(res.dat.article.residif)[3] <- "true.beta"
|
|
|
|
|
|
|
|
colnames(res.dat.article.residif)[5] <- "true.gamma"
|
|
|
|
|
|
|
|
colnames(res.dat.article.residif)[6] <- "betahat"
|
|
|
|
|
|
|
|
colnames(res.dat.article.residif)[8] <- "coverage"
|
|
|
|
|
|
|
|
colnames(res.dat.article.residif)[9] <- "power"
|
|
|
|
|
|
|
|
res.dat.article.residif[res.dat.article.residif$true.beta==0,"typeIerror"] <- res.dat.article.residif[res.dat.article.residif$true.beta==0,"power"]
|
|
|
|
|
|
|
|
res.dat.article.residif[res.dat.article.residif$true.beta==0,"power"] <- NA
|
|
|
|
|
|
|
|
res.dat.article.residif <- res.dat.article.residif[,c(1:7,11,9:10,8)]
|
|
|
|
|
|
|
|
res.dat.article.residif[res.dat.article.residif$nb.dif==0,"true.gamma"] <- NA
|
|
|
|
|
|
|
|
res.dat.article.residif[is.na(res.dat.article.residif)] <- " "
|
|
|
|
|
|
|
|
res.dat.article.residif$bias <- -1*res.dat.article.residif$bias
|
|
|
|
|
|
|
|
res.dat.article.residif <- reshape(res.dat.article.residif,
|
|
|
|
|
|
|
|
direction = "wide", idvar = c("J","true.beta","nb.dif",'true.gamma'),timevar = "N" )
|
|
|
|
|
|
|
|
res.dat.article.residif.dif <- res.dat.article.residif[res.dat.article.residif$nb.dif>0,]
|
|
|
|
|
|
|
|
write.csv(res.dat.article.residif.dif,"/home/corentin/Documents/These/Valorisation/Articles/Simulations 1/Tables/res_RESIDIF_DIF.csv")
|
|
|
|
|
|
|
|
res.dat.article.residif.nodif <- res.dat.article.residif[res.dat.article.residif$nb.dif==0,]
|
|
|
|
|
|
|
|
write.csv(res.dat.article.residif.nodif,"/home/corentin/Documents/These/Valorisation/Articles/Simulations 1/Tables/res_RESIDIF_noDIF.csv")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res.dat.article.residif.2 <- res.dat.dif.resali[,c("N","J","eff.size","nb.dif","dif.size",
|
|
|
|
|
|
|
|
"m.beta","bias","true.value.in.ci.p","h0.rejected.p",
|
|
|
|
|
|
|
|
"theoretical.power")]
|
|
|
|
|
|
|
|
colnames(res.dat.article.residif.2)[3] <- "true.beta"
|
|
|
|
|
|
|
|
colnames(res.dat.article.residif.2)[5] <- "true.gamma"
|
|
|
|
|
|
|
|
colnames(res.dat.article.residif.2)[6] <- "betahat"
|
|
|
|
|
|
|
|
colnames(res.dat.article.residif.2)[8] <- "coverage"
|
|
|
|
|
|
|
|
colnames(res.dat.article.residif.2)[9] <- "power"
|
|
|
|
|
|
|
|
res.dat.article.residif.2[res.dat.article.residif.2$true.beta==0,"typeIerror"] <- res.dat.article.residif.2[res.dat.article.residif.2$true.beta==0,"power"]
|
|
|
|
|
|
|
|
res.dat.article.residif.2[res.dat.article.residif.2$true.beta==0,"power"] <- NA
|
|
|
|
|
|
|
|
res.dat.article.residif.2 <- res.dat.article.residif.2[,c(1:7,11,9:10,8)]
|
|
|
|
|
|
|
|
res.dat.article.residif.2[res.dat.article.residif.2$nb.dif==0,"true.gamma"] <- NA
|
|
|
|
|
|
|
|
res.dat.article.residif.2[is.na(res.dat.article.residif.2)] <- " "
|
|
|
|
|
|
|
|
res.dat.article.residif.2$bias <- -1*res.dat.article.residif.2$bias
|
|
|
|
|
|
|
|
res.dat.article.residif.2.nodif <- res.dat.article.residif.2[res.dat.article.residif.2$nb.dif==0,]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# STRATEGY 4 - PERFECT-DIF
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res.dat.article.dif <- res.dat.dif[,c("N","J","eff.size","nb.dif","dif.size",
|
|
|
|
|
|
|
|
"m.beta","bias","true.value.in.ci.p","h0.rejected.p",
|
|
|
|
|
|
|
|
"theoretical.power")]
|
|
|
|
|
|
|
|
colnames(res.dat.article.dif)[3] <- "true.beta"
|
|
|
|
|
|
|
|
colnames(res.dat.article.dif)[5] <- "true.gamma"
|
|
|
|
|
|
|
|
colnames(res.dat.article.dif)[6] <- "betahat"
|
|
|
|
|
|
|
|
colnames(res.dat.article.dif)[8] <- "coverage"
|
|
|
|
|
|
|
|
colnames(res.dat.article.dif)[9] <- "power"
|
|
|
|
|
|
|
|
res.dat.article.dif[res.dat.article.dif$true.beta==0,"typeIerror"] <- res.dat.article.dif[res.dat.article.dif$true.beta==0,"power"]
|
|
|
|
|
|
|
|
res.dat.article.dif[res.dat.article.dif$true.beta==0,"power"] <- NA
|
|
|
|
|
|
|
|
res.dat.article.dif <- res.dat.article.dif[,c(1:7,11,9:10,8)]
|
|
|
|
|
|
|
|
res.dat.article.dif[res.dat.article.dif$nb.dif==0,"true.gamma"] <- NA
|
|
|
|
|
|
|
|
res.dat.article.dif[is.na(res.dat.article.dif)] <- " "
|
|
|
|
|
|
|
|
res.dat.article.dif$bias <- -1*res.dat.article.dif$bias
|
|
|
|
|
|
|
|
write.csv(res.dat.article.dif,"/home/corentin/Documents/These/Valorisation/Articles/Simulations 1/Tables/res_perfect.csv")
|
|
|
|
|
|
|
|
res.dat.article.dif <- reshape(res.dat.article.dif,
|
|
|
|
|
|
|
|
direction = "wide", idvar = c("J","true.beta","nb.dif",'true.gamma'),timevar = "N" )
|
|
|
|
|
|
|
|
write.csv(res.dat.article.dif,"/home/corentin/Documents/These/Valorisation/Articles/Simulations 1/Tables/res_perfect.csv")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res.dat.article.dif.2 <- res.dat.dif[,c("N","J","eff.size","nb.dif","dif.size",
|
|
|
|
|
|
|
|
"m.beta","bias","true.value.in.ci.p","h0.rejected.p",
|
|
|
|
|
|
|
|
"theoretical.power")]
|
|
|
|
|
|
|
|
colnames(res.dat.article.dif.2)[3] <- "true.beta"
|
|
|
|
|
|
|
|
colnames(res.dat.article.dif.2)[5] <- "true.gamma"
|
|
|
|
|
|
|
|
colnames(res.dat.article.dif.2)[6] <- "betahat"
|
|
|
|
|
|
|
|
colnames(res.dat.article.dif.2)[8] <- "coverage"
|
|
|
|
|
|
|
|
colnames(res.dat.article.dif.2)[9] <- "power"
|
|
|
|
|
|
|
|
res.dat.article.dif.2[res.dat.article.dif.2$true.beta==0,"typeIerror"] <- res.dat.article.dif.2[res.dat.article.dif.2$true.beta==0,"power"]
|
|
|
|
|
|
|
|
res.dat.article.dif.2[res.dat.article.dif.2$true.beta==0,"power"] <- NA
|
|
|
|
|
|
|
|
res.dat.article.dif.2 <- res.dat.article.dif.2[,c(1:7,11,9:10,8)]
|
|
|
|
|
|
|
|
res.dat.article.dif.2[res.dat.article.dif.2$nb.dif==0,"true.gamma"] <- NA
|
|
|
|
|
|
|
|
res.dat.article.dif.2[is.na(res.dat.article.dif.2)] <- " "
|
|
|
|
|
|
|
|
res.dat.article.dif.2$bias <- -1*res.dat.article.dif.2$bias
|
|
|
|