123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646 |
- library(moments)
- library(readxl)
- library(car)
- library(irr)
- addcol<-function(Table, cols=50){
- while(ncol(Table)<cols){
- extracol<-rep(NA,21)
- Table=cbind(Table, extracol)
- }
- return(Table)
- }
- Fredi="/home/user/owncloud/Manual_Rotating_Beam_Analyse/Manual_RotatingBeam_ Analyse_ Fredi.xlsx"
- Markus="/home/user/owncloud/Manual_Rotating_Beam_Analyse/Manual_RotatingBeam_ Analyse_ Markus.xlsx"
- Sebastian="/home/user/owncloud/Manual_Rotating_Beam_Analyse/Manual_RotatingBeam_ Analyse_ Sebastian.xlsx"
- TM=read_xlsx(Markus, col_names = T)
- TF=read_xlsx(Fredi, col_names = T)
- TS=read_xlsx(Sebastian, col_names = T)
- StartM=data.frame()
- StartF=data.frame()
- StartS=data.frame()
- StartTDLC1=data.frame()
- EndM=data.frame()
- EndF=data.frame()
- EndS=data.frame()
- EndDLC=data.frame()
- SpeedM=data.frame()
- SpeedF=data.frame()
- SpeedS=data.frame()
- SpeedDLC=data.frame()
- ICCStart<-data.frame()
- ICCEnd<-data.frame()
- ICCSpeed<-data.frame()
- ICCHLD<-data.frame()
- cols<-c(ncol(TM), ncol(TF), ncol(TS), ncol(TDLC1))
- TM=addcol(TM, max(cols))
- TF=addcol(TF, max(cols))
- TS=addcol(TS, max(cols))
- TDLC1=addcol(TDLC1, max(cols))
- for(i in 1:(nrow(TM)-1)){
- StartM[i,1]<-as.numeric(TM$Start[i+1])
- StartM[i,2]<-"M"
- }
- for(i in 1:(nrow(TF)-1)){
- StartF[i,1]<-as.numeric(TF$Start[i+1])
- StartF[i,2]<-"F"
- }
- for(i in 1:(nrow(TS)-1)){
- StartS[i,1]<-as.numeric(TS$Start[i+1])
- StartS[i,2]<-"S"
- }
- for(i in 1:(nrow(TDLC1)-1)){
- StartTDLC1[i,1]<-as.numeric(TDLC1$Start[i+1])
- StartTDLC1[i,2]<-"DLC"
- }
- for(i in 1:(nrow(TM)-1)){
- EndM[i,1]<-as.numeric(TM$End[i+1])
- EndM[i,2]<-"M"
- }
- for(i in 1:(nrow(TF)-1)){
- EndF[i,1]<-as.numeric(TF$End[i+1])
- EndF[i,2]<-"F"
- }
- for(i in 1:(nrow(TS)-1)){
- EndS[i,1]<-as.numeric(TS$End[i+1])
- EndS[i,2]<-"S"
- }
- for(i in 1:(nrow(TS)-1)){
- EndDLC[i,1]<-as.numeric(TDLC1$End[i+1])
- EndDLC[i,2]<-"DLC"
- }
- for(i in 1:(nrow(TM)-1)){
- SpeedM[i,1]<-as.numeric(TM$Speed[i+1])
- SpeedM[i,2]<-"M"
- }
- for(i in 1:(nrow(TF)-1)){
- SpeedF[i,1]<-as.numeric(TF$Speed[i+1])
- SpeedF[i,2]<-"F"
- }
- for(i in 1:(nrow(TS)-1)){
- SpeedS[i,1]<-as.numeric(TS$Speed[i+1])
- SpeedS[i,2]<-"S"
- }
- for(i in 1:(nrow(TDLC1)-1)){
- SpeedDLC[i,1]<-as.numeric(TDLC1$Speed[i+1])
- SpeedDLC[i,2]<-"DLC"
- }
- Start<-rbind(StartM, StartF, StartS, StartTDLC1)
- End<-rbind(EndM, EndF, EndS, EndDLC)
- Speed<-rbind(SpeedM, SpeedF, SpeedS, SpeedDLC)
- agostino<-data.frame()
- colnamesagostino<-c("Rater", "Start", "End", "Speed", "HLD")
- for(i in colnamesagostino){agostino[[i]]<-as.character()}
- for(i in 1:length(Rater)){agostino[i,1]=Rater[i]}
- agostino[1,2]=round(agostino.test(as.numeric(TM$Start[2:nrow(TM)]))$p.value, digits = 4)
- agostino[2,2]=round(agostino.test(as.numeric(TF$Start[2:nrow(TF)]))$p.value, digits = 4)
- agostino[3,2]=round(agostino.test(as.numeric(TS$Start[2:nrow(TS)]))$p.value, digits = 4)
- agostino[4,2]=round(agostino.test(as.numeric(TDLC1$Start[2:nrow(TDLC1)]))$p.value, digits = 4)
- agostino[1,3]=round(agostino.test(as.numeric(TM$End[2:nrow(TM)]))$p.value, digits = 4)
- agostino[2,3]=round(agostino.test(as.numeric(TF$End[2:nrow(TF)]))$p.value, digits = 4)
- agostino[3,3]=round(agostino.test(as.numeric(TS$End[2:nrow(TS)]))$p.value, digits = 4)
- agostino[4,3]=round(agostino.test(as.numeric(TDLC1$End[2:nrow(TDLC1)]))$p.value, digits = 4)
- agostino[1,4]=round(agostino.test(as.numeric(TM$Speed[2:nrow(TM)]))$p.value, digits = 4)
- agostino[2,4]=round(agostino.test(as.numeric(TF$Speed[2:nrow(TF)]))$p.value, digits = 4)
- agostino[3,4]=round(agostino.test(as.numeric(TS$Speed[2:nrow(TS)]))$p.value, digits = 4)
- agostino[4,4]=round(agostino.test(as.numeric(TDLC1$Speed[2:nrow(TDLC1)]))$p.value, digits = 4)
- agostino[1,5]=round(agostino.test(as.numeric(HLDM[,1]))$p.value, digits = 4)
- agostino[2,5]=round(agostino.test(as.numeric(HLDF[,1]))$p.value, digits = 4)
- agostino[3,5]=round(agostino.test(as.numeric(HLDS[,1]))$p.value, digits = 4)
- agostino[4,5]=round(agostino.test(as.numeric(HLDDLC[,1]))$p.value, digits = 4)
- png(paste0(PicFolder, "p-values Normality Test D'Agostino"), height = 28*nrow(agostino), width = 50*ncol(agostino))
- grid.table(agostino, rows=NULL)
- dev.off()
- VH<-data.frame()
- colnamesVH<-c("Start", "End", "Speed", "HLD")
- for(i in colnamesVH){VH[[i]]<-as.character()}
- VH[1,1]=round(leveneTest(Start[,1], as.factor(Start[,2]))$`Pr(>F)`[1], digits = 4)
- VH[1,2]=round(leveneTest(End[,1], as.factor(End[,2]))$`Pr(>F)`[1], digits = 4)
- VH[1,3]=round(bartlett.test(Speed[,1], Speed[,2])$p.value, digits = 4)
- VH[1,4]=round(leveneTest(HLD[,1], as.factor(HLD[,2]))$`Pr(>F)`[1], digits = 4)
- png(paste0(PicFolder, "p-values Variance Homogeneity"), height = 45*nrow(VH), width = 50*ncol(VH))
- grid.table(VH, rows=NULL)
- dev.off()
- cStartS1=cor.test(StartM$V1, StartF$V1, method="spearman")
- cStartS2=cor.test(StartM$V1, StartS$V1, method="spearman")
- cStartS3=cor.test(StartM$V1, StartTDLC1$V1, method="spearman")
- cStartS4=cor.test(StartF$V1, StartS$V1, method="spearman")
- cStartS5=cor.test(StartF$V1, StartTDLC1$V1, method="spearman")
- cStartS6=cor.test(StartS$V1, StartTDLC1$V1, method="spearman")
- cStartP1=cor.test(StartM$V1, StartF$V1, method="pearson")
- cStartP2=cor.test(StartM$V1, StartS$V1, method="pearson")
- cStartP3=cor.test(StartM$V1, StartTDLC1$V1, method="pearson")
- cStartP4=cor.test(StartF$V1, StartS$V1, method="pearson")
- cStartP5=cor.test(StartF$V1, StartTDLC1$V1, method="pearson")
- cStartP6=cor.test(StartS$V1, StartTDLC1$V1, method="pearson")
- cEndS1=cor.test(EndM$V1, EndF$V1, method="spearman")
- cEndS2=cor.test(EndM$V1, EndS$V1, method="spearman")
- cEndS3=cor.test(EndM$V1, EndDLC$V1, method="spearman")
- cEndS4=cor.test(EndF$V1, EndS$V1, method="spearman")
- cEndS5=cor.test(EndF$V1, EndDLC$V1, method="spearman")
- cEndS6=cor.test(EndS$V1, EndDLC$V1, method="spearman")
- cEndP1=cor.test(EndM$V1, EndF$V1, method="pearson")
- cEndP2=cor.test(EndM$V1, EndS$V1, method="pearson")
- cEndP3=cor.test(EndM$V1, EndDLC$V1, method="pearson")
- cEndP4=cor.test(EndF$V1, EndS$V1, method="pearson")
- cEndP5=cor.test(EndF$V1, EndDLC$V1, method="pearson")
- cEndP6=cor.test(EndS$V1, EndDLC$V1, method="pearson")
- cSpeed1=cor.test(SpeedM$V1, SpeedF$V1, method="pearson")
- cSpeed2=cor.test(SpeedM$V1, SpeedS$V1, method="pearson")
- cSpeed3=cor.test(SpeedM$V1, SpeedDLC$V1, method="pearson")
- cSpeed4=cor.test(SpeedF$V1, SpeedS$V1, method="pearson")
- cSpeed5=cor.test(SpeedF$V1, SpeedDLC$V1, method="pearson")
- cSpeed6=cor.test(SpeedS$V1, SpeedDLC$V1, method="pearson")
- cHLDS1=cor.test(HLDM[,1], HLDF[,1], method="spearman")
- cHLDS2=cor.test(HLDM[,1], HLDS[,1], method="spearman")
- cHLDS3=cor.test(HLDM[,1], HLDDLC[,1], method="spearman")
- cHLDS4=cor.test(HLDF[,1], HLDS[,1], method="spearman")
- cHLDS5=cor.test(HLDF[,1], HLDDLC[,1], method="spearman")
- cHLDS6=cor.test(HLDS[,1], HLDDLC[,1], method="spearman")
- cHLDP1=cor.test(HLDM[,1], HLDF[,1], method="pearson")
- cHLDP2=cor.test(HLDM[,1], HLDS[,1], method="pearson")
- cHLDP3=cor.test(HLDM[,1], HLDDLC[,1], method="pearson")
- cHLDP4=cor.test(HLDF[,1], HLDS[,1], method="pearson")
- cHLDP5=cor.test(HLDF[,1], HLDDLC[,1], method="pearson")
- cHLDP6=cor.test(HLDS[,1], HLDDLC[,1], method="pearson")
- for(i in 1:(nrow(TM)-1)){
- ICCStart[i,1]<-as.numeric(TM$Start[i+1])
- ICCStart[i,2]<-as.numeric(TF$Start[i+1])
- ICCStart[i,3]<-as.numeric(TS$Start[i+1])
- ICCStart[i,4]<-as.numeric(TDLC1$Start[i+1])
- }
- for(i in 1:(nrow(TM)-1)){
- ICCEnd[i,1]<-as.numeric(TM$End[i+1])
- ICCEnd[i,2]<-as.numeric(TF$End[i+1])
- ICCEnd[i,3]<-as.numeric(TS$End[i+1])
- ICCEnd[i,4]<-as.numeric(TDLC1$End[i+1])
- }
- for(i in 1:(nrow(TM)-1)){
- ICCSpeed[i,1]<-as.numeric(TM$Speed[i+1])
- ICCSpeed[i,2]<-as.numeric(TF$Speed[i+1])
- ICCSpeed[i,3]<-as.numeric(TS$Speed[i+1])
- ICCSpeed[i,4]<-as.numeric(TDLC1$Speed[i+1])
- }
- for(i in 1:(nrow(HLDM))){
- ICCHLD[i,1]<-as.numeric(HLDM[i,1])
- ICCHLD[i,2]<-as.numeric(HLDF[i,1])
- ICCHLD[i,3]<-as.numeric(HLDS[i,1])
- ICCHLD[i,4]<-as.numeric(HLDDLC[i,1])
- }
- ICC<-data.frame()
- colnamesICC<-c("Start", "End", "Speed", "HLD")
- for(i in colnamesICC){ICC[[i]]<-as.character()}
- ICC[1,1]=round(icc(ICCStart, model="twoway", type="agreement", unit="single")$value, digits = 4)
- ICC[2,1]=round(icc(ICCStart, model="twoway", type="agreement", unit="single")$p.value, digits = 6)
- ICC[1,2]=round(icc(ICCEnd, model="twoway", type="agreement", unit="single")$value, digits = 4)
- ICC[2,2]=round(icc(ICCEnd, model="twoway", type="agreement", unit="single")$p.value, digits = 6)
- ICC[1,3]=round(icc(ICCSpeed, model="twoway", type="agreement", unit="single")$value, digits = 4)
- ICC[2,3]=round(icc(ICCSpeed, model="twoway", type="agreement", unit="single")$p.value, digits = 6)
- ICC[1,4]=round(icc(ICCHLD, model="twoway", type="agreement", unit="single")$value, digits = 4)
- ICC[2,4]=round(icc(ICCHLD, model="twoway", type="agreement", unit="single")$p.value, digits = 6)
- png(paste0(PicFolder, "Correlation values ICC"), height = 45*nrow(ICC), width = 50*ncol(ICC))
- grid.table(ICC, rows=NULL)
- dev.off()
- Rater<-c("Rater_1", "Rater_2", "Rater_3", "DLC")
- Rater2<-c("Rater_1", "Rater_2", "Rater_3", "DLC")
- RvsRStart<-expand.grid(X=Rater, Y=Rater2)
- RvsRStart$value<-c(1, cStartS1$estimate, cStartS2$estimate, cStartS3$estimate, cStartS1$estimate, 1, cStartS4$estimate, cStartS4$estimate, cStartS2$estimate, cStartS4$estimate, 1, cStartS6$estimate, cStartS3$estimate, cStartS5$estimate, cStartS6$estimate, 1)
- ggplot(RvsRStart, aes(X, Y, fill= value)) +
- geom_tile(aes(fill = value))+
- geom_text(aes(label = round(value, 3)), colour=("gray100"), size=9)+
- scale_colour_manual(values=c("gray100"))+
- scale_fill_gradient(limits=c(0,1))+
- theme(panel.background = element_blank(), axis.title=element_blank(), legend.position="none", text = element_text(size=25))
- ggsave(paste0(PicFolder, "Spearman_Correlation_Start.png"))
- StartSp<-data.frame()
- Rater_1<-c(1, round(cStartS1$p.value, digits=5), round(cStartS2$p.value, digits=5), round(cStartS3$p.value, digits=5))
- Rater_2<-c(0,1, round(cStartS4$p.value, digits=5), round(cStartS5$p.value, digits=5))
- Rater_3<-c(0,0,1, round(cStartS5$p.value, digits=5))
- DLC<-c(0,0,0,1)
- StartSp<-rbind(StartSp, Rater_1, Rater_2, Rater_3, DLC)
- StartSp=`row.names<-`(StartSp, Rater)
- colnames(StartSp)<-c("Rater_1", "Rater_2", "Rater_3", "DLC")
- png(paste0(PicFolder, "Start_Spearman_p-values.png"), height = 30*nrow(StartSp), width = 70*ncol(StartSp))
- grid.table(StartSp, rows=NULL)
- dev.off()
- RvsRStart<-expand.grid(X=Rater, Y=Rater2)
- RvsRStart$value<-c(1, cStartP1$estimate, cStartP2$estimate, cStartP3$estimate, cStartP1$estimate, 1, cStartP4$estimate, cStartP5$estimate, cStartP2$estimate, cStartP4$estimate, 1, cStartP6$estimate, cStartP3$estimate, cStartP5$estimate, cStartP6$estimate, 1)
- ggplot(RvsRStart, aes(X, Y, fill= value)) +
- geom_tile(aes(fill = value))+
- geom_text(aes(label = round(value, 3)), colour=("gray100"), size=9)+
- scale_colour_manual(values=c("gray100"))+
- scale_fill_gradient(limits=c(0,1))+
- theme(panel.background = element_blank(), axis.title=element_blank(), legend.position="none", text = element_text(size=25))
- ggsave(paste0(PicFolder, "Pearson_Correlation_Start.png"))
- StartPp<-data.frame()
- Rater_1<-c(1, round(cStartP1$p.value, digits=5), round(cStartP2$p.value, digits=5), round(cStartP3$p.value, digits=5))
- Rater_2<-c(0,1, round(cStartP4$p.value, digits=5), round(cStartP5$p.value, digits=5))
- Rater_3<-c(0,0,1, round(cStartP5$p.value, digits=5))
- DLC<-c(0,0,0,1)
- StartPp<-rbind(StartPp, Rater_1, Rater_2, Rater_3, DLC)
- StartPp=`row.names<-`(StartPp, Rater)
- colnames(StartPp)<-c("Rater_1", "Rater_2", "Rater_3", "DLC")
- png(paste0(PicFolder, "Start_Pearson_p-values.png"), height = 30*nrow(StartPp), width = 70*ncol(StartPp))
- grid.table(StartPp, rows=NULL)
- dev.off()
- RvsREnd<-expand.grid(X=Rater, Y=Rater2)
- RvsREnd$value<-c(1, cEndS1$estimate, cEndS2$estimate, cEndS3$estimate, cEndS1$estimate, 1, cEndS4$estimate, cEndS5$estimate, cEndS2$estimate, cEndS4$estimate, 1, cEndS6$estimate, cEndS3$estimate, cEndS5$estimate, cEndS6$estimate, 1)
- ggplot(RvsREnd, aes(X, Y, fill= value))+
- geom_tile(aes(fill = value))+
- geom_text(aes(label = round(value, 3)), colour=("gray100"), size=9)+
- scale_colour_manual(values=c("gray100"))+
- scale_fill_gradient(limits=c(0,1))+
- theme(panel.background = element_blank(), axis.title=element_blank(), legend.position="none", text = element_text(size=25))
- ggsave(paste0(PicFolder, "Spearman_Correlation_End.png"))
- EndSp<-data.frame()
- Rater_1<-c(1, round(cEndS1$p.value, digits=5), round(cEndS2$p.value, digits=5), round(cEndS3$p.value, digits=5))
- Rater_2<-c(0,1, round(cEndS4$p.value, digits=5), round(cEndS5$p.value, digits=5))
- Rater_3<-c(0,0,1, round(cEndS5$p.value, digits=5))
- DLC<-c(0,0,0,1)
- EndSp<-rbind(EndSp, Rater_1, Rater_2, Rater_3, DLC)
- EndSp=`row.names<-`(EndSp, Rater)
- colnames(EndSp)<-c("Rater_1", "Rater_2", "Rater_3", "DLC")
- png(paste0(PicFolder, "End_Spearman_p-values.png"), height = 30*nrow(EndSp), width = 70*ncol(EndSp))
- grid.table(EndSp, rows=NULL)
- dev.off()
- RvsREnd<-expand.grid(X=Rater, Y=Rater2)
- RvsREnd$value<-c(1, cEndP1$estimate, cEndP2$estimate, cEndP3$estimate, cEndP1$estimate, 1, cEndP4$estimate, cEndP5$estimate, cEndP2$estimate, cEndP4$estimate, 1, cEndP6$estimate, cEndP3$estimate, cEndP5$estimate, cEndP6$estimate, 1)
- ggplot(RvsREnd, aes(X, Y, fill= value))+
- geom_tile(aes(fill = value))+
- geom_text(aes(label = round(value, 3)), colour=("gray100"), size=9)+
- scale_colour_manual(values=c("gray100"))+
- scale_fill_gradient(limits=c(0,1))+
- theme(panel.background = element_blank(), axis.title=element_blank(), legend.position="none", text = element_text(size=25))
- ggsave(paste0(PicFolder, "Pearson_Correlation_End.png"))
- EndPp<-data.frame()
- Rater_1<-c(1, round(cEndP1$p.value, digits=5), round(cEndP2$p.value, digits=5), round(cEndP3$p.value, digits=5))
- Rater_2<-c(0,1, round(cEndP4$p.value, digits=5), round(cEndP5$p.value, digits=5))
- Rater_3<-c(0,0,1, round(cEndP5$p.value, digits=5))
- DLC<-c(0,0,0,1)
- EndPp<-rbind(EndPp, Rater_1, Rater_2, Rater_3, DLC)
- EndPp=`row.names<-`(EndPp, Rater)
- colnames(EndPp)<-c("Rater_1", "Rater_2", "Rater_3", "DLC")
- png(paste0(PicFolder, "End_Pearson_p-values.png"), height = 30*nrow(EndPp), width = 70*ncol(EndPp))
- grid.table(EndPp, rows=NULL)
- dev.off()
- RvsRSpeed<-expand.grid(X=Rater, Y=Rater2)
- RvsRSpeed$value<-c(1, cSpeed1$estimate, cSpeed2$estimate, cSpeed3$estimate, cSpeed1$estimate, 1, cSpeed4$estimate, cSpeed5$estimate, cSpeed2$estimate, cSpeed4$estimate, 1, cSpeed6$estimate, cSpeed3$estimate, cSpeed5$estimate, cSpeed6$estimate, 1)
- ggplot(RvsRSpeed, aes(X, Y, fill= value))+
- geom_tile(aes(fill = value))+
- geom_text(aes(label = round(value, 3)), colour=("gray100"), size=9)+
- scale_colour_manual(values=c("gray100"))+
- scale_fill_gradient(limits=c(0,1))+
- theme(panel.background = element_blank(), axis.title=element_blank(), legend.position="none", text = element_text(size=25))
- ggsave(paste0(PicFolder, "Pearson_Correlation_Speed.png"))
- Speedp<-data.frame()
- Rater_1<-c(1, round(cSpeed1$p.value, digits=5), round(cSpeed2$p.value, digits=5), round(cSpeed3$p.value, digits=5))
- Rater_2<-c(0,1, round(cSpeed4$p.value, digits=5), round(cSpeed5$p.value, digits=5))
- Rater_3<-c(0,0,1, round(cSpeed5$p.value, digits=5))
- DLC<-c(0,0,0,1)
- Speedp<-rbind(Speedp, Rater_1, Rater_2, Rater_3, DLC)
- Speedp=`row.names<-`(Speedp, Rater)
- colnames(Speedp)<-c("Rater_1", "Rater_2", "Rater_3", "DLC")
- png(paste0(PicFolder, "Speed_Pearson_p-values.png"), height = 30*nrow(Speedp), width = 70*ncol(Speedp))
- grid.table(Speedp, rows=NULL)
- dev.off()
- HLD<-data.frame()
- HLDM<-data.frame()
- HLDF<-data.frame()
- HLDS<-data.frame()
- HLDDLC<-data.frame()
- for(i in 1:(nrow(TM)-1)){
- for(j in seq(8, max(cols), 2)){
- hld<-list(as.numeric(TM[i+1,j]), "M")
- HLDM=rbind(HLDM, hld)
- }
- }
- for(i in 1:(nrow(TF)-1)){
- for(j in seq(8, max(cols), 2)){
- hld<-list(as.numeric(TF[i+1,j]), "F")
- HLDF=rbind(HLDF, hld)
- }
- }
- for(i in 1:(nrow(TS)-1)){
- for(j in seq(8, max(cols), 2)){
- hld<-list(as.numeric(TS[i+1,j]), "S")
- HLDS=rbind(HLDS, hld)
- }
- }
- for(i in 2:(nrow(TDLC1))){
- for(j in 8:(8+((max(cols)-8)/2))){
- hld<-list(as.numeric(TDLC1[i,j]), "DLC")
- HLDDLC=rbind(HLDDLC, hld)
- }
- }
- colnames(HLDM)<-c(1,2)
- colnames(HLDF)<-c(1,2)
- colnames(HLDS)<-c(1,2)
- colnames(HLDDLC)<-c(1,2)
- HLD<-rbind(HLDM, HLDF, HLDS, HLDDLC)
- cHLDS1=cor.test(HLDM[,1], HLDF[,1], method="spearman")
- cHLDS2=cor.test(HLDM[,1], HLDS[,1], method="spearman")
- cHLDS3=cor.test(HLDM[,1], HLDDLC[,1], method="spearman")
- cHLDS4=cor.test(HLDF[,1], HLDS[,1], method="spearman")
- cHLDS5=cor.test(HLDF[,1], HLDDLC[,1], method="spearman")
- cHLDS6=cor.test(HLDS[,1], HLDDLC[,1], method="spearman")
- cHLDP1=cor.test(HLDM[,1], HLDF[,1], method="pearson")
- cHLDP2=cor.test(HLDM[,1], HLDS[,1], method="pearson")
- cHLDP3=cor.test(HLDM[,1], HLDDLC[,1], method="pearson")
- cHLDP4=cor.test(HLDF[,1], HLDS[,1], method="pearson")
- cHLDP5=cor.test(HLDF[,1], HLDDLC[,1], method="pearson")
- cHLDP6=cor.test(HLDS[,1], HLDDLC[,1], method="pearson")
- RvsRHLD<-expand.grid(X=Rater, Y=Rater2)
- RvsRHLD$value<-c(1, cHLDS1$estimate, cHLDS2$estimate, cHLDS3$estimate, cHLDS1$estimate, 1, cHLDS4$estimate, cHLDS5$estimate, cHLDS2$estimate, cHLDS4$estimate, 1, cHLDS6$estimate, cHLDS3$estimate, cHLDS5$estimate, cHLDS6$estimate, 1)
- ggplot(RvsRHLD, aes(X, Y, fill= value))+
- geom_tile(aes(fill = value))+
- geom_text(aes(label = round(value, 3)), colour=("gray100"), size=9)+
- scale_colour_manual(values=c("gray100"))+
- scale_fill_gradient(limits=c(0,1))+
- theme(panel.background = element_blank(), axis.title=element_blank(), legend.position="none", text = element_text(size=25))
- ggsave(paste0(PicFolder, "Spearman_Correlation_HLD1.png"))
- HLDSp<-data.frame()
- Rater_1<-c(1, round(cHLDS1$p.value, digits=5), round(cHLDS2$p.value, digits=5), round(cHLDS3$p.value, digits=5))
- Rater_2<-c(0,1, round(cHLDS4$p.value, digits=5), round(cHLDS5$p.value, digits=5))
- Rater_3<-c(0,0,1, round(cHLDS5$p.value, digits=5))
- DLC<-c(0,0,0,1)
- HLDSp<-rbind(HLDSp, Rater_1, Rater_2, Rater_3, DLC)
- HLDSp=`row.names<-`(HLDSp, Rater)
- colnames(HLDSp)<-c("Rater_1", "Rater_2", "Rater_3", "DLC")
- png(paste0(PicFolder, "HLD_Spearman_p-values_1.png"), height = 30*nrow(HLDSp), width = 70*ncol(HLDSp))
- grid.table(HLDSp, rows=NULL)
- dev.off()
- RvsRHLD<-expand.grid(X=Rater, Y=Rater2)
- RvsRHLD$value<-c(1, cHLDP1$estimate, cHLDP2$estimate, cHLDP3$estimate, cHLDP1$estimate, 1, cHLDP4$estimate, cHLDP5$estimate, cHLDP2$estimate, cHLDP4$estimate, 1, cHLDP6$estimate, cHLDP3$estimate, cHLDP5$estimate, cHLDP6$estimate, 1)
- ggplot(RvsRHLD, aes(X, Y, fill= value))+
- geom_tile(aes(fill = value))+
- geom_text(aes(label = round(value, 3)), colour=("gray100"), size=9)+
- scale_colour_manual(values=c("gray100"))+
- scale_fill_gradient(limits=c(0,1))+
- theme(panel.background = element_blank(), axis.title=element_blank(), legend.position="none", text = element_text(size=25))
- ggsave(paste0(PicFolder, "Pearson_Correlation_HLD1.png"))
- HLDPp<-data.frame()
- Rater_1<-c(1, round(cHLDP1$p.value, digits=5), round(cHLDP2$p.value, digits=5), round(cHLDP3$p.value, digits=5))
- Rater_2<-c(0,1, round(cHLDP4$p.value, digits=5), round(cHLDP5$p.value, digits=5))
- Rater_3<-c(0,0,1, round(cHLDP5$p.value, digits=5))
- DLC<-c(0,0,0,1)
- HLDPp<-rbind(HLDPp, Rater_1, Rater_2, Rater_3, DLC)
- HLDPp=`row.names<-`(HLDPp, Rater)
- colnames(HLDPp)<-c("Rater_1", "Rater_2", "Rater_3", "DLC")
- png(paste0(PicFolder, "HLD_Pearson_p-values_1.png"), height = 30*nrow(HLDPp), width = 70*ncol(HLDPp))
- grid.table(HLDPp, rows=NULL)
- dev.off()
- HLD<-data.frame()
- HLDM<-data.frame()
- HLDF<-data.frame()
- HLDS<-data.frame()
- HLDDLC<-data.frame()
- for(i in 1:(nrow(TM)-1)){
- for(j in seq(8, max(cols), 2)){
- hld<-list(as.numeric(TM[i+1,j]), "M")
- HLDM=rbind(HLDM, hld)
- }
- }
- for(i in 1:(nrow(TF)-1)){
- for(j in seq(8, max(cols), 2)){
- hld<-list(as.numeric(TF[i+1,j]), "F")
- HLDF=rbind(HLDF, hld)
- }
- }
- for(i in 1:(nrow(TS)-1)){
- for(j in seq(8, max(cols), 2)){
- hld<-list(as.numeric(TS[i+1,j]), "S")
- HLDS=rbind(HLDS, hld)
- }
- }
- for(i in 2:(nrow(TDLC1))){
- for(j in 8:(8+((max(cols)-8)/2))){
- hld<-list(as.numeric(TDLC1[i,j]), "DLC")
- HLDDLC=rbind(HLDDLC, hld)
- }
- }
- colnames(HLDM)<-c(1,2)
- colnames(HLDF)<-c(1,2)
- colnames(HLDS)<-c(1,2)
- colnames(HLDDLC)<-c(1,2)
- HLDRater<-list(HLDM, HLDF, HLDS, HLDDLC)
- lengthmean<-c()
- for(e in 1:length(DLCnames)){
- lengthmean[e]=nrow(DLCnames[[e]])
- }
- for(g in 1:length(HLDRater)){
- for(h in 1:nrow(HLDRater[[g]])){
- for(f in 1:length(HLDRater)){
- if(is.na(HLDRater[[g]][h,1])==F && is.na(HLDRater[[f]][h,1])==T){
- HLDRater[[f]][h,1]<-0
- }
- }
- }
- }
- HLDM<-HLDRater[[1]]
- HLDF<-HLDRater[[2]]
- HLDS<-HLDRater[[3]]
- HLDDLC<-HLDRater[[4]]
- HLD<-rbind(HLDM, HLDF, HLDS, HLDDLC)
- cHLDS1=cor.test(HLDM[,1], HLDF[,1], method="spearman")
- cHLDS2=cor.test(HLDM[,1], HLDS[,1], method="spearman")
- cHLDS3=cor.test(HLDM[,1], HLDDLC[,1], method="spearman")
- cHLDS4=cor.test(HLDF[,1], HLDS[,1], method="spearman")
- cHLDS5=cor.test(HLDF[,1], HLDDLC[,1], method="spearman")
- cHLDS6=cor.test(HLDS[,1], HLDDLC[,1], method="spearman")
- cHLDP1=cor.test(HLDM[,1], HLDF[,1], method="pearson")
- cHLDP2=cor.test(HLDM[,1], HLDS[,1], method="pearson")
- cHLDP3=cor.test(HLDM[,1], HLDDLC[,1], method="pearson")
- cHLDP4=cor.test(HLDF[,1], HLDS[,1], method="pearson")
- cHLDP5=cor.test(HLDF[,1], HLDDLC[,1], method="pearson")
- cHLDP6=cor.test(HLDS[,1], HLDDLC[,1], method="pearson")
- RvsRHLD<-expand.grid(X=Rater, Y=Rater2)
- RvsRHLD$value<-c(1, cHLDS1$estimate, cHLDS2$estimate, cHLDS3$estimate, cHLDS1$estimate, 1, cHLDS4$estimate, cHLDS5$estimate, cHLDS2$estimate, cHLDS4$estimate, 1, cHLDS6$estimate, cHLDS3$estimate, cHLDS5$estimate, cHLDS6$estimate, 1)
- ggplot(RvsRHLD, aes(X, Y, fill= value))+
- geom_tile(aes(fill = value))+
- geom_text(aes(label = round(value, 3)), colour=("gray100"), size=9)+
- scale_colour_manual(values=c("gray100"))+
- scale_fill_gradient(limits=c(0,1))+
- theme(panel.background = element_blank(), axis.title=element_blank(), legend.position="none", text = element_text(size=25))
- ggsave(paste0(PicFolder, "Spearman_Correlation_HLD2.png"))
- HLDSp<-data.frame()
- Rater_1<-c(1, round(cHLDS1$p.value, digits=5), round(cHLDS2$p.value, digits=5), round(cHLDS3$p.value, digits=5))
- Rater_2<-c(0,1, round(cHLDS4$p.value, digits=5), round(cHLDS5$p.value, digits=5))
- Rater_3<-c(0,0,1, round(cHLDS5$p.value, digits=5))
- DLC<-c(0,0,0,1)
- HLDSp<-rbind(HLDSp, Rater_1, Rater_2, Rater_3, DLC)
- HLDSp=`row.names<-`(HLDSp, Rater)
- colnames(HLDSp)<-c("Rater_1", "Rater_2", "Rater_3", "DLC")
- png(paste0(PicFolder, "HLD_Spearman_p-values_2.png"), height = 30*nrow(HLDSp), width = 70*ncol(HLDSp))
- grid.table(HLDSp, rows=NULL)
- dev.off()
- RvsRHLD<-expand.grid(X=Rater, Y=Rater2)
- RvsRHLD$value<-c(1, cHLDP1$estimate, cHLDP2$estimate, cHLDP3$estimate, cHLDP1$estimate, 1, cHLDP4$estimate, cHLDP5$estimate, cHLDP2$estimate, cHLDP4$estimate, 1, cHLDP6$estimate, cHLDP3$estimate, cHLDP5$estimate, cHLDP6$estimate, 1)
- ggplot(RvsRHLD, aes(X, Y, fill= value))+
- geom_tile(aes(fill = value))+
- geom_text(aes(label = round(value, 3)), colour=("gray100"), size=9)+
- scale_colour_manual(values=c("gray100"))+
- scale_fill_gradient(limits=c(0,1))+
- theme(panel.background = element_blank(), axis.title=element_blank(), legend.position="none", text = element_text(size=25))
- ggsave(paste0(PicFolder, "Pearson_Correlation_HLD2.png"))
- HLDPp<-data.frame()
- Rater_1<-c(1, round(cHLDP1$p.value, digits=5), round(cHLDP2$p.value, digits=5), round(cHLDP3$p.value, digits=5))
- Rater_2<-c(0,1, round(cHLDP4$p.value, digits=5), round(cHLDP5$p.value, digits=5))
- Rater_3<-c(0,0,1, round(cHLDP5$p.value, digits=5))
- DLC<-c(0,0,0,1)
- HLDPp<-rbind(HLDPp, Rater_1, Rater_2, Rater_3, DLC)
- HLDPp=`row.names<-`(HLDPp, Rater)
- colnames(HLDPp)<-c("Rater_1", "Rater_2", "Rater_3", "DLC")
- png(paste0(PicFolder, "HLD_Pearson_p-values_2.png"), height = 30*nrow(HLDPp), width = 70*ncol(HLDPp))
- grid.table(HLDPp, rows=NULL)
- dev.off()
- HLD<-data.frame()
- HLDM<-data.frame()
- HLDF<-data.frame()
- HLDS<-data.frame()
- HLDDLC<-data.frame()
- for(i in 1:(nrow(TM)-1)){
- for(j in seq(8, max(cols), 2)){
- hld<-list(as.numeric(TM[i+1,j]), "M")
- HLDM=rbind(HLDM, hld)
- }
- }
- for(i in 1:(nrow(TF)-1)){
- for(j in seq(8, max(cols), 2)){
- hld<-list(as.numeric(TF[i+1,j]), "F")
- HLDF=rbind(HLDF, hld)
- }
- }
- for(i in 1:(nrow(TS)-1)){
- for(j in seq(8, max(cols), 2)){
- hld<-list(as.numeric(TS[i+1,j]), "S")
- HLDS=rbind(HLDS, hld)
- }
- }
- for(i in 2:(nrow(TDLC1))){
- for(j in 8:(8+((max(cols)-8)/2))){
- hld<-list(as.numeric(TDLC1[i,j]), "DLC")
- HLDDLC=rbind(HLDDLC, hld)
- }
- }
- colnames(HLDM)<-c(1,2)
- colnames(HLDF)<-c(1,2)
- colnames(HLDS)<-c(1,2)
- colnames(HLDDLC)<-c(1,2)
- HLDRater<-list(HLDM, HLDF, HLDS, HLDDLC)
- lengthmean<-c()
- for(e in 1:length(DLCnames)){
- lengthmean[e]=nrow(DLCnames[[e]])
- }
- for(g in 1:length(HLDRater)){
- for(h in 1:nrow(HLDRater[[g]])){
- for(f in 1:length(HLDRater)){
- if(is.na(HLDRater[[g]][h,1])==F && is.na(HLDRater[[f]][h,1])==T){
- HLDRater[[f]][h,1]<-mean(lengthmean)
- }
- }
- }
- }
- HLDM<-HLDRater[[1]]
- HLDF<-HLDRater[[2]]
- HLDS<-HLDRater[[3]]
- HLDDLC<-HLDRater[[4]]
- HLD<-rbind(HLDM, HLDF, HLDS, HLDDLC)
- cHLDS1=cor.test(HLDM[,1], HLDF[,1], method="spearman")
- cHLDS2=cor.test(HLDM[,1], HLDS[,1], method="spearman")
- cHLDS3=cor.test(HLDM[,1], HLDDLC[,1], method="spearman")
- cHLDS4=cor.test(HLDF[,1], HLDS[,1], method="spearman")
- cHLDS5=cor.test(HLDF[,1], HLDDLC[,1], method="spearman")
- cHLDS6=cor.test(HLDS[,1], HLDDLC[,1], method="spearman")
- cHLDP1=cor.test(HLDM[,1], HLDF[,1], method="pearson")
- cHLDP2=cor.test(HLDM[,1], HLDS[,1], method="pearson")
- cHLDP3=cor.test(HLDM[,1], HLDDLC[,1], method="pearson")
- cHLDP4=cor.test(HLDF[,1], HLDS[,1], method="pearson")
- cHLDP5=cor.test(HLDF[,1], HLDDLC[,1], method="pearson")
- cHLDP6=cor.test(HLDS[,1], HLDDLC[,1], method="pearson")
- RvsRHLD<-expand.grid(X=Rater, Y=Rater2)
- RvsRHLD$value<-c(1, cHLDS1$estimate, cHLDS2$estimate, cHLDS3$estimate, cHLDS1$estimate, 1, cHLDS4$estimate, cHLDS5$estimate, cHLDS2$estimate, cHLDS4$estimate, 1, cHLDS6$estimate, cHLDS3$estimate, cHLDS5$estimate, cHLDS6$estimate, 1)
- ggplot(RvsRHLD, aes(X, Y, fill= value))+
- geom_tile(aes(fill = value))+
- geom_text(aes(label = round(value, 3)), colour=("gray100"), size=9)+
- scale_colour_manual(values=c("gray100"))+
- scale_fill_gradient(limits=c(0,1))+
- theme(panel.background = element_blank(), axis.title=element_blank(), legend.position="none", text = element_text(size=25))
- ggsave(paste0(PicFolder, "Spearman_Correlation_HLD3.png"))
- HLDSp<-data.frame()
- Rater_1<-c(1, round(cHLDS1$p.value, digits=5), round(cHLDS2$p.value, digits=5), round(cHLDS3$p.value, digits=5))
- Rater_2<-c(0,1, round(cHLDS4$p.value, digits=5), round(cHLDS5$p.value, digits=5))
- Rater_3<-c(0,0,1, round(cHLDS5$p.value, digits=5))
- DLC<-c(0,0,0,1)
- HLDSp<-rbind(HLDSp, Rater_1, Rater_2, Rater_3, DLC)
- HLDSp=`row.names<-`(HLDSp, Rater)
- colnames(HLDSp)<-c("Rater_1", "Rater_2", "Rater_3", "DLC")
- png(paste0(PicFolder, "HLD_Spearman_p-values_3.png"), height = 30*nrow(HLDSp), width = 70*ncol(HLDSp))
- grid.table(HLDSp, rows=NULL)
- dev.off()
- RvsRHLD<-expand.grid(X=Rater, Y=Rater2)
- RvsRHLD$value<-c(1, cHLDP1$estimate, cHLDP2$estimate, cHLDP3$estimate, cHLDP1$estimate, 1, cHLDP4$estimate, cHLDP5$estimate, cHLDP2$estimate, cHLDP4$estimate, 1, cHLDP6$estimate, cHLDP3$estimate, cHLDP5$estimate, cHLDP6$estimate, 1)
- ggplot(RvsRHLD, aes(X, Y, fill= value))+
- geom_tile(aes(fill = value))+
- geom_text(aes(label = round(value, 3)), colour=("gray100"), size=9)+
- scale_colour_manual(values=c("gray100"))+
- scale_fill_gradient(limits=c(0,1))+
- theme(panel.background = element_blank(), axis.title=element_blank(), legend.position="none", text = element_text(size=25))
- ggsave(paste0(PicFolder, "Pearson_Correlation_HLD3.png"))
- HLDPp<-data.frame()
- Rater_1<-c(1, round(cHLDP1$p.value, digits=5), round(cHLDP2$p.value, digits=5), round(cHLDP3$p.value, digits=5))
- Rater_2<-c(0,1, round(cHLDP4$p.value, digits=5), round(cHLDP5$p.value, digits=5))
- Rater_3<-c(0,0,1, round(cHLDP5$p.value, digits=5))
- DLC<-c(0,0,0,1)
- HLDPp<-rbind(HLDPp, Rater_1, Rater_2, Rater_3, DLC)
- HLDPp=`row.names<-`(HLDPp, Rater)
- colnames(HLDPp)<-c("Rater_1", "Rater_2", "Rater_3", "DLC")
- png(paste0(PicFolder, "HLD_Pearson_p-values_3.png"), height = 30*nrow(HLDPp), width = 70*ncol(HLDPp))
- grid.table(HLDPp, rows=NULL)
- dev.off()
|