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), weights = mode_B),
  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.020 -2.284 2.199    1.000    2.205
## Playing Dumb        2.000   0.000 -0.000  0.079 -1.169 3.476    1.000    3.394
## Evasive Hiding      3.000   0.000 -0.000 -0.069 -0.962 3.769    1.000    4.251
## Rationalized Hiding 4.000   0.000  0.000 -0.124 -1.323 2.567    1.000    2.275
##                     Skewness
## Flexibility           -0.196
## Playing Dumb           0.830
## Evasive Hiding         1.156
## Rationalized Hiding    0.312

Iterations to converge

summary_simple$iterations
## [1] 24

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.246        0.000         -0.000               0.000
## F2        0.250        0.000          0.000              -0.000
## F3        0.965        0.000          0.000               0.000
## PD1       0.000        0.845          0.000               0.000
## PD2       0.000        0.865          0.000               0.000
## PD3       0.000        0.511          0.000               0.000
## PD4       0.000        0.786          0.000               0.000
## EH1       0.000        0.000          0.686               0.000
## EH2       0.000        0.000          0.907               0.000
## EH3       0.000        0.000          0.926               0.000
## EH4       0.000        0.000          0.915               0.000
## RH1       0.000        0.000          0.000               0.743
## RH2       0.000        0.000          0.000               0.843
## RH3       0.000        0.000          0.000               0.879
## RH4       0.000        0.000          0.000               0.778
# Inspect the indicator reliability
summary_simple$loadings^2
##     Flexibility Playing Dumb Evasive Hiding Rationalized Hiding
## F1        0.061        0.000          0.000               0.000
## F2        0.062        0.000          0.000               0.000
## F3        0.931        0.000          0.000               0.000
## PD1       0.000        0.714          0.000               0.000
## PD2       0.000        0.748          0.000               0.000
## PD3       0.000        0.261          0.000               0.000
## PD4       0.000        0.618          0.000               0.000
## EH1       0.000        0.000          0.471               0.000
## EH2       0.000        0.000          0.822               0.000
## EH3       0.000        0.000          0.857               0.000
## EH4       0.000        0.000          0.838               0.000
## RH1       0.000        0.000          0.000               0.551
## RH2       0.000        0.000          0.000               0.710
## RH3       0.000        0.000          0.000               0.773
## RH4       0.000        0.000          0.000               0.606

Inspect the composite reliability (Covergent Validity)

summary_simple$reliability
##                     alpha  rhoC   AVE  rhoA
## Flexibility         0.744 0.523 0.351 1.000
## Playing Dumb        0.789 0.845 0.586 0.813
## Evasive Hiding      0.894 0.921 0.747 0.940
## Rationalized Hiding 0.830 0.886 0.660 0.850
## 
## 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.593            .              .                   .
## Playing Dumb              0.151        0.765              .                   .
## Evasive Hiding            0.128        0.714          0.864                   .
## Rationalized Hiding       0.182        0.582          0.597               0.812
## 
## 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.246        0.108         -0.023               0.024
## F2        0.250        0.124          0.023              -0.020
## F3        0.965        0.170          0.116               0.160
## PD1       0.133        0.845          0.531               0.458
## PD2       0.142        0.865          0.623               0.521
## PD3       0.005        0.511          0.534               0.464
## PD4       0.098        0.786          0.643               0.469
## EH1       0.022        0.647          0.686               0.461
## EH2       0.117        0.636          0.907               0.565
## EH3       0.121        0.657          0.926               0.533
## EH4       0.124        0.640          0.915               0.534
## RH1       0.092        0.465          0.546               0.743
## RH2       0.159        0.430          0.397               0.843
## RH3       0.162        0.508          0.547               0.879
## RH4       0.158        0.497          0.490               0.778

Inspect the model RSquares

summary_simple$paths
##             Playing Dumb Evasive Hiding Rationalized Hiding
## R^2                0.023          0.016               0.033
## AdjR^2             0.019          0.012               0.029
## Flexibility        0.151          0.128               0.182

Inspect the effect sizes

