Memuat
Memuat
Nonparametric Tests (Mann-Whitney and Kruskal-Wallis) for Informatics and Information Systems
0 views
The analysis is meant to compare satisfaction score across interface design groups without normality assumptions and compute Spearman correlation with task completion time, demonstrated on synthetic data. Nonparametric tests compare distributions or medians across groups without assuming normality: Kruskal-Wallis for three or more groups, Mann-Whitney for two groups, plus Spearman rank correlation. They suit theses with ordinal scores, Likert scales, small samples or heavily skewed data.

The analysis is meant to compare satisfaction score across interface design groups without normality assumptions and compute Spearman correlation with task completion time, demonstrated on synthetic data.
| Role | Variable | Unit |
|---|---|---|
| Main | Satisfaction score | score |
| Supporting 1 | Interface design | group |
| Supporting 2 | Task completion time | seconds |
Kruskal-Wallis shows that Satisfaction score differs significantly across Interface design groups (H = 25.42, p < 0.001, epsilon2 = 0.064). Mann-Whitney between Skeuomorphic and Material design is significant (p < 0.001) with a small effect (r = 0.27). The Spearman correlation of Satisfaction score with Task completion time is 0.29 (p < 0.001).
Computed from illustrative synthetic data, not from a real study.
Nonparametric tests compare distributions or medians across groups without assuming normality: Kruskal-Wallis for three or more groups, Mann-Whitney for two groups, plus Spearman rank correlation. They suit theses with ordinal scores, Likert scales, small samples or heavily skewed data.
Report the Kruskal-Wallis H, degrees of freedom, p-value and epsilon squared, then the pairs that differ in the corrected pairwise Wilcoxon tests. For Mann-Whitney report W, p and r (0.1 small, 0.3 medium, 0.5 large), and the Spearman rho with its p-value.
A short starting script with this project's variable names. The delivered version is adapted to your data and fully commented.
# Contoh kode R: Nonparametric Tests (Mann-Whitney and Kruskal-Wallis)
suppressPackageStartupMessages({
library(ggplot2)
library(patchwork)
library(scales)
})
set.seed(42)
# ---- Gaya grafik ----
pal <- c("#1f6feb", "#e8590c", "#2f9e44", "#ae3ec9", "#f59f00")
warna <- list(bg = "#f4f6fa", panel = "#ffffff", teks = "#1f2933", redup = "#5f6b78", grid = "#e3e8ee", bar = "#1d3557")
tata <- 1
theme_set(theme_minimal(base_size = 11) + theme(legend.position = "bottom"))
# ---- Data sintetis: skor menceng pada tiga kelompok + satu variabel kontinu ----
n <- 200
lv <- c("A", "B", "C")
d <- data.frame(interface_design = factor(sample(rep(lv, length.out = n)), levels = lv),
task_completion_time = round(pmax(rnorm(n, 30, 6), 0), 2))
z2 <- as.numeric(scale(d$task_completion_time))
efek <- c(0, runif(1, 0.3, 0.6), runif(1, 0.6, 1.1))[sample(3)] # pergeseran lokasi antarkelompok (dalam SD)
bentuk <- runif(1, 1.5, 3)
galat <- (rgamma(n, shape = bentuk) - bentuk) / sqrt(bentuk) # galat menceng kanan
z <- efek[as.integer(d$interface_design)] - mean(efek) + runif(1, 0.25, 0.5) * z2 + galat * runif(1, 0.7, 0.9)
d$satisfaction_score <- pmax(100 + 15 * z, 0)
d$satisfaction_score <- if (15 >= 3) round(d$satisfaction_score) else round(d$satisfaction_score, 2) # skor bulat bila skalanya lebar
write.csv(d, "data_contoh.csv", row.names = FALSE)
# ---- Pemeriksaan normalitas (alasan memakai uji nonparametrik) ----
sw <- tapply(d$satisfaction_score, d$interface_design, function(v) shapiro.test(v)$p.value)
print(sw)
print(aggregate(satisfaction_score ~ interface_design, data = d, FUN = function(v) c(median = median(v), IQR = IQR(v), n = length(v))))
# ---- Kruskal-Wallis + ukuran efek epsilon kuadrat ----
kw <- kruskal.test(satisfaction_score ~ interface_design, data = d)
print(kw)
eps2 <- unname(kw$statistic) / (nrow(d) - 1)
# ---- Perbandingan berpasangan Wilcoxon (koreksi Holm) ----
pw <- pairwise.wilcox.test(d$satisfaction_score, d$interface_design, p.adjust.method = "holm", exact = FALSE)
print(pw)
# ---- Mann-Whitney: dua kelompok dengan median paling jauh + ukuran efek r ----
med <- tapply(d$satisfaction_score, d$interface_design, median)
ekstrem <- names(c(which.min(med), which.max(med)))
if (ekstrem[1] == ekstrem[2]) ekstrem <- lv[c(1, 3)]
sub <- droplevels(d[d$interface_design %in% ekstrem, ])
mw <- wilcox.test(satisfaction_score ~ interface_design, data = sub, exact = FALSE)
print(mw)
z_mw <- qnorm(mw$p.value / 2)
r_mw <- abs(z_mw) / sqrt(nrow(sub))
# ---- Korelasi peringkat Spearman ----
sp <- cor.test(d$satisfaction_score, d$task_completion_time, method = "spearman", exact = FALSE)
print(sp)
# ---- Grafik ----
bungkus <- scales::label_wrap(12)
pendek <- function(s, w = 12) ifelse(nchar(s) > w, paste0(trimws(substr(s, 1, w - 1)), "."), s)
dmed <- data.frame(interface_design = factor(names(med), levels = lv), median = as.numeric(med))
p1 <- ggplot(d, aes(interface_design, satisfaction_score)) +
geom_violin(aes(fill = interface_design), alpha = 0.3, colour = NA, trim = TRUE) +
geom_boxplot(width = 0.18, outlier.size = 0.8, colour = warna$redup, fill = warna$panel, alpha = 0.8) +
geom_point(data = dmed, aes(y = median), shape = 21, size = 3, fill = pal[2], colour = warna$teks) +
scale_fill_manual(values = pal[c(1, 3, 4)], guide = "none") +
scale_x_discrete(labels = bungkus) +
labs(title = "Distribution by group (dot = median)", x = NULL, y = "satisfaction_score")
mp <- matrix(NA_real_, 3, 3, dimnames = list(lv, lv))
mp[rownames(pw$p.value), colnames(pw$p.value)] <- pw$p.value
mp[upper.tri(mp)] <- t(mp)[upper.tri(mp)]
dp <- expand.grid(a = 1:3, b = 1:3)
dp$p <- mp[cbind(dp$a, dp$b)]
dp$teks <- ifelse(is.na(dp$p), "-", ifelse(dp$p < 0.001, "<0.001", sprintf("%.3f", dp$p)))
dp$skor <- ifelse(is.na(dp$p), NA, pmin(-log10(dp$p), 6))
dp$a <- factor(pendek(lv)[dp$a], levels = pendek(lv)); dp$b <- factor(pendek(lv)[dp$b], levels = rev(pendek(lv)))
p2 <- ggplot(dp, aes(a, b, fill = skor)) +
geom_tile(colour = warna$panel, linewidth = 1.2) +
geom_label(aes(label = teks), fill = warna$panel, colour = warna$teks, size = 3.2, label.size = 0, alpha = 0.85) +
scale_fill_gradient(low = warna$grid, high = pal[2], na.value = warna$panel, limits = c(0, 6), guide = "none") +
scale_x_discrete(labels = bungkus) + scale_y_discrete(labels = bungkus) +
labs(title = "Pairwise Wilcoxon p-values (Holm)", x = NULL, y = NULL) +
theme(panel.grid = element_blank())
dr <- data.frame(ry = rank(d$satisfaction_score), rx = rank(d$task_completion_time), kelompok = d$interface_design)
p3 <- ggplot(dr, aes(rx, ry)) +
geom_point(aes(colour = kelompok), alpha = 0.55, size = 1.4) +
geom_smooth(method = "lm", formula = y ~ x, colour = warna$teks, fill = warna$redup, alpha = 0.2, linewidth = 1) +
scale_colour_manual(values = pal[c(1, 3, 4)], name = NULL, labels = pendek) +
labs(title = sprintf("Spearman rank scatter (rho = %.2f)", sp$estimate), x = "Rank of task_completion_time", y = "Rank of satisfaction_score") +
theme(legend.position = "bottom")
p_hasil <- if (tata == 1) p1 | (p2 / p3) else (p2 / p3) | p1
print(p_hasil)
The original project file is available. It is not just the picture above: you get the working R project. It can be downloaded after payment, and we send it by WhatsApp or email.
ZIP: analisis.R + data_contoh.csv + BACA-DULU.txt
Choose how much help you need. Each higher package includes everything in the lower ones. Prices exclude 11% VAT.
Package 1
US$19
excl. 11% VAT
Duration: 3 working days
Output: R files + result figures
Deliverables
Package 2 · most chosen
US$56
excl. 11% VAT
Duration: 7 working days
Output: Code + analysis + interpretation notes
Includes all of Package 1, plus
Package 3
US$122
excl. 11% VAT
Duration: 12-15 working days
Output: Code + analysis + guidance until ready to present
Includes all of Packages 1 & 2, plus
Yes. The original project file is a ZIP containing the complete analisis.R script, a data_contoh.csv sample dataset and a BACA-DULU.txt guide. It can be downloaded after payment, and we send it by WhatsApp or email. For your own data (Package 2 and 3) the script is adapted to your dataset.
Yes. Nonparametric Tests (Mann-Whitney and Kruskal-Wallis) is commonly used at this level in Informatics and Information Systems. We adapt the analysis to your research question, your own data and your supervisor's requirements.
No. The sheet is computed from illustrative synthetic data so you can see the kind of output R Studio gives. For your order we run the same method on your own data.
That is the point of the packages. Every script is commented, and Package 3 includes two coaching sessions plus practice questions so you can explain the method and the results at your seminar and defence.
Each project has three packages: Package 1 (code and explanation) US$19, Package 2 (your data analysis and interpretation) US$56 and Package 3 (full guidance) US$122, excluding 11% VAT. Larger datasets, extra methods or tight deadlines adjust the quote after a short consultation.
The result sheet uses illustrative synthetic data. R is a programming language of the R Foundation project; RStudio and Posit are trademarks of Posit PBC.
Back to R Studio portfolio