Kernel: R (R-Project)
UEQ
Loadings
In [1]:
## loadings library(psychometric) library(readxl) data <- as.data.frame(read_excel("UEQ-SK (data).xlsx"))[,1:27] data <- data[,c(2:ncol(data),1)]
Out[1]:
Loading required package: multilevel
Loading required package: nlme
Loading required package: MASS
In [3]:
data
Out[3]:
In [2]:
## dimensions of UEQ dimensions <- c("Attractiveness", "Perspicuity", "Efficiency", "Dependability", "Stimulation", "Novelty") Attractiveness <- c(1,12,14,16,24,25) Perspicuity <- c(2,4,13,21) Efficiency <- c(9,20,22,23) Dependability <- c(8,11,17,19) Stimulation <- c(5:7,18) Novelty <- c(3,10,15,26)
In [3]:
## the order of the positive and negative term for an item positive <- c(1,2,6:8,11,13:16,20,22,26) negative <- setdiff(1:26, positive)
In [4]:
## benchmark table tabBM <- as.data.frame(matrix(NA, 6, 6)) colnames(tabBM) <- dimensions rownames(tabBM) <- c("lower border", "bad", "below average", "above average", "good", "excellent") tabBM[1,] <- -1 tabBM[2,] <- c(0.7, 0.64, 0.54, 0.78, 0.5, 0.3) +1 tabBM[3,] <- c(0.47, 0.44, 0.44, 0.36, 0.49, 0.41) tabBM[4,] <- c(0.35, 0.48, 0.49, 0.34, 0.32, 0.34) tabBM[5,] <- c(0.23, 0.34, 0.31, 0.17, 0.24, 0.35) tabBM[6,] <- c(0.75, 0.6, 0.72, 0.85, 0.95, 1.1) colors <- c("red", "orange", "green", "forestgreen", "darkgreen")
In [5]:
## define plot function with error bars error.bar <- function(x, y, upper, lower=upper, length=0.1,...){ if(length(x) != length(y) | length(y) !=length(lower) | length(lower) != length(upper)) stop("vectors must be same length") arrows(x,y+upper, x, y-lower, angle=90, code=3, length=length, ...) }
Processing
In [6]:
## transformed values DT <- as.data.frame(matrix(NA,nrow(data), ncol(data))) colnames(DT) <- colnames(data) DT[,1] <- data[,1] for(i in 1:13){ DT[,positive[i]] <- data[positive[i]] - 4 DT[,negative[i]] <- 4 - data[negative[i]] }
In [7]:
## table of means for each respondent tab <- as.data.frame(matrix(NA, nrow(DT), 6)) colnames(tab) <- dimensions tab$Attractiveness <- rowMeans(DT[,Attractiveness]) tab$Perspicuity <- rowMeans(DT[,Perspicuity]) tab$Efficiency <- rowMeans(DT[,Efficiency]) tab$Dependability <- rowMeans(DT[,Dependability]) tab$Stimulation <- rowMeans(DT[,Stimulation]) tab$Novelty <- rowMeans(DT[,Novelty])
In [8]:
## means of all respondents scales <- apply(tab, 2, mean) stDev <- apply(tab, 2, sd) scales stDev
Out[8]:
In [9]:
## means for different groups of respondents scales_KDF <- apply(tab[data$id=="KDF",], 2, mean) scales_KUF <- apply(tab[data$id=="KUF",], 2, mean)
Analysis
In [26]:
library(repr) options(repr.plot.width=8, repr.plot.height=5) ## plot by dimensions par(mar = c(3, 3, 2, 2)) plot <- barplot(scales, col = "skyblue", ylim = c(-3,3), las = 1) error.bar(plot,scales, 1.96*stDev/sqrt(10)) abline(h = 0.8, col = "darkgreen", lty = 2) abline(h = -0.8, col = "red", lty = 2) abline(h=0) legend("bottomright", c("positive","neutral", "negative"), lty = 2, col = c("darkgreen", "white", "red"))
Out[26]:
In [27]:
options(repr.plot.width=8, repr.plot.height=5) ## plot by grouped dimensions par(mar = c(3, 3, 2, 2)) barplot(height = c(scales[1], mean(scales[2:4]), mean(scales[5:6])), col = "skyblue", ylim = c(-3,3), las = 1, names.arg = c("Attractiveness", "Pragmatic Quality", "Hedonic Quality")) abline(h = 0.8, col = "darkgreen", lty = 2) abline(h = -0.8, col = "red", lty = 2) abline(h=0) legend("topright", c("positive","neutral", "negative"), lty = 2, col = c("darkgreen", "white", "red"))
Out[27]:
In [28]:
options(repr.plot.width=10, repr.plot.height=5) ## benchmark plot par(mar = c(3, 3, 2, 10), xpd = TRUE) plot2 <- barplot(as.matrix(tabBM), names.arg = dimensions, ylim = c(-1,2.5), las = 1, col = c(scales::alpha(c("white", colors), 0.7)), border = "white") ## 1st group = KUF (teachers) lines(plot2, scales_KUF, lwd = 2) points(plot2, scales_KUF, pch = 19) ## 2nd group = KDF (doctoral students) lines(plot2, scales_KDF, lwd = 2, lty = 2) points(plot2, scales_KDF, pch = 17) legend("topright", inset = c(-0.4, 0.2), bty = "n", legend = c(rev(rownames(tabBM)[2:6]), "KUF", "KDF"), col = c(scales::alpha(rev(colors), 0.7), "black", "black"), pch = c(15, 15, 15, 15, 15, 19, 17), lwd = c(NA, NA, NA, NA, NA, 2, 2), lty = c(NA, NA, NA, NA, NA, 1, 2))
Out[28]:
In [14]:
## scale consistency - UEQ alpha(DT[,1:26]) ## scale consistencydimensions of UEQ alpha(DT[,Attractiveness]) alpha(DT[,Perspicuity]) alpha(DT[,Efficiency]) alpha(DT[,Dependability]) alpha(DT[,Stimulation]) alpha(DT[,Novelty])
Out[14]:
In [0]: