Load the library

library(seminr)
## Warning: package 'seminr' was built under R version 4.2.3

Load the Data

df <- read.csv(file = "C:\\Users\\user\\Documents\\Masters Thesis\\response_data.csv", header = TRUE, sep = ",")
head(df)
##   ID      Age Country                 Industry Gender Education Marital_Status
## 1  1 18 to 24  Russia Energy/Natural Resources      1         2              1
## 2  2 18 to 24  Russia                Education      1         2              1
## 3  3 25 to 34   Kenya            IT/Technology      2         2              1
## 4  4 25 to 34  Russia       Financial Services      2         2              1
## 5  5 18 to 24  Russia          Human Resources      1         2              1
## 6  6 35 to 44   Kenya            IT/Technology      2         2              2
##   Experience Work_Arrangement Tenure F1 F2 F3 LB TD1 TD2 TD3 TD4 TD5 TD4.1 TD7
## 1          1                1      1  4  3  3  4   4   2   4   4   4     4   4
## 2          2                2      3  5  4  3  5   4   4   4   4   4     4   4
## 3          2                2      2  5  5  5  5   4   5   5   1   1     1   1
## 4          2                3      1  2  3  2  4   4   4   4   2   3     4   2
## 5          2                2      2  5  4  5  5   3   3   4   5   4     5   3
## 6         12                2      1  4  5  5  3   5   5   4   5   4     4   4
##   PD1 PD2 PD3 PD4 EH1 EH2 EH3 EH4 RH1 RH2 RH3 RH4
## 1   2   2   3   2   1   2   2   1   4   4   4   4
## 2   2   1   2   2   1   3   1   3   3   3   3   1
## 3   2   2   2   2   2   2   2   2   2   2   2   2
## 4   2   4   3   2   3   2   2   2   4   2   2   2
## 5   1   1   3   1   1   1   1   3   1   4   3   1
## 6   3   2   3   3   4   3   3   2   2   4   3   2

Create measurement model

simple_mm <- constructs(
  composite("Flexibility", multi_items("F", 1:3)),
  composite("Playing Dumb", multi_items("PD", 1:4)),
  composite("Evasive Hiding", multi_items("EH", 1:4)),
  composite("Rationalized Hiding", multi_items("RH", 1:4))
)

Create structural model

simple_sm <- relationships(
  paths(from = "Flexibility", to = "Playing Dumb"),
  paths(from = "Flexibility", to = "Evasive Hiding"),
  paths(from = "Flexibility", to = "Rationalized Hiding")
)

Estimate the model

simple_model <- estimate_pls(data = df,
                             measurement_model = simple_mm,
                             structural_model = simple_sm,
                             missing = mean_replacement,
                             missing_value = "-99")
## Generating the seminr model
## All 250 observations are valid.

Summarize the model results

summary_simple <- summary(simple_model)

#Descriptive Stattistics Summary

summary_simple$descriptives$statistics 
## $items
##        No. Missing  Mean Median   Min   Max Std.Dev. Kurtosis Skewness
## F1   1.000   0.000 2.964  3.000 1.000 5.000    1.484    1.601    0.025
## F2   2.000   0.000 3.200  3.000 1.000 5.000    1.296    1.892   -0.164
## F3   3.000   0.000 3.180  3.000 1.000 5.000    1.234    2.076   -0.152
## PD1  4.000   0.000 2.084  2.000 1.000 5.000    1.036    2.985    0.831
## PD2  5.000   0.000 1.852  2.000 1.000 5.000    0.939    3.918    1.144
## PD3  6.000   0.000 2.492  3.000 1.000 5.000    1.091    2.191    0.178
## PD4  7.000   0.000 1.860  2.000 1.000 5.000    0.901    3.510    1.005
## EH1  8.000   0.000 1.888  2.000 1.000 5.000    0.950    3.684    1.069
## EH2  9.000   0.000 1.840  2.000 1.000 5.000    0.952    4.070    1.191
## EH3 10.000   0.000 1.740  2.000 1.000 5.000    0.878    4.306    1.243
## EH4 11.000   0.000 1.748  2.000 1.000 5.000    0.862    4.786    1.337
## RH1 12.000   0.000 2.216  2.000 1.000 5.000    1.116    2.300    0.591
## RH2 13.000   0.000 2.396  2.000 1.000 5.000    1.189    2.029    0.378
## RH3 14.000   0.000 2.276  2.000 1.000 5.000    1.134    2.005    0.406
## RH4 15.000   0.000 1.964  2.000 1.000 5.000    1.019    2.922    0.870
## 
## $constructs
##                       No. Missing   Mean Median    Min   Max Std.Dev. Kurtosis
## Flexibility         1.000   0.000 -0.000  0.026 -2.003 1.728    1.000    2.305
## Playing Dumb        2.000   0.000 -0.000  0.017 -1.270 3.480    1.000    3.367
## Evasive Hiding      3.000   0.000 -0.000 -0.008 -0.982 3.590    1.000    4.142
## Rationalized Hiding 4.000   0.000  0.000 -0.145 -1.264 2.728    1.000    2.531
##                     Skewness
## Flexibility           -0.054
## Playing Dumb           0.762
## Evasive Hiding         1.125
## Rationalized Hiding    0.491

