#This scripts are based on the supplemental material of the paper: # Peña-Araya, V., Pietriga, E., & Bezerianos, A. (2019). A Comparison of Visualizations for Identifying Correlation over Space and Time. IEEE transactions on visualization and computer graphics. library(plyr) library(ggplot2) source("CI-Functions-Bonferroni.R") allwm <- read.csv("comparison.csv") data <- subset(allwm, isTraining==0) data$feature <- revalue(data$feature, c("Center"="Center", "Source"="Repelling Node", "Sink"="Attracting Node", "SourceVortex"="Repelling Focus", "SinkVortex"="Attracting Focus", "Saddle"="Saddle")) features <- c("Center", "Repelling Node", "Attracting Node", "Repelling Focus", "Attracting Focus", "Saddle") aggregated_error <- ddply(data, c("participant","technique", "feature"), summarise, mean_error = mean(errorCount) ) # order for the transpose elements <- aggregated_error elements <- elements [ order(elements$participant, elements$technique), ] statstable_error <- ddply(elements, c("participant","technique"), summarise, error=mean(mean_error) ) elements <- statstable_error # elements <- reshape(elements, timevar="technique", idvar=c("participant"), direction="wide") colnames(elements) <- gsub("error.", "", colnames(elements)) # drop columns with N/A elements <- na.omit(elements) data <- elements techniqueA <- bootstrapMeanCI(data$FROLIC) techniqueB <- bootstrapMeanCI(data$IBFV) techniqueC <- bootstrapMeanCI(data$PARTICLES) techniqueD <- bootstrapMeanCI(data$MIX) analysisData <- c() analysisData$name <- c("MIX","PARTICLES","IBFV","OLIC") analysisData$pointEstimate <- c(techniqueD[1], techniqueC[1], techniqueB[1], techniqueA[1]) analysisData$ci.max <- c(techniqueD[3],techniqueC[3], techniqueB[3], techniqueA[3]) analysisData$ci.min <- c(techniqueD[2],techniqueC[2], techniqueB[2], techniqueA[2]) datatoprint <- data.frame(factor(analysisData$name),analysisData$pointEstimate, analysisData$ci.min, analysisData$ci.max) colnames(datatoprint) <- c("Technique", "mean_time", "lowerBound_CI", "upperBound_CI ") #We use the name mean_time for the value of the mean even though it's not a time, it's just to parse the data for the plot path = paste0("plots/") filename = paste0("time_means_task_all") write.table(datatoprint, paste0(path,"printed_",filename,".txt",seq=""), sep=",",row.names=FALSE) barChart(datatoprint, analysisData$name, nbTechs = 4, ymin = 0, ymax = 1, mycolor = "darkorange1", "", "") ####### ###### #A OLIC #B IBFV #C PS #D MIX diffBA = bootstrapMeanCI_corr(data$IBFV - data$FROLIC, 4) diffBC = bootstrapMeanCI_corr(data$IBFV - data$PARTICLES, 4) diffAC = bootstrapMeanCI_corr(data$FROLIC - data$PARTICLES, 4) diffDA = bootstrapMeanCI_corr(data$MIX - data$FROLIC, 4) diffDB = bootstrapMeanCI_corr(data$MIX - data$IBFV, 4) diffDC = bootstrapMeanCI_corr(data$MIX - data$PARTICLES, 4) analysisData <- c() analysisData$name <- c("IBFV-OLIC","IBFV-PS","OLIC-PS", "MIX-OLIC", "MIX-IBFV", "MIX-PS") # Symbol name has been changed in paper to Glyph analysisData$pointEstimate <- c(diffBA[1], diffBC[1], diffAC[1], diffDA[1], diffDB[1], diffDC[1]) analysisData$ci.max <- c(diffBA[6], diffBC[6], diffAC[6], diffDA[6], diffDB[6], diffDC[6]) analysisData$ci.min <- c(diffBA[5], diffBC[5], diffAC[5], diffDA[5], diffDB[5], diffDC[5]) analysisData$level <- c(diffBA[4], diffBC[4], diffAC[4], diffDA[4], diffDB[4], diffDC[4]) analysisData$ci_corr.max <- c(diffBA[6], diffBC[6], diffAC[6], diffDA[6], diffDB[6], diffDC[6]) analysisData$ci_corr.min <- c(diffBA[5], diffBC[5], diffAC[5], diffDA[5], diffDB[5], diffDC[5]) datatoprint <- data.frame(factor(analysisData$name), analysisData$pointEstimate, analysisData$ci.max, analysisData$ci.min, analysisData$level, analysisData$ci_corr.max, analysisData$ci_corr.min) colnames(datatoprint) <- c("technique", "mean_time", "lowerBound_CI", "upperBound_CI", "corrected_CI", "lowerBound_CI_corr", "upperBound_CI_corr") #We use the name mean_time for the value of the mean even though it's not a time, it's just to parse the data for the plot filenamediff = paste(featureName, "timediff", sep="_") barChart(datatoprint, analysisData$name, nbTechs = 6, ymin = -1, ymax = 1, mycolor = "darkorange1", "", "") plotFeatureError<- function(featureName) { elements <- aggregated_error elements <- subset(elements, feature==featureName) elements <- elements [ order(elements$participant, elements$technique), ] statstable_error <- ddply(elements, c("participant","technique"), summarise, error=mean(mean_error) ) elements <- statstable_error # elements <- reshape(elements, timevar="technique", idvar=c("participant"), direction="wide") colnames(elements) <- gsub("error.", "", colnames(elements)) # drop columns with N/A elements <- na.omit(elements) data <- elements techniqueA <- bootstrapMeanCI(data$FROLIC) techniqueB <- bootstrapMeanCI(data$IBFV) techniqueC <- bootstrapMeanCI(data$PARTICLES) techniqueD <- bootstrapMeanCI(data$MIX) analysisData <- c() analysisData$name <- c("MIX","PARTICLES","IBFV","OLIC") analysisData$pointEstimate <- c(techniqueD[1], techniqueC[1], techniqueB[1], techniqueA[1]) analysisData$ci.max <- c(techniqueD[3],techniqueC[3], techniqueB[3], techniqueA[3]) analysisData$ci.min <- c(techniqueD[2],techniqueC[2], techniqueB[2], techniqueA[2]) datatoprint <- data.frame(factor(analysisData$name),analysisData$pointEstimate, analysisData$ci.min, analysisData$ci.max) colnames(datatoprint) <- c("Technique", "mean_time", "lowerBound_CI", "upperBound_CI ") #We use the name mean_time for the value of the mean even though it's not a time, it's just to parse the data for the plot path = paste0("plots/") filename = paste(featureName, "time", sep="_") filename = paste(featureName, "errorp2", sep="_") barChart(datatoprint, analysisData$name, nbTechs = 4, ymin = 0, ymax = 3, mycolor = "darkorange1", "", "") ggsave(paste(filename, "pdf", sep="."), device = cairo_pdf, width=3.5, height=2.4) diffBA = bootstrapMeanCI_corr(data$IBFV - data$FROLIC, 24) diffBC = bootstrapMeanCI_corr(data$IBFV - data$PARTICLES, 24) diffAC = bootstrapMeanCI_corr(data$FROLIC - data$PARTICLES, 24) diffDA = bootstrapMeanCI_corr(data$MIX - data$FROLIC, 24) diffDB = bootstrapMeanCI_corr(data$MIX - data$IBFV, 24) diffDC = bootstrapMeanCI_corr(data$MIX - data$PARTICLES, 24) analysisData <- c() analysisData$name <- c("IBFV-OLIC","IBFV-PS","OLIC-PS", "MIX-OLIC", "MIX-IBFV", "MIX-PS") # Symbol name has been changed in paper to Glyph analysisData$pointEstimate <- c(diffBA[1], diffBC[1], diffAC[1], diffDA[1], diffDB[1], diffDC[1]) analysisData$ci.max <- c(diffBA[6], diffBC[6], diffAC[6], diffDA[6], diffDB[6], diffDC[6]) analysisData$ci.min <- c(diffBA[5], diffBC[5], diffAC[5], diffDA[5], diffDB[5], diffDC[5]) analysisData$level <- c(diffBA[4], diffBC[4], diffAC[4], diffDA[4], diffDB[4], diffDC[4]) analysisData$ci_corr.max <- c(diffBA[6], diffBC[6], diffAC[6], diffDA[6], diffDB[6], diffDC[6]) analysisData$ci_corr.min <- c(diffBA[5], diffBC[5], diffAC[5], diffDA[5], diffDB[5], diffDC[5]) datatoprint <- data.frame(factor(analysisData$name), analysisData$pointEstimate, analysisData$ci.max, analysisData$ci.min, analysisData$level, analysisData$ci_corr.max, analysisData$ci_corr.min) colnames(datatoprint) <- c("technique", "mean_time", "lowerBound_CI", "upperBound_CI", "corrected_CI", "lowerBound_CI_corr", "upperBound_CI_corr") #We use the name mean_time for the value of the mean even though it's not a time, it's just to parse the data for the plot filenamediff = paste(featureName, "errordiffp2", sep="_") barChart(datatoprint, analysisData$name, nbTechs = 6, ymin = -3, ymax = 3, mycolor = "darkorange1", "", "") ggsave(paste(filenamediff, "pdf", sep="."), width=3.5, height=2.4, device = cairo_pdf) } plotFeatureError("Attracting Node") plotFeatureError("Attracting Focus") plotFeatureError("Repelling Focus") plotFeatureError("Repelling Node") plotFeatureError("Saddle") plotFeatureError("Center")