Subjective questionnaire

#install.packages(c("ggplot2", "doBy"))
require(ggplot2)
## Loading required package: ggplot2
require(doBy)
## Loading required package: doBy
## Loading required package: survival
## Loading required package: splines
## Loading required package: MASS
require(psych)
## Loading required package: psych
## 
## Attaching package: 'psych'
## 
## The following object is masked from 'package:ggplot2':
## 
##     %+%
library(reshape2)
require(xtable)
## Loading required package: xtable
data <- read.csv(file="data/Resultados.csv", head=TRUE, skip=1, sep=",")
names(data)

Demographics

s <- describe(data[,c(4:9)])
s <- cbind(Device=rownames(s), s)

rownames(s)<-NULL

print(xtable(s), type = "html")
Device vars n mean sd median trimmed mad min max range skew kurtosis se
1 Gender* 1 12.00 1.75 0.45 2.00 1.80 0.00 1.00 2.00 1.00 -1.01 -1.04 0.13
2 Age* 2 12.00 3.08 1.38 3.00 3.00 1.48 1.00 6.00 5.00 0.63 -0.48 0.40
3 How.often.do.you.use.a.computer.* 3 12.00 1.00 0.00 1.00 1.00 0.00 1.00 1.00 0.00 0.00
4 How.often.do.you.use.a.computer.mouse.* 4 12.00 1.25 0.62 1.00 1.10 0.00 1.00 3.00 2.00 1.95 2.43 0.18
5 How.often.do.you.use.a.Touchpad.* 5 12.00 2.08 1.24 1.50 2.00 0.74 1.00 4.00 3.00 0.38 -1.68 0.36
6 How.often.do.you.use.a.Leap.Motion.* 6 12.00 1.58 0.51 2.00 1.60 0.00 1.00 2.00 1.00 -0.30 -2.06 0.15
write.table(s, file = "tables/questionnaire-demographics-summary.csv", sep=",", row.names=FALSE)
s <- describe(data[,c(11:22)])
s <- cbind(Device=rownames(s), s)

rownames(s)<-NULL
print(xtable(s), type = "html")
Device vars n mean sd median trimmed mad min max range skew kurtosis se
1 Force.required.for.actuation 1 12.00 3.08 1.16 3.00 3.00 1.48 2.00 5.00 3.00 0.49 -1.40 0.34
2 Smoothness.during.operation 2 12.00 2.83 1.34 2.00 2.80 0.74 1.00 5.00 4.00 0.48 -1.38 0.39
3 Effort.required.for.operation 3 12.00 2.17 1.19 2.00 2.00 1.48 1.00 5.00 4.00 0.89 0.01 0.34
4 Accuracy 4 12.00 2.92 1.16 3.00 2.90 1.48 1.00 5.00 4.00 0.14 -1.22 0.34
5 Operation.Speed 5 12.00 3.50 1.38 3.50 3.60 2.22 1.00 5.00 4.00 -0.28 -1.41 0.40
6 General.comfort 6 12.00 2.42 0.90 2.50 2.40 0.74 1.00 4.00 3.00 -0.12 -1.09 0.26
7 Overall.operation.of.input.device 7 12.00 2.92 1.08 2.50 2.80 0.74 2.00 5.00 3.00 0.54 -1.36 0.31
8 Finger.fatigue 8 12.00 3.33 1.15 3.50 3.30 1.48 2.00 5.00 3.00 0.05 -1.65 0.33
9 Wrist.fatigue 9 12.00 3.25 1.06 3.00 3.20 1.48 2.00 5.00 3.00 0.40 -1.20 0.30
10 Arm.fatigue 10 12.00 2.42 0.90 2.00 2.40 0.00 1.00 4.00 3.00 0.57 -0.84 0.26
11 Shoulder.fatigue 11 12.00 2.83 1.80 3.00 2.80 2.97 1.00 5.00 4.00 0.14 -1.85 0.52
12 Neck.fatigue 12 12.00 3.67 1.50 4.00 3.80 1.48 1.00 5.00 4.00 -0.37 -1.58 0.43
write.table(s, file = "tables/questionnaire-leapmotion-summary.csv", sep=",", row.names=FALSE)
s <- describe(data[,c(24:35)])
s <- cbind(Device=rownames(s), s)