Iterations to converge

summary_simple$iterations
## [1] 17

Collinearity analysis

summary_simple$validity$vif_items
## Flexibility :
##    F1    F2    F3 
## 1.533 1.623 1.373 
## 
## Playing Dumb :
##   PD1   PD2   PD3   PD4 
## 1.653 1.723 1.347 1.672 
## 
## Evasive Hiding :
##   EH1   EH2   EH3   EH4 
## 1.875 3.238 3.360 3.008 
## 
## Rationalized Hiding :
##   RH1   RH2   RH3   RH4 
## 1.686 2.199 2.470 1.590

Inspect the Indicator Reliability

#Inspect the indicators loadings
summary_simple$loadings
##     Flexibility Playing Dumb Evasive Hiding Rationalized Hiding
## F1        0.699        0.000         -0.000               0.000
## F2        0.761        0.000          0.000               0.000
## F3        0.909        0.000          0.000               0.000
## PD1       0.000        0.822          0.000               0.000
## PD2       0.000        0.839          0.000               0.000
## PD3       0.000        0.613          0.000               0.000
## PD4       0.000        0.821          0.000               0.000
## EH1       0.000        0.000          0.723               0.000
## EH2       0.000        0.000          0.910               0.000
## EH3       0.000        0.000          0.903               0.000
## EH4       0.000        0.000          0.921               0.000
## RH1       0.000        0.000          0.000               0.739
## RH2       0.000        0.000          0.000               0.730
## RH3       0.000        0.000          0.000               0.814
## RH4       0.000        0.000          0.000               0.891
# Inspect the indicator reliability
summary_simple$loadings^2
##     Flexibility Playing Dumb Evasive Hiding Rationalized Hiding
## F1        0.489        0.000          0.000               0.000
## F2        0.579        0.000          0.000               0.000
## F3        0.826        0.000          0.000               0.000
## PD1       0.000        0.675          0.000               0.000
## PD2       0.000        0.704          0.000               0.000
## PD3       0.000        0.376          0.000               0.000
## PD4       0.000        0.673          0.000               0.000
## EH1       0.000        0.000          0.522               0.000
## EH2       0.000        0.000          0.829               0.000
## EH3       0.000        0.000          0.815               0.000
## EH4       0.000        0.000          0.848               0.000
## RH1       0.000        0.000          0.000               0.546
## RH2       0.000        0.000          0.000               0.532
## RH3       0.000        0.000          0.000               0.663
## RH4       0.000        0.000          0.000               0.794

Inspect the composite reliability (Covergent Validity)

summary_simple$reliability
##                     alpha  rhoC   AVE  rhoA
## Flexibility         0.744 0.835 0.631 0.985
## Playing Dumb        0.789 0.859 0.607 0.825
## Evasive Hiding      0.894 0.924 0.754 0.980
## Rationalized Hiding 0.830 0.873 0.634 1.075
## 
## Alpha, rhoC, and rhoA should exceed 0.7 while AVE should exceed 0.5

Plot the reliabilities of constructs

plot(summary_simple$reliability)

# Measurement Model (Discriminant Validity)

