-
Notifications
You must be signed in to change notification settings - Fork 21
/
seminr-pls-interaction.R
118 lines (92 loc) · 3.85 KB
/
seminr-pls-interaction.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# Simple Style: Separate declaration of measurement,interactions and structural model.
library(seminr)
# First, using the orthogonal method as per Henseler & Chin (2010). ----
# Creating our measurement model
mobi_mm <- constructs(
composite("Image", multi_items("IMAG", 1:5)),
composite("Expectation", multi_items("CUEX", 1:3)),
composite("Value", multi_items("PERV", 1:2)),
composite("Satisfaction", multi_items("CUSA", 1:3)),
interaction_term(iv = "Image", moderator = c("Expectation"), method = orthogonal),
interaction_term(iv = "Image", moderator = c("Value"), method = orthogonal)
)
# Structural model
# note: interactions should be the names of its main constructs joined by a '*' in between.
mobi_sm <- relationships(
paths(to = "Satisfaction",
from = c("Image", "Expectation", "Value",
"Image*Expectation", "Image*Value"))
)
# Load data, assemble model, and estimate
mobi_pls <- estimate_pls(data = mobi,
measurement_model = mobi_mm,
structural_model = mobi_sm)
summary(mobi_pls)
# Plot the model
plot(mobi_pls)
# Bootstrap the model
boot_mobi_pls <- bootstrap_model(seminr_model = mobi_pls,
nboot = 500)
summary(boot_mobi_pls)
# Plot the bootstrapped model
plot(boot_mobi_pls)
# Second, using the standardized product indicator method as per Henseler & Chin (2010). ----
# seminr syntax for creating measurement model
mobi_mm <- constructs(
composite("Image", multi_items("IMAG", 1:5)),
composite("Expectation", multi_items("CUEX", 1:3)),
composite("Value", multi_items("PERV", 1:2)),
composite("Satisfaction", multi_items("CUSA", 1:3)),
interaction_term(iv = "Image", moderator = c("Expectation"), method = product_indicator, weights = mode_A),
interaction_term(iv = "Image", moderator = c("Value"), method = product_indicator, weights = mode_A)
)
# structural model: note that name of the interactions construct should be
# the names of its two main constructs joined by a '*' in between.
mobi_sm <- relationships(
paths(to = "Satisfaction",
from = c("Image", "Expectation", "Value",
"Image*Expectation", "Image*Value"))
)
# Load data, assemble model, and estimate
mobi_pls <- estimate_pls(data = mobi,
measurement_model = mobi_mm,
structural_model = mobi_sm)
summary(mobi_pls)
# Plot the model
plot(mobi_pls)
# Bootstrap the model
boot_mobi_pls <- bootstrap_model(seminr_model = mobi_pls,
nboot = 500)
summary(boot_mobi_pls)
# Plot the bootstrapped model
plot(boot_mobi_pls)
# Third, using the two_stage method as per Henseler & Chin (2010). ----
# Creating our measurement model
mobi_mm <- constructs(
composite("Image", multi_items("IMAG", 1:5)),
composite("Expectation", multi_items("CUEX", 1:3)),
composite("Value", multi_items("PERV", 1:2)),
composite("Satisfaction", multi_items("CUSA", 1:3)),
interaction_term(iv = "Image", moderator = c("Expectation"), method = two_stage, weights = mode_A),
interaction_term(iv = "Image", moderator = c("Value"), method = two_stage, weights = mode_A)
)
# Structural model
# note: interactions should be the names of its main constructs joined by a '*' in between.
mobi_sm <- relationships(
paths(to = "Satisfaction",
from = c("Image", "Expectation", "Value",
"Image*Expectation", "Image*Value"))
)
# Load data, assemble model, and estimate
mobi_pls <- estimate_pls(data = mobi,
measurement_model = mobi_mm,
structural_model = mobi_sm)
summary(mobi_pls)
# Plot the model
plot(mobi_pls)
# Bootstrap the model
boot_mobi_pls <- bootstrap_model(seminr_model = mobi_pls,
nboot = 500)
summary(boot_mobi_pls)
# Plot the bootstrapped model
plot(boot_mobi_pls)