rownames(s)<-NULL
print(xtable(s), type = "html")
Device vars n mean sd median trimmed mad min max range skew kurtosis se
1 Force.required.for.actuation.1 1 12.00 3.67 1.23 4.00 3.80 1.48 1.00 5.00 4.00 -0.75 -0.52 0.36
2 Smoothness.during.operation.1 2 12.00 4.00 0.85 4.00 4.00 1.48 3.00 5.00 2.00 0.00 -1.74 0.25
3 Effort.required.for.operation.1 3 12.00 3.92 1.00 4.00 4.00 1.48 2.00 5.00 3.00 -0.36 -1.21 0.29
4 Accuracy.1 4 12.00 4.25 0.87 4.50 4.30 0.74 3.00 5.00 2.00 -0.43 -1.63 0.25
5 Operation.Speed.1 5 12.00 4.25 1.14 5.00 4.40 0.00 2.00 5.00 3.00 -0.78 -1.24 0.33
6 General.comfort.1 6 12.00 4.00 0.85 4.00 4.00 1.48 3.00 5.00 2.00 0.00 -1.74 0.25
7 Overall.operation.of.input.device.1 7 12.00 4.42 0.79 5.00 4.50 0.00 3.00 5.00 2.00 -0.75 -1.11 0.23
8 Finger.fatigue.1 8 12.00 3.42 0.79 3.00 3.40 0.74 2.00 5.00 3.00 0.25 -0.69 0.23
9 Wrist.fatigue.1 9 12.00 3.67 1.15 3.50 3.70 1.48 2.00 5.00 3.00 -0.05 -1.65 0.33
10 Arm.fatigue.1 10 12.00 3.92 1.08 4.00 4.00 1.48 2.00 5.00 3.00 -0.64 -0.99 0.31
11 Shoulder.fatigue.1 11 12.00 4.17 0.83 4.00 4.30 0.00 2.00 5.00 3.00 -1.13 1.11 0.24
12 Neck.fatigue.1 12 12.00 4.42 0.90 5.00 4.60 0.00 2.00 5.00 3.00 -1.49 1.44 0.26
write.table(s, file = "tables/questionnaire-touchpad-summary.csv", sep=",", row.names=FALSE)
s <- describe(data[,c(37:48)])
s <- cbind(Device=rownames(s), s)

rownames(s)<-NULL
print(xtable(s), type = "html")
Device vars n mean sd median trimmed mad min max range skew kurtosis se
1 Force.required.for.actuation.2 1 12.00 3.83 1.19 4.00 3.90 1.48 2.00 5.00 3.00 -0.30 -1.63 0.34
2 Smoothness.during.operation.2 2 12.00 4.00 1.13 4.00 4.10 1.48 2.00 5.00 3.00 -0.70 -1.05 0.33
3 Effort.required.for.operation.2 3 12.00 3.83 1.34 4.50 3.90 0.74 2.00 5.00 3.00 -0.35 -1.80 0.39
4 Accuracy.2 4 12.00 4.67 0.65 5.00 4.80 0.00 3.00 5.00 2.00 -1.47 0.81 0.19
5 Operation.Speed.2 5 12.00 4.67 0.49 5.00 4.70 0.00 4.00 5.00 1.00 -0.62 -1.74 0.14
6 General.comfort.2 6 12.00 4.00 1.28 5.00 4.10 0.00 2.00 5.00 3.00 -0.48 -1.69 0.37
7 Overall.operation.of.input.device.2 7 12.00 4.67 0.49 5.00 4.70 0.00 4.00 5.00 1.00 -0.62 -1.74 0.14
8 Finger.fatigue.2 8 12.00 4.08 1.00 4.00 4.20 1.48 2.00 5.00 3.00 -0.65 -0.87 0.29
9 Wrist.fatigue.2 9 12.00 3.50 1.31 3.50 3.50 2.22 2.00 5.00 3.00 0.00 -1.86 0.38
10 Arm.fatigue.2 10 12.00 4.33 0.98 5.00 4.50 0.00 2.00 5.00 3.00 -1.14 0.03 0.28
11 Shoulder.fatigue.2 11 12.00 4.33 1.23 5.00 4.60 0.00 1.00 5.00 4.00 -1.66 1.65 0.36
12 Neck.fatigue.2 12 12.00 4.33 0.98 5.00 4.50 0.00 2.00 5.00 3.00 -1.14 0.03 0.28
write.table(s, file = "tables/questionnaire-mouse-summary.csv", sep=",", row.names=FALSE)
s <- describe(data[,c(50, 51)])
s <- cbind(Device=rownames(s), s)