summary_simple$fSquare
##                     Flexibility Playing Dumb Evasive Hiding Rationalized Hiding
## Flexibility               0.000        0.023          0.017               0.034
## 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.151          0.190        0.081
## Flexibility  ->  Evasive Hiding              0.128          0.102        0.143
## Flexibility  ->  Rationalized Hiding         0.182          0.155        0.157
##                                      T Stat. 2.5% CI 97.5% CI
## Flexibility  ->  Playing Dumb          1.856  -0.053    0.312
## Flexibility  ->  Evasive Hiding        0.893  -0.221    0.275
## Flexibility  ->  Rationalized Hiding   1.154  -0.272    0.309
# Inspect the bootstrapping results for indicator weights
summary_boot$bootstrapped_weights
##                              Original Est. Bootstrap Mean Bootstrap SD T Stat.
## F1  ->  Flexibility                 -0.113         -0.022        0.383  -0.294
## F2  ->  Flexibility                 -0.230          0.013        0.610  -0.377
## F3  ->  Flexibility                  1.125          0.649        0.683   1.645
## PD1  ->  Playing Dumb                0.422          0.302        0.306   1.378
## PD2  ->  Playing Dumb                0.451          0.337        0.276   1.635
## PD3  ->  Playing Dumb                0.015          0.087        0.336   0.045
## PD4  ->  Playing Dumb                0.312          0.265        0.224   1.392
## EH1  ->  Evasive Hiding              0.065          0.091        0.281   0.231
## EH2  ->  Evasive Hiding              0.337          0.236        0.273   1.234
## EH3  ->  Evasive Hiding              0.349          0.246        0.280   1.244
## EH4  ->  Evasive Hiding              0.358          0.247        0.264   1.355
## RH1  ->  Rationalized Hiding         0.196          0.187        0.147   1.337
## RH2  ->  Rationalized Hiding         0.341          0.254        0.287   1.190
## RH3  ->  Rationalized Hiding         0.347          0.282        0.201   1.722
## RH4  ->  Rationalized Hiding         0.337          0.300        0.207   1.631
##                              2.5% CI 97.5% CI
## F1  ->  Flexibility           -0.722    0.742
## F2  ->  Flexibility           -1.027    1.181
## F3  ->  Flexibility           -1.044    1.184
## PD1  ->  Playing Dumb         -0.615    0.749
## PD2  ->  Playing Dumb         -0.554    0.734
## PD3  ->  Playing Dumb         -0.851    0.760
## PD4  ->  Playing Dumb         -0.375    0.590
## EH1  ->  Evasive Hiding       -0.663    0.574
## EH2  ->  Evasive Hiding       -0.482    0.551
## EH3  ->  Evasive Hiding       -0.551    0.623
## EH4  ->  Evasive Hiding       -0.482    0.563
## RH1  ->  Rationalized Hiding  -0.261    0.386
## RH2  ->  Rationalized Hiding  -0.667    0.564
## RH3  ->  Rationalized Hiding  -0.410    0.455
## RH4  ->  Rationalized Hiding  -0.200    0.707
summary_boot$bootstrapped_loadings
##                              Original Est. Bootstrap Mean Bootstrap SD T Stat.
## F1  ->  Flexibility                  0.246          0.266        0.292   0.843
## F2  ->  Flexibility                  0.250          0.314        0.379   0.659
## F3  ->  Flexibility                  0.965          0.650        0.469   2.058
## PD1  ->  Playing Dumb                0.845          0.662        0.405   2.088
## PD2  ->  Playing Dumb                0.865          0.689        0.408   2.120
## PD3  ->  Playing Dumb                0.511          0.465        0.367   1.394
## PD4  ->  Playing Dumb                0.786          0.645        0.383   2.051
## EH1  ->  Evasive Hiding              0.686          0.522        0.468   1.467
## EH2  ->  Evasive Hiding              0.907          0.662        0.574   1.579
## EH3  ->  Evasive Hiding              0.926          0.674        0.585   1.583
## EH4  ->  Evasive Hiding              0.915          0.665        0.577   1.587
## RH1  ->  Rationalized Hiding         0.743          0.634        0.372   1.997
## RH2  ->  Rationalized Hiding         0.843          0.686        0.470   1.793
## RH3  ->  Rationalized Hiding         0.879          0.727        0.458   1.921
## RH4  ->  Rationalized Hiding         0.778          0.664        0.355   2.193
##                              2.5% CI 97.5% CI
## F1  ->  Flexibility           -0.312    0.793
## F2  ->  Flexibility           -0.466    0.934
## F3  ->  Flexibility           -0.613    0.994
## PD1  ->  Playing Dumb         -0.773    0.930
## PD2  ->  Playing Dumb         -0.810    0.923
## PD3  ->  Playing Dumb         -0.727    0.871
## PD4  ->  Playing Dumb         -0.632    0.893
## EH1  ->  Evasive Hiding       -0.806    0.900
## EH2  ->  Evasive Hiding       -0.927    0.953
## EH3  ->  Evasive Hiding       -0.943    0.959
## EH4  ->  Evasive Hiding       -0.923    0.947
## RH1  ->  Rationalized Hiding  -0.739    0.846
## RH2  ->  Rationalized Hiding  -0.918    0.931
## RH3  ->  Rationalized Hiding  -0.891    0.929
## RH4  ->  Rationalized Hiding  -0.676    0.924
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.023 0.926 1.090 0.894 0.949 0.942 0.869 0.853 1.110 1.169 1.115 1.003
## MAE  0.780 0.705 0.945 0.682 0.717 0.720 0.694 0.657 0.915 1.005 0.952 0.794
## 
## PLS out-of-sample metrics:
##        PD1   PD2   PD3   PD4   EH1   EH2   EH3   EH4   RH1   RH2   RH3   RH4
## RMSE 1.037 0.937 1.103 0.902 0.960 0.956 0.879 0.860 1.119 1.188 1.130 1.020
## MAE  0.790 0.714 0.955 0.691 0.727 0.735 0.704 0.665 0.922 1.021 0.966 0.811
## 
## LM in-sample metrics:
##        PD1   PD2   PD3   PD4   EH1   EH2   EH3   EH4   RH1   RH2   RH3   RH4
## RMSE 0.832 0.661 0.859 0.642 0.667 0.647 0.594 0.600 0.890 1.015 0.899 0.831
## MAE  0.626 0.469 0.689 0.446 0.467 0.455 0.434 0.421 0.677 0.832 0.723 0.604
## 
## LM out-of-sample metrics:
##        PD1   PD2   PD3   PD4   EH1   EH2   EH3   EH4   RH1   RH2   RH3   RH4
## RMSE 0.893 0.704 0.936 0.705 0.722 0.706 0.641 0.644 0.962 1.091 0.953 0.911
## MAE  0.666 0.500 0.741 0.486 0.497 0.495 0.469 0.449 0.730 0.885 0.767 0.656