# Table of FL Criteria
summary_simple$validity$fl_criteria
##                     Flexibility Playing Dumb Evasive Hiding Rationalized Hiding
## Flexibility               0.795            .              .                   .
## Playing Dumb              0.171        0.779              .                   .
## Evasive Hiding            0.078        0.746          0.868                   .
## Rationalized Hiding       0.125        0.609          0.607               0.796
## 
## FL Criteria table reports square root of AVE on the diagonal and construct correlations on the lower triangle.
#HTMT Criteria
summary_simple$validity$htmt
##                     Flexibility Playing Dumb Evasive Hiding Rationalized Hiding
## Flexibility                   .            .              .                   .
## Playing Dumb              0.203            .              .                   .
## Evasive Hiding            0.077        0.916              .                   .
## Rationalized Hiding       0.134        0.762          0.709                   .

Cross Loadings for Assessment of Discriminant Validity

summary_simple$validity$cross_loadings
##     Flexibility Playing Dumb Evasive Hiding Rationalized Hiding
## F1        0.699        0.105         -0.019               0.039
## F2        0.761        0.132          0.028               0.019
## F3        0.909        0.160          0.113               0.168
## PD1       0.146        0.822          0.533               0.456
## PD2       0.152        0.839          0.636               0.525
## PD3       0.061        0.613          0.538               0.485
## PD4       0.144        0.821          0.649               0.483
## EH1       0.029        0.664          0.723               0.470
## EH2       0.073        0.662          0.910               0.564
## EH3       0.055        0.678          0.903               0.543
## EH4       0.089        0.658          0.921               0.543
## RH1       0.051        0.492          0.547               0.739
## RH2       0.047        0.436          0.401               0.730
## RH3       0.079        0.519          0.547               0.814
## RH4       0.151        0.520          0.494               0.891

Inspect the model RSquares

summary_simple$paths
##             Playing Dumb Evasive Hiding Rationalized Hiding
## R^2                0.029          0.006               0.016
## AdjR^2             0.025          0.002               0.012
## Flexibility        0.171          0.078               0.125

Inspect the effect sizes

summary_simple$fSquare
##                     Flexibility Playing Dumb Evasive Hiding Rationalized Hiding
## Flexibility               0.000        0.030          0.006               0.016
## Playing Dumb              0.000        0.000          0.000               0.000
## Evasive Hiding            0.000        0.000          0.000               0.000
## Rationalized Hiding       0.000        0.000          0.000               0.000

BOOTSTRAP THE MODEL FOR HTMT ON THE PLS ESTIMATED MODEL

boot_model <- bootstrap_model(
  seminr_model = simple_model,
  nboot = 1000,
  cores = parallel::detectCores(),
  seed = 123
)
## Bootstrapping model using seminr...
## SEMinR Model successfully bootstrapped

Bootstrapped HTMT