rownames(s)<-NULL
print(xtable(s), type = "html")
Device vars n mean sd median trimmed mad min max range skew kurtosis se
1 Which.was.your.favorite.device.* 1 12.00 1.08 0.29 1.00 1.00 0.00 1.00 2.00 1.00 2.65 5.48 0.08
2 Which.device.did.you.prefer.less.* 2 12.00 1.08 0.29 1.00 1.00 0.00 1.00 2.00 1.00 2.65 5.48 0.08
write.table(s, file = "tables/questionnaire-devicepreference-summary.csv", sep=",", row.names=FALSE)
#####
m <- NULL
for (i in 11:22) {
  print(colnames(data)[i])
  c1 <- colnames(data)[i]
  c2 <- paste(c1,".1", sep="")
  c3 <- paste(c1,".2", sep="")

  m1 <- melt(data[,c("ID", c1, c2, c3)], id=c("ID"))
  colnames(m1) <- c("ID", "Device", c1) 
  levels(m1$Device) <- list( LeapMotion=c(c1),  Touchpad=c(c2), Mouse=c(c3) )
  if ( is.null(m) ) {
    m <- m1
  } else{
    m<-cbind(m, c=m1[,c(c1)] )  
    colnames(m)[colnames(m) == "c"] <- c1
  }

}
## [1] "Force.required.for.actuation"
## [1] "Smoothness.during.operation"
## [1] "Effort.required.for.operation"
## [1] "Accuracy"
## [1] "Operation.Speed"
## [1] "General.comfort"
## [1] "Overall.operation.of.input.device"
## [1] "Finger.fatigue"
## [1] "Wrist.fatigue"
## [1] "Arm.fatigue"
## [1] "Shoulder.fatigue"
## [1] "Neck.fatigue"
m<-melt(m, id=c("ID", "Device"))


ggplot(m, aes(Device, value, colour=Device)) + 
  geom_boxplot() +
  #coord_flip() +
  facet_wrap(  ~ variable,ncol=3)

plot of chunk boxplots

ggsave(file = "charts/questionnaire/iso-boxplot.pdf", width=21/2.54, height=29/2.54, dpi=100)
describe <- describeBy(m$value, list(m$Device,m$variable), mat=TRUE)
colnames(describe)[colnames(describe)=="group1"] <- "Device"
colnames(describe)[colnames(describe)=="group2"] <- "variable"
#Reorder levels for chart
levels(describe$Device) <- list( Mouse=c("Mouse"), Touchpad=c("Touchpad"), LeapMotion=c("LeapMotion"))



#dfc <- summarySE(m, measurevar="value", groupvars=c("Device","variable"))

ggplot(describe, aes(Device, mean, colour=Device, fill=Device)) + 
  #stat_summary(fun.y="mean", geom="bar") + 
 geom_bar(stat="identity") +
  #coord_flip() +
  geom_errorbar(aes(ymin=mean-1.96*se, ymax=mean+1.96*se), colour="Black",
               width=.2,                    # Width of the error bars
               position=position_dodge(.9)) +
  facet_wrap(  ~ variable,ncol=3) +
    theme(legend.position="none", legend.direction="horizontal") +
ggsave(file = "charts/questionnaire/iso-barplot.pdf", width=16/2.54, height=20/2.54, dpi=100)

plot of chunk barplot

describe$l <- ifelse(describe$Device=="Mouse", as.character(describe$variable), NA)

ggplot(describe, aes(x=variable, y=mean, group=Device, colour=Device, fill=Device, label=l) ) + 
    #stat_summary(fun.y="mean", geom="bar") + 
    geom_bar(stat="identity", width=.5, position = position_dodge(width=0.5)) +
    geom_text(angle=70, colour="Black", y=1.05,
              hjust=0, size=4) + 
    #geom_bar() +
    #coord_flip() +
    coord_cartesian(ylim=c(1.0, 5)) +
    ylab("Average score") +
    xlab("") +
    geom_errorbar(aes(ymin=mean-1.96*se, ymax=mean+1.96*se), colour="Black",
                  width=.2,                    # Width of the error bars
                  size = .1,
                  position=position_dodge(.5)) +
    #facet_wrap(  ~ variable,ncol=3) +
    theme(legend.position=c(.5,-0.05), legend.direction="horizontal", 
          axis.text.x = element_blank()) + 
    scale_fill_brewer(palette="Set1") + 
    scale_colour_brewer(palette="Set1")
## Warning: Removed 24 rows containing missing values (geom_text).

plot of chunk barplotall

    ggsave(file = "charts/questionnaire/iso-barplot-side.pdf", width=30/2.54, height=7/2.54, dpi=100)
## Warning: Removed 24 rows containing missing values (geom_text).