-
Notifications
You must be signed in to change notification settings - Fork 21
/
seminr-pls-ecsi.R
68 lines (57 loc) · 2.58 KB
/
seminr-pls-ecsi.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
# Simple Style: Seperate declaration of measurement and structural model, no interactions.
library(seminr)
# 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)),
composite("Satisfaction", multi_items("CUSA", 1:3)),
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 = "Image", to = c("Expectation", "Satisfaction", "Loyalty")),
paths(from = "Expectation", to = c("Quality", "Value", "Satisfaction")),
paths(from = "Quality", to = c("Value", "Satisfaction")),
paths(from = "Value", to = c("Satisfaction")),
paths(from = "Satisfaction", to = c("Complaints", "Loyalty")),
paths(from = "Complaints", to = "Loyalty")
)
# Estimating the model
# - note, the mobi dataset is bundled with seminr
mobi_pls <- estimate_pls(data = mobi,
measurement_model = mobi_mm,
structural_model = mobi_sm)
# Plot the model
plot(mobi_pls)
# Reporting the results
summary(mobi_pls)
plot_scores(mobi_pls)
# Getting more detailed output from estimated model:
loadings <- mobi_pls$outer_loadings
# Bootstrap the model
boot_mobi_pls <- bootstrap_model(seminr_model = mobi_pls, nboot = 1000)
summary(boot_mobi_pls)
# Plot the bootstrapped model
plot(boot_mobi_pls)
# note that Unit weighting can also be used:
mobi_mm <- constructs(
composite("Image", multi_items("IMAG", 1:5), weights = unit_weights),
composite("Expectation", multi_items("CUEX", 1:3), weights = unit_weights),
composite("Quality", multi_items("PERQ", 1:7), weights = unit_weights),
composite("Value", multi_items("PERV", 1:2), weights = unit_weights),
composite("Satisfaction", multi_items("CUSA", 1:3), weights = unit_weights),
composite("Complaints", single_item("CUSCO")),
composite("Loyalty", multi_items("CUSL", 1:3), weights = unit_weights)
)
# Estimating the model
# - note, the mobi dataset is bundled with seminr
mobi_pls <- estimate_pls(data = mobi,
measurement_model = mobi_mm,
structural_model = mobi_sm)