# alpha sets the specified level for significance, i.e. 0.10/0.05
summary_boot <- summary(boot_model, alpha = 0.05)
# Inspect the structural paths
summary_boot$bootstrapped_HTMT
##                                         Original Est. Bootstrap Mean
## Flexibility  ->  Playing Dumb                   0.203          0.214
## Flexibility  ->  Evasive Hiding                 0.077          0.122
## Flexibility  ->  Rationalized Hiding            0.134          0.168
## Playing Dumb  ->  Evasive Hiding                0.916          0.919
## Playing Dumb  ->  Rationalized Hiding           0.762          0.762
## Evasive Hiding  ->  Rationalized Hiding         0.709          0.709
##                                         Bootstrap SD T Stat. 2.5% CI 97.5% CI
## Flexibility  ->  Playing Dumb                  0.071   2.873   0.095    0.363
## Flexibility  ->  Evasive Hiding                0.041   1.879   0.058    0.216
## Flexibility  ->  Rationalized Hiding           0.041   3.280   0.095    0.257
## Playing Dumb  ->  Evasive Hiding               0.028  32.171   0.862    0.972
## Playing Dumb  ->  Rationalized Hiding          0.048  15.976   0.666    0.852
## Evasive Hiding  ->  Rationalized Hiding        0.048  14.676   0.608    0.797
# Inspect the total effects
summary_boot$bootstrapped_paths
##                                      Original Est. Bootstrap Mean Bootstrap SD
## Flexibility  ->  Playing Dumb                0.171          0.193        0.065
## Flexibility  ->  Evasive Hiding              0.078          0.066        0.117
## Flexibility  ->  Rationalized Hiding         0.125          0.120        0.132
##                                      T Stat. 2.5% CI 97.5% CI
## Flexibility  ->  Playing Dumb          2.637   0.077    0.314
## Flexibility  ->  Evasive Hiding        0.666  -0.200    0.221
## Flexibility  ->  Rationalized Hiding   0.950  -0.239    0.261
# Inspect the bootstrapping results for indicator weights
summary_boot$bootstrapped_weights
##                              Original Est. Bootstrap Mean Bootstrap SD T Stat.
## F1  ->  Flexibility                  0.243          0.277        0.182   1.331
## F2  ->  Flexibility                  0.310          0.334        0.238   1.302
## F3  ->  Flexibility                  0.654          0.520        0.337   1.939
## PD1  ->  Playing Dumb                0.362          0.323        0.194   1.866
## PD2  ->  Playing Dumb                0.377          0.334        0.215   1.752
## PD3  ->  Playing Dumb                0.152          0.152        0.227   0.669
## PD4  ->  Playing Dumb                0.358          0.340        0.173   2.071
## EH1  ->  Evasive Hiding              0.131          0.156        0.296   0.443
## EH2  ->  Evasive Hiding              0.333          0.241        0.265   1.255
## EH3  ->  Evasive Hiding              0.253          0.223        0.287   0.884
## EH4  ->  Evasive Hiding              0.405          0.264        0.325   1.249
## RH1  ->  Rationalized Hiding         0.188          0.192        0.184   1.020
## RH2  ->  Rationalized Hiding         0.175          0.164        0.296   0.589
## RH3  ->  Rationalized Hiding         0.290          0.255        0.211   1.376
## RH4  ->  Rationalized Hiding         0.558          0.417        0.332   1.681
##                              2.5% CI 97.5% CI
## F1  ->  Flexibility           -0.187    0.560
## F2  ->  Flexibility           -0.278    0.753
## F3  ->  Flexibility           -0.443    1.049
## PD1  ->  Playing Dumb         -0.214    0.598
## PD2  ->  Playing Dumb         -0.382    0.621
## PD3  ->  Playing Dumb         -0.389    0.568
## PD4  ->  Playing Dumb         -0.102    0.643
## EH1  ->  Evasive Hiding       -0.475    0.906
## EH2  ->  Evasive Hiding       -0.476    0.601
## EH3  ->  Evasive Hiding       -0.527    0.720
## EH4  ->  Evasive Hiding       -0.634    0.706
## RH1  ->  Rationalized Hiding  -0.259    0.495
## RH2  ->  Rationalized Hiding  -0.659    0.658
## RH3  ->  Rationalized Hiding  -0.405    0.501
## RH4  ->  Rationalized Hiding  -0.463    0.956
summary_boot$bootstrapped_loadings
##                              Original Est. Bootstrap Mean Bootstrap SD T Stat.
## F1  ->  Flexibility                  0.699          0.687        0.195   3.590
## F2  ->  Flexibility                  0.761          0.738        0.207   3.671
## F3  ->  Flexibility                  0.909          0.804        0.248   3.670
## PD1  ->  Playing Dumb                0.822          0.746        0.261   3.146
## PD2  ->  Playing Dumb                0.839          0.763        0.272   3.090
## PD3  ->  Playing Dumb                0.613          0.569        0.239   2.567
## PD4  ->  Playing Dumb                0.821          0.759        0.247   3.321
## EH1  ->  Evasive Hiding              0.723          0.588        0.400   1.805
## EH2  ->  Evasive Hiding              0.910          0.706        0.504   1.804
## EH3  ->  Evasive Hiding              0.903          0.702        0.519   1.740
## EH4  ->  Evasive Hiding              0.921          0.702        0.522   1.763
## RH1  ->  Rationalized Hiding         0.739          0.642        0.316   2.340
## RH2  ->  Rationalized Hiding         0.730          0.629        0.404   1.807
## RH3  ->  Rationalized Hiding         0.814          0.698        0.390   2.087
## RH4  ->  Rationalized Hiding         0.891          0.731        0.343   2.598
##                              2.5% CI 97.5% CI
## F1  ->  Flexibility            0.095    0.879
## F2  ->  Flexibility            0.156    0.939
## F3  ->  Flexibility            0.059    0.989
## PD1  ->  Playing Dumb         -0.236    0.907
## PD2  ->  Playing Dumb         -0.296    0.917
## PD3  ->  Playing Dumb         -0.170    0.812
## PD4  ->  Playing Dumb         -0.269    0.914
## EH1  ->  Evasive Hiding       -0.699    0.944
## EH2  ->  Evasive Hiding       -0.905    0.951
## EH3  ->  Evasive Hiding       -0.921    0.958
## EH4  ->  Evasive Hiding       -0.929    0.959
## RH1  ->  Rationalized Hiding  -0.672    0.858
## RH2  ->  Rationalized Hiding  -0.864    0.928
## RH3  ->  Rationalized Hiding  -0.833    0.919
## RH4  ->  Rationalized Hiding  -0.571    0.971
plot(simple_model)

