#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") data_pilot <- read.csv("pilot.csv") data <- subset(data_pilot, isTraining==0) data$feature <- revalue(data$feature, c("Center"="Center", "Source"="Repelling Node", "Sink"="Attracting Node", "SourceVortex"="Repelling Focus", "SinkVortex"="Attracting Focus", "Saddle"="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)) elements <- na.omit(elements) data <- elements techniqueA <- bootstrapMeanCI(data$FROLIC) techniqueB <- bootstrapMeanCI(data$IBFV) techniqueC <- bootstrapMeanCI(data$PARTICLES) analysisData <- c() analysisData$name <- c("PS","IBFV","OLIC") analysisData$pointEstimate <- c(techniqueC[1], techniqueB[1], techniqueA[1]) analysisData$ci.max <- c(techniqueC[3], techniqueB[3], techniqueA[3]) analysisData$ci.min <- c(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 = 3, ymin = 0, ymax = 5, mycolor = "darkorange1", "", "") diffBA = bootstrapMeanCI_corr(data$IBFV - data$FROLIC, 3) diffCB = bootstrapMeanCI_corr(data$IBFV - data$PARTICLES, 3) diffCA = bootstrapMeanCI_corr(data$FROLIC - data$PARTICLES, 3) analysisData <- c() analysisData$name <- c("IBFV-OLIC","IBFV-PS","OLIC-PS") # Symbol name has been changed in paper to Glyph analysisData$pointEstimate <- c(diffBA[1], diffCB[1], diffCA[1]) analysisData$ci.max <- c(diffBA[6], diffCB[6], diffCA[6]) analysisData$ci.min <- c(diffBA[5], diffCB[5], diffCA[5]) analysisData$level <- c(diffBA[4], diffCB[4], diffCA[4]) analysisData$ci_corr.max <- c(diffBA[6], diffCB[6], diffCA[6]) analysisData$ci_corr.min <- c(diffBA[5], diffCB[5], diffCA[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 = 3, ymin = -2, ymax = 2, mycolor = "darkorange1", "", "") # drop columns with N/A elements <- na.omit(elements) data <- elements 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 print(summary(statstable_error)) # elements <- reshape(elements, timevar="technique", idvar=c("participant"), direction="wide") print(elements) 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) analysisData <- c() analysisData$name <- c("PS","IBFV","OLIC") analysisData$pointEstimate <- c(techniqueC[1], techniqueB[1], techniqueA[1]) analysisData$ci.max <- c(techniqueC[3], techniqueB[3], techniqueA[3]) analysisData$ci.min <- c(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, "error", sep="_") barChart(datatoprint, analysisData$name, nbTechs = 3, ymin = 0, ymax = 6, mycolor = "darkorange1", "", "") ggsave(paste(filename, "pdf", sep="."), device = cairo_pdf, width=3.5, height=2) ggsave(paste0("plot_",filename,".pdf",seq=""), device = pdf, width=3, height=2) diffBA = bootstrapMeanCI_corr(data$IBFV - data$FROLIC, 18) diffCB = bootstrapMeanCI_corr(data$IBFV - data$PARTICLES, 18) diffCA = bootstrapMeanCI_corr(data$FROLIC - data$PARTICLES, 18) analysisData <- c() analysisData$name <- c("IBFV-OLIC","IBFV-PS","OLIC-PS") # Symbol name has been changed in paper to Glyph analysisData$pointEstimate <- c(diffBA[1], diffCB[1], diffCA[1]) analysisData$ci.max <- c(diffBA[3], diffCB[3], diffCA[3]) analysisData$ci.min <- c(diffBA[2], diffCB[2], diffCA[2]) analysisData$level <- c(diffBA[4], diffCB[4], diffCA[4]) analysisData$ci_corr.max <- c(diffBA[6], diffCB[6], diffCA[6]) analysisData$ci_corr.min <- c(diffBA[5], diffCB[5], diffCA[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) print(datatoprint) 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, "errordiff", sep="_") barChart(datatoprint, analysisData$name, nbTechs = 3, ymin = -4, ymax = 4, mycolor = "darkorange1", "", "") ggsave(paste(filenamediff, "pdf", sep="."), width=3.5, height=2, device = cairo_pdf) } plotFeatureError("Saddle") plotFeatureError("Center") plotFeatureError("Repelling Node") plotFeatureError("Repelling Focus") plotFeatureError("Attracting Focus") plotFeatureError("Attracting Node")