-
Notifications
You must be signed in to change notification settings - Fork 21
/
seminr-pls-higher_order.R
148 lines (123 loc) · 5.42 KB
/
seminr-pls-higher_order.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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# Demonstration of a higher-order construct with lower order constructs
library(seminr)
# Currently only the two_stage solution is implemented.
# Reflective - Reflective type Higher Order Construct ----
# Creating measurement mode
# - note: composite() has a default parameter setting of mode A
# - note: items can be a list of names: c("CUEX1", "CUEX2", "CUEX3")
# which can be constructed quickly as: multi_items("CUEX", 1:3)
mobi_mm <- constructs(
composite("Image", multi_items("IMAG", 1:5)),
composite("Expectation", multi_items("CUEX", 1:3)),
composite("Quality", multi_items("PERQ", 1:7)),
composite("Value", multi_items("PERV", 1:2)),
higher_composite("Satisfaction", dimensions = c("Image","Value"), method = two_stage, weights = mode_A),
composite("Complaints", single_item("CUSCO")),
composite("Loyalty", multi_items("CUSL", 1:3))
)
# Creating structural model
# - note, multiple paths can be created in each line
mobi_sm <- relationships(
paths(from = c("Expectation","Quality"), to = "Satisfaction"),
paths(from = "Satisfaction", to = c("Complaints", "Loyalty"))
)
# Estimate the model with the HOC
mobi_pls <- estimate_pls(data = mobi,
measurement_model = mobi_mm,
structural_model = mobi_sm)
# Plot the model
plot(mobi_pls)
# Bootstrap the model
boot_mobi_pls <- bootstrap_model(mobi_pls, nboot = 1000)
# Pot the bootstrapped model
plot(boot_mobi_pls)
# Reflective - Formative type Higher Order Construct ----
# Creating measurement mode
# - note: composite() has a default parameter setting of mode A
# - note: items can be a list of names: c("CUEX1", "CUEX2", "CUEX3")
# which can be constructed quickly as: multi_items("CUEX", 1:3)
mobi_mm <- constructs(
composite("Image", multi_items("IMAG", 1:5), weights = mode_B),
composite("Expectation", multi_items("CUEX", 1:3)),
composite("Quality", multi_items("PERQ", 1:7)),
composite("Value", multi_items("PERV", 1:2), weights = mode_B),
higher_composite("Satisfaction", dimensions = c("Image","Value"), method = two_stage, weights = mode_A),
composite("Complaints", single_item("CUSCO")),
composite("Loyalty", multi_items("CUSL", 1:3))
)
# Creating structural model
# - note, multiple paths can be created in each line
mobi_sm <- relationships(
paths(from = c("Expectation","Quality"), to = "Satisfaction"),
paths(from = "Satisfaction", to = c("Complaints", "Loyalty"))
)
# Estimate the model with the HOC
mobi_pls <- estimate_pls(data = mobi,
measurement_model = mobi_mm,
structural_model = mobi_sm)
# Plot the model
plot(mobi_pls)
# Bootstrap the model
boot_mobi_pls <- bootstrap_model(mobi_pls, nboot = 1000)
# Pot the bootstrapped model
plot(boot_mobi_pls)
# Formative - Reflective type Higher Order Construct ----
# Creating measurement mode
# - note: composite() has a default parameter setting of mode A
# - note: items can be a list of names: c("CUEX1", "CUEX2", "CUEX3")
# which can be constructed quickly as: multi_items("CUEX", 1:3)
mobi_mm <- constructs(
composite("Image", multi_items("IMAG", 1:5)),
composite("Expectation", multi_items("CUEX", 1:3)),
composite("Quality", multi_items("PERQ", 1:7)),
composite("Value", multi_items("PERV", 1:2)),
higher_composite("Satisfaction", dimensions = c("Image","Value"), method = two_stage, weights = mode_B),
composite("Complaints", single_item("CUSCO")),
composite("Loyalty", multi_items("CUSL", 1:3))
)
# Creating structural model
# - note, multiple paths can be created in each line
mobi_sm <- relationships(
paths(from = c("Expectation","Quality"), to = "Satisfaction"),
paths(from = "Satisfaction", to = c("Complaints", "Loyalty"))
)
# Estimate the model with the HOC
mobi_pls <- estimate_pls(data = mobi,
measurement_model = mobi_mm,
structural_model = mobi_sm)
# Plot the model
plot(mobi_pls)
# Bootstrap the model
boot_mobi_pls <- bootstrap_model(mobi_pls, nboot = 1000)
# Pot the bootstrapped model
plot(boot_mobi_pls)
# Formative - Formative type Higher Order Construct ----
# Creating measurement mode
# - note: composite() has a default parameter setting of mode A
# - note: items can be a list of names: c("CUEX1", "CUEX2", "CUEX3")
# which can be constructed quickly as: multi_items("CUEX", 1:3)
mobi_mm <- constructs(
composite("Image", multi_items("IMAG", 1:5), weights = mode_B),
composite("Expectation", multi_items("CUEX", 1:3)),
composite("Quality", multi_items("PERQ", 1:7)),
composite("Value", multi_items("PERV", 1:2), weights = mode_B),
higher_composite("Satisfaction", dimensions = c("Image","Value"), method = two_stage, weights = mode_B),
composite("Complaints", single_item("CUSCO")),
composite("Loyalty", multi_items("CUSL", 1:3))
)
# Creating structural model
# - note, multiple paths can be created in each line
mobi_sm <- relationships(
paths(from = c("Expectation","Quality"), to = "Satisfaction"),
paths(from = "Satisfaction", to = c("Complaints", "Loyalty"))
)
# Estimate the model with the HOC
mobi_pls <- estimate_pls(data = mobi,
measurement_model = mobi_mm,
structural_model = mobi_sm)
# Plot the model
plot(mobi_pls)
# Bootstrap the model
boot_mobi_pls <- bootstrap_model(mobi_pls, nboot = 1000)
# Pot the bootstrapped model
plot(boot_mobi_pls)