Memuat
Memuat
PLS-SEM (seminr) for Education and Learning
0 views
Testing the path from content quality to learning engagement to student satisfaction with PLS-SEM using synthetic data for demonstration. PLS-SEM (Partial Least Squares Structural Equation Modelling) tests the measurement model of latent constructs and the structural links among them, including mediation, using bootstrapping. It suits questionnaire-based theses with Likert items, moderate samples and a predictive or exploratory aim.

Testing the path from content quality to learning engagement to student satisfaction with PLS-SEM using synthetic data for demonstration.
| Role | Variable | Unit |
|---|---|---|
| Main | Student satisfaction | Likert 1-5 |
| Supporting 1 | Content quality | Likert 1-5 |
| Supporting 2 | Learning engagement | Likert 1-5 |
The constructs are reliable and valid (minimum rhoC 0.858, minimum AVE 0.649, maximum HTMT 0.760). Content quality has a direct effect on Student satisfaction (beta = 0.370, p < 0.001), and its indirect effect through Learning engagement is 0.221 (95% CI 0.114 to 0.334), which is significant. The model explains 45.1% of the variance in Student satisfaction.
Computed from illustrative synthetic data, not from a real study.
PLS-SEM (Partial Least Squares Structural Equation Modelling) tests the measurement model of latent constructs and the structural links among them, including mediation, using bootstrapping. It suits questionnaire-based theses with Likert items, moderate samples and a predictive or exploratory aim.
Report the measurement model first (loadings, rhoC, AVE, HTMT), then the structural model (path coefficients, bootstrap t and p, and R2). The indirect effect is significant when its 95% bootstrap interval excludes zero; compare it with the direct effect to judge partial or full mediation.
A short starting script with this project's variable names. The delivered version is adapted to your data and fully commented.
# Contoh kode R: PLS-SEM (seminr)
suppressPackageStartupMessages({
library(ggplot2)
library(patchwork)
library(seminr)
})
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 butir Likert 1-5 dari tiga konstruk laten ----
n <- 200
a <- runif(1, 0.4, 0.7) # jalur X1 -> X2 (mediator)
b <- runif(1, 0.3, 0.55) # jalur X2 -> Y
cp <- runif(1, 0.1, 0.35) # jalur langsung X1 -> Y
e_x1 <- rnorm(n)
e_x2 <- a * e_x1 + rnorm(n, 0, sqrt(1 - a^2))
e_y <- cp * e_x1 + b * e_x2 + rnorm(n, 0, runif(1, 0.55, 0.75))
e_y <- as.numeric(scale(e_y))
# butir Likert: muatan acak 0.65-0.9, ambang dibuat agar rata-rata butir sekitar 3.4-3.8
likert <- function(eta, k) {
sapply(seq_len(k), function(j) {
l <- runif(1, 0.65, 0.9)
s <- l * eta + rnorm(length(eta), 0, sqrt(1 - l^2))
findInterval(s, sort(c(-2, -1.1, -0.2, 0.9) + runif(1, -0.3, 0.2))) + 1
})
}
k <- c(4, 3, 4) # jumlah butir: X1, X2, Y
d <- data.frame(likert(e_x1, k[1]), likert(e_x2, k[2]), likert(e_y, k[3]))
names(d) <- c(paste0("content_quality", "_", 1:k[1]), paste0("learning_engagement", "_", 1:k[2]), paste0("student_satisfaction", "_", 1:k[3]))
write.csv(d, "data_contoh.csv", row.names = FALSE)
# ---- Model pengukuran (reflektif, mode A) dan model struktural ----
mm <- constructs(
composite("content_quality", multi_items("content_quality_", 1:k[1]), weights = mode_A),
composite("learning_engagement", multi_items("learning_engagement_", 1:k[2]), weights = mode_A),
composite("student_satisfaction", multi_items("student_satisfaction_", 1:k[3]), weights = mode_A))
sm <- relationships(
paths(from = "content_quality", to = c("learning_engagement", "student_satisfaction")),
paths(from = "learning_engagement", to = "student_satisfaction"))
pls <- estimate_pls(data = d, measurement_model = mm, structural_model = sm)
s <- summary(pls)
print(s$loadings); print(s$reliability); print(s$validity$htmt); print(s$paths)
# ---- Bootstrap untuk signifikansi jalur dan efek tidak langsung ----
bt <- bootstrap_model(seminr_model = pls, nboot = 400, cores = 1, seed = 123)
sb <- summary(bt)
print(sb$bootstrapped_paths)
ind <- specific_effect_significance(bt, from = "content_quality", through = "learning_engagement", to = "student_satisfaction", alpha = 0.05)
print(ind)
bp <- sb$bootstrapped_paths
p_jalur <- 2 * pnorm(-abs(bp[, "T Stat."])) # p dua sisi dari statistik t bootstrap
koef <- bp[, "Original Est."]
nm_j <- rownames(bp) # "X1 -> X2" dst.
j_a <- grep("^content_quality .*-> *learning_engagement$", nm_j); j_b <- grep("^learning_engagement .*-> *student_satisfaction$", nm_j); j_c <- grep("^content_quality .*-> *student_satisfaction$", nm_j)
rel <- s$reliability
ave <- rel[, "AVE"]; rhoc <- rel[, "rhoC"]
r2 <- s$paths["R^2", c("learning_engagement", "student_satisfaction")]
htmt_maks <- max(s$validity$htmt, na.rm = TRUE)
ind_est <- unname(ind["Original Est."]); ind_lo <- unname(ind["2.5% CI"]); ind_hi <- unname(ind["97.5% CI"])
# ---- Grafik ----
bintang <- function(p) ifelse(p < 0.001, "***", ifelse(p < 0.01, "**", ifelse(p < 0.05, "*", " ns")))
bungkus <- function(s) paste(head(strwrap(s, 17), 2), collapse = "\n") # nama konstruk maks. 2 baris
nd <- data.frame(x = c(0, 1, 2), y = c(0, 1, 0), lab = c(bungkus("content_quality"), bungkus("learning_engagement"), bungkus("student_satisfaction")),
r2 = c("", sprintf("R2 = %.2f", r2[1]), sprintf("R2 = %.2f", r2[2])))
pan <- data.frame(x = c(0.2, 1.2, 0.36), y = c(0.2, 0.8, 0), xend = c(0.8, 1.8, 1.64), yend = c(0.8, 0.2, 0),
lab = sprintf("%.2f%s", koef[c(j_a, j_b, j_c)], bintang(p_jalur[c(j_a, j_b, j_c)])),
lx = c(0.33, 1.67, 1), ly = c(0.6, 0.6, -0.1))
p1 <- ggplot() +
geom_segment(data = pan, aes(x, y, xend = xend, yend = yend), colour = warna$redup, linewidth = 0.9,
arrow = arrow(length = unit(0.14, "inches"), type = "closed")) +
geom_text(data = pan, aes(lx, ly, label = lab), colour = warna$teks, size = 3.4, fontface = "bold") +
geom_tile(data = nd, aes(x, y), width = 0.72, height = 0.38, fill = pal[1:3]) +
geom_text(data = nd, aes(x, y + 0.04, label = lab), colour = warna$panel, fontface = "bold", size = 3.1, lineheight = 0.9) +
geom_text(data = nd, aes(x, y - 0.13, label = r2), colour = warna$panel, size = 2.8) +
annotate("text", x = 1, y = -0.34, label = sprintf("Indirect effect = %.3f [%.3f, %.3f]", ind_est, ind_lo, ind_hi),
colour = warna$teks, size = 3.2) +
coord_cartesian(xlim = c(-0.4, 2.4), ylim = c(-0.42, 1.22)) +
theme_void() + theme(plot.background = element_rect(fill = warna$panel, colour = NA),
plot.title = element_text(face = "bold", colour = warna$teks, margin = margin(4, 0, 4, 6))) +
labs(title = "PLS path model (bootstrap, 400 resamples)")
ld <- s$loadings
dl <- data.frame(butir = rownames(ld), muatan = apply(ld, 1, function(v) v[v != 0][1]))
# nama konstruk pendek (<= 18 huruf): kata sambung dibuang dan kata panjang disingkat bila perlu
singkat <- function(s, w = 18) {
k <- strsplit(s, " ")[[1]]
if (nchar(s) > w) k <- k[!tolower(k) %in% c("of", "to", "the", "and", "for", "in", "on", "with")]
i <- length(k)
while (nchar(paste(k, collapse = " ")) > w && i >= 1) {
if (nchar(k[i]) > 5) k[i] <- paste0(substr(k[i], 1, 4), ".")
i <- i - 1
}
substr(paste(k, collapse = " "), 1, w)
}
nm_k <- make.unique(unname(sapply(c("content_quality", "learning_engagement", "student_satisfaction"), singkat)), sep = " ")
dl$konstruk <- rep(nm_k, k)
dl$label <- paste0(dl$konstruk, " #", sub(".*_", "", dl$butir))
dl$label <- factor(dl$label, levels = rev(unique(dl$label)))
dl$konstruk <- factor(dl$konstruk, levels = nm_k)
p2 <- ggplot(dl, aes(muatan, label, fill = konstruk)) +
geom_col(width = 0.7) +
geom_vline(xintercept = 0.7, linetype = "dashed", colour = warna$teks) +
geom_text(aes(label = sprintf("%.2f", muatan)), hjust = -0.15, colour = warna$teks, size = 2.7) +
scale_fill_manual(values = pal[1:3], name = NULL) +
scale_x_continuous(limits = c(0, 1.1), breaks = seq(0, 1, 0.2)) +
labs(title = "Outer loadings (threshold 0.7)", x = "Loading", y = NULL)
dq <- data.frame(konstruk = factor(rep(nm_k, 2), levels = nm_k),
ukuran = rep(c("AVE", "rhoC"), each = 3), nilai = c(ave[c("content_quality", "learning_engagement", "student_satisfaction")], rhoc[c("content_quality", "learning_engagement", "student_satisfaction")]))
p3 <- ggplot(dq, aes(konstruk, nilai, fill = ukuran)) +
geom_col(position = position_dodge(0.75), width = 0.7) +
geom_hline(yintercept = c(0.5, 0.7), linetype = "dashed", colour = warna$redup) +
scale_fill_manual(values = pal[4:5], name = NULL) +
scale_y_continuous(limits = c(0, 1)) +
labs(title = "Convergent validity and reliability", x = NULL, y = "Value")
p_hasil <- if (tata == 1) p1 / (p2 | p3) + plot_layout(heights = c(1.1, 1)) else (p1 | p2) / p3 + plot_layout(heights = c(1.4, 1))
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$31
excl. 11% VAT
Duration: 7 working days
Output: R files + result figures
Deliverables
Package 2 · most chosen
US$91
excl. 11% VAT
Duration: 13 working days
Output: Code + analysis + interpretation notes
Includes all of Package 1, plus
Package 3
US$200
excl. 11% VAT
Duration: 18-21 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. PLS-SEM (seminr) is commonly used at this level in Education and Learning. 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$31, Package 2 (your data analysis and interpretation) US$91 and Package 3 (full guidance) US$200, 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