Generate the Model predictions based on PLS Estimate

predict_model <- predict_pls(
  model = simple_model,
  technique = predict_DA,
  noFolds = 10,
  reps = 10)

Summarize the Prediction results

summary_predict <- summary(predict_model)

Analyze the distribution of prediction error

par(mfrow=c(1,4))
plot(summary_predict,
     indicator = "PD1")
plot(summary_predict,
     indicator = "PD2")
plot(summary_predict,
     indicator = "PD3")
plot(summary_predict,
     indicator = "PD4")

par(mfrow=c(1,1))

par(mfrow=c(1,4))
plot(summary_predict,
     indicator = "EH1")
plot(summary_predict,
     indicator = "EH2")
plot(summary_predict,
     indicator = "EH3")
plot(summary_predict,
     indicator = "EH4")

par(mfrow=c(1,1))

par(mfrow=c(1,4))
plot(summary_predict,
     indicator = "RH1")
plot(summary_predict,
     indicator = "RH2")
plot(summary_predict,
     indicator = "RH3")
plot(summary_predict,
     indicator = "RH4")

par(mfrow=c(1,1))

Compute the prediction statistics

summary_predict
## 
## PLS in-sample metrics:
##        PD1   PD2   PD3   PD4   EH1   EH2   EH3   EH4   RH1   RH2   RH3   RH4
## RMSE 1.022 0.925 1.087 0.889 0.948 0.946 0.874 0.856 1.113 1.185 1.127 1.005
## MAE  0.782 0.705 0.941 0.678 0.716 0.725 0.699 0.661 0.919 1.029 0.970 0.791
## 
## PLS out-of-sample metrics:
##        PD1   PD2   PD3   PD4   EH1   EH2   EH3   EH4   RH1   RH2   RH3   RH4
## RMSE 1.033 0.939 1.099 0.899 0.956 0.958 0.885 0.868 1.126 1.198 1.141 1.018
## MAE  0.789 0.720 0.949 0.688 0.724 0.734 0.709 0.672 0.927 1.040 0.983 0.804
## 
## LM in-sample metrics:
##        PD1   PD2   PD3   PD4   EH1   EH2   EH3   EH4   RH1   RH2   RH3   RH4
## RMSE 0.833 0.660 0.860 0.642 0.667 0.648 0.595 0.599 0.890 1.017 0.898 0.832
## MAE  0.626 0.469 0.689 0.446 0.466 0.457 0.435 0.420 0.677 0.833 0.722 0.604
## 
## LM out-of-sample metrics:
##        PD1   PD2   PD3   PD4   EH1   EH2   EH3   EH4   RH1   RH2   RH3   RH4
## RMSE 0.885 0.711 0.931 0.698 0.728 0.701 0.634 0.654 0.964 1.070 0.961 0.901
## MAE  0.661 0.500 0.740 0.480 0.503 0.483 0.464 0.455 0.729 0.873 0.772 0.652