Functions

The functions to be used for the SDID and SC Estimates were created.

df <- read.csv("All Modules Duration Merged.csv")

Models used

# Model 1: Equal variances, covariances = 0
# Model 2: Unequal variances, covariances = 0
# Model 3: Equal variances, equal covariances
# Model 6: Unequal variances, unequal covariances

Estimating the best number of classes using Model 1

From the estimation below, the result shows the Model 1 with 6 Classes is the best fit, but as observed in the result there is a warning from class 4 to class 6.

df1 <- df %>%
    select(learnhpv_duration, learnvac_duration, getvac_duration, getans_duration) %>%
    single_imputation() %>%
    scale() %>%
    estimate_profiles(1:6)
df1
## tidyLPA analysis using mclust: 
## 
##  Model Classes AIC     BIC     Entropy prob_min prob_max n_min n_max BLRT_p
##  1     1       8854.82 8892.09 1.00    1.00     1.00     1.00  1.00        
##  1     2       8052.63 8113.18 0.94    0.91     0.99     0.10  0.90  0.01  
##  1     3       7481.68 7565.53 0.93    0.91     0.99     0.02  0.79  0.01  
##  1     4       7491.68 7598.82 0.61    0.00     0.99     0.00  0.79  0.63  
##  1     5       7501.69 7632.11 0.41    0.00     0.99     0.00  0.77  0.84  
##  1     6       7355.62 7509.33 0.49    0.00     1.00     0.00  0.55  0.01
compare_solutions(df1, statistics = c("AIC", "BIC"))
## Compare tidyLPA solutions:
## 
##  Model Classes AIC      BIC      Warnings
##  1     1       8854.822 8892.086         
##  1     2       8052.627 8113.181         
##  1     3       7481.684 7565.528         
##  1     4       7491.683 7598.818 Warning 
##  1     5       7501.686 7632.111 Warning 
##  1     6       7355.617 7509.332 Warning 
## 
## Best model according to AIC is Model 1 with 6 classes.
## Best model according to BIC is Model 1 with 6 classes.
## 
## An analytic hierarchy process, based on the fit indices AIC, AWE, BIC, CLC, and KIC (Akogul & Erisoglu, 2017), suggests the best solution is Model 1 with 6 classes.
# More Statistics Check
compare_solutions(df1, statistics = c("AIC", "BIC", "AWE", "CLC", "KIC"))
## Compare tidyLPA solutions:
## 
##  Model Classes AIC      BIC      AWE      CLC      KIC      Warnings
##  1     1       8854.822 8892.086 8967.351 8840.822 8865.822         
##  1     2       8052.627 8113.181 8236.860 8028.503 8068.627         
##  1     3       7481.684 7565.528 7737.522 7447.534 7502.684         
##  1     4       7491.683 7598.818 7819.726 7446.909 7517.683 Warning 
##  1     5       7501.686 7632.111 7901.710 7446.511 7532.686 Warning 
##  1     6       7355.617 7509.332 7827.058 7290.605 7391.617 Warning 
## 
## Best model according to AIC is Model 1 with 6 classes.
## Best model according to BIC is Model 1 with 6 classes.
## Best model according to AWE is Model 1 with 3 classes.
## Best model according to CLC is Model 1 with 6 classes.
## Best model according to KIC is Model 1 with 6 classes.
## 
## An analytic hierarchy process, based on the fit indices AIC, AWE, BIC, CLC, and KIC (Akogul & Erisoglu, 2017), suggests the best solution is Model 1 with 6 classes.
plot_profiles(df1)

plot_density(df1)

Estimating more classes using Model 1

The warning messages continues from class 4 upwards

df2 <- df %>%
    select(learnhpv_duration, learnvac_duration, getvac_duration, getans_duration) %>%
    single_imputation() %>%
    scale() %>%
    estimate_profiles(1:20)
df2
## tidyLPA analysis using mclust: 
## 
##  Model Classes AIC     BIC     Entropy prob_min prob_max n_min n_max BLRT_p
##  1     1       8854.82 8892.09 1.00    1.00     1.00     1.00  1.00        
##  1     2       8052.63 8113.18 0.94    0.91     0.99     0.10  0.90  0.01  
##  1     3       7481.68 7565.53 0.93    0.91     0.99     0.02  0.79  0.01  
##  1     4       7491.68 7598.82 0.61    0.00     0.99     0.00  0.79  0.70  
##  1     5       7501.69 7632.11 0.41    0.00     0.99     0.00  0.77  0.92  
##  1     6       7355.62 7509.33 0.49    0.00     1.00     0.00  0.55  0.01  
##  1     7       6921.76 7098.77 0.54    0.00     1.00     0.00  0.72  0.01  
##  1     8       6931.76 7132.05 0.47    0.00     1.00     0.00  0.71  0.01  
##  1     9       6600.12 6823.71 0.50    0.00     1.00     0.00  0.72  0.01  
##  1     10      6479.90 6726.78 0.53    0.00     1.00     0.00  0.70  0.01  
##  1     11      6272.10 6542.27 0.57    0.00     1.00     0.00  0.68  0.01  
##  1     12      6231.08 6524.54 0.58    0.00     1.00     0.00  0.59  0.01  
##  1     13      6128.28 6445.03 0.60    0.00     1.00     0.00  0.57  0.01  
##  1     14      6138.28 6478.32 0.59    0.00     1.00     0.00  0.57  0.52  
##  1     15      6148.29 6511.61 0.56    0.00     1.00     0.00  0.57  0.65  
##  1     16      6286.35 6672.97 0.58    0.00     1.00     0.00  0.58  1.00  
##  1     17      6498.85 6908.75 0.59    0.00     1.00     0.00  0.57  1.00  
##  1     18      6508.71 6941.90 0.57    0.00     1.00     0.00  0.57  0.94  
##  1     19      6518.87 6975.35 0.55    0.00     1.00     0.00  0.58  0.60  
##  1     20      6528.88 7008.65 0.54    0.00     1.00     0.00  0.58  0.89
compare_solutions(df2, statistics = c("AIC", "BIC"))
## Compare tidyLPA solutions:
## 
##  Model Classes AIC      BIC      Warnings
##  1      1      8854.822 8892.086         
##  1      2      8052.627 8113.181         
##  1      3      7481.684 7565.528         
##  1      4      7491.683 7598.818 Warning 
##  1      5      7501.686 7632.111 Warning 
##  1      6      7355.617 7509.332 Warning 
##  1      7      6921.761 7098.766 Warning 
##  1      8      6931.759 7132.053 Warning 
##  1      9      6600.122 6823.707 Warning 
##  1     10      6479.902 6726.776 Warning 
##  1     11      6272.104 6542.269 Warning 
##  1     12      6231.081 6524.536 Warning 
##  1     13      6128.283 6445.028 Warning 
##  1     14      6138.283 6478.318 Warning 
##  1     15      6148.286 6511.611 Warning 
##  1     16      6286.351 6672.966 Warning 
##  1     17      6498.847 6908.752 Warning 
##  1     18      6508.709 6941.904 Warning 
##  1     19      6518.866 6975.351 Warning 
##  1     20      6528.879 7008.654 Warning 
## 
## Best model according to AIC is Model 1 with 13 classes.
## Best model according to BIC is Model 1 with 13 classes.
## 
## An analytic hierarchy process, based on the fit indices AIC, AWE, BIC, CLC, and KIC (Akogul & Erisoglu, 2017), suggests the best solution is Model 1 with 13 classes.
# More Statistics Check
compare_solutions(df2, statistics = c("AIC", "BIC", "AWE", "CLC", "KIC"))
## Compare tidyLPA solutions:
## 
##  Model Classes AIC      BIC      AWE      CLC      KIC      Warnings
##  1      1      8854.822 8892.086 8967.351 8840.822 8865.822         
##  1      2      8052.627 8113.181 8236.860 8028.503 8068.627         
##  1      3      7481.684 7565.528 7737.522 7447.534 7502.684         
##  1      4      7491.683 7598.818 7819.726 7446.909 7517.683 Warning 
##  1      5      7501.686 7632.111 7901.710 7446.511 7532.686 Warning 
##  1      6      7355.617 7509.332 7827.058 7290.605 7391.617 Warning 
##  1      7      6921.761 7098.766 7464.700 6846.831 6962.761 Warning 
##  1      8      6931.759 7132.053 7546.411 6846.695 6977.759 Warning 
##  1      9      6600.122 6823.707 7286.290 6505.123 6651.122 Warning 
##  1     10      6479.902 6726.776 7237.587 6374.965 6535.902 Warning 
##  1     11      6272.104 6542.269 7101.287 6157.251 6333.104 Warning 
##  1     12      6231.081 6524.536 7131.833 6106.239 6297.081 Warning 
##  1     13      6128.283 6445.028 7100.574 5993.482 6199.283 Warning 
##  1     14      6138.283 6478.318 7182.182 5993.454 6214.283 Warning 
##  1     15      6148.286 6511.611 7263.807 5993.415 6229.286 Warning 
##  1     16      6286.351 6672.966 7473.424 6121.507 6372.351 Warning 
##  1     17      6498.847 6908.752 7757.467 6324.036 6589.847 Warning 
##  1     18      6508.709 6941.904 7838.957 6323.851 6604.709 Warning 
##  1     19      6518.866 6975.351 7920.734 6323.968 6619.866 Warning 
##  1     20      6528.879 7008.654 8002.342 6323.966 6634.879 Warning 
## 
## Best model according to AIC is Model 1 with 13 classes.
## Best model according to BIC is Model 1 with 13 classes.
## Best model according to AWE is Model 1 with 13 classes.
## Best model according to CLC is Model 1 with 15 classes.
## Best model according to KIC is Model 1 with 13 classes.
## 
## An analytic hierarchy process, based on the fit indices AIC, AWE, BIC, CLC, and KIC (Akogul & Erisoglu, 2017), suggests the best solution is Model 1 with 13 classes.
plot_profiles(df2)

plot_density(df2)

Estimating classes without warning in Model 1

The estimation suggests that Model 1 with 3 classes is the best fit for our data and variables.

df3 <- df %>%
    select(learnhpv_duration, learnvac_duration, getvac_duration, getans_duration) %>%
    single_imputation() %>%
    scale() %>%
    estimate_profiles(1:3)
df3
## tidyLPA analysis using mclust: 
## 
##  Model Classes AIC     BIC     Entropy prob_min prob_max n_min n_max BLRT_p
##  1     1       8854.82 8892.09 1.00    1.00     1.00     1.00  1.00        
##  1     2       8052.63 8113.18 0.94    0.91     0.99     0.10  0.90  0.01  
##  1     3       7481.68 7565.53 0.93    0.91     0.99     0.02  0.79  0.01
compare_solutions(df3, statistics = c("AIC", "BIC"))
## Compare tidyLPA solutions:
## 
##  Model Classes AIC      BIC     
##  1     1       8854.822 8892.086
##  1     2       8052.627 8113.181
##  1     3       7481.684 7565.528
## 
## Best model according to AIC is Model 1 with 3 classes.
## Best model according to BIC is Model 1 with 3 classes.
## 
## An analytic hierarchy process, based on the fit indices AIC, AWE, BIC, CLC, and KIC (Akogul & Erisoglu, 2017), suggests the best solution is Model 1 with 3 classes.
# More Statistics Check
compare_solutions(df3, statistics = c("AIC", "BIC", "AWE", "CLC", "KIC"))
## Compare tidyLPA solutions:
## 
##  Model Classes AIC      BIC      AWE      CLC      KIC     
##  1     1       8854.822 8892.086 8967.351 8840.822 8865.822
##  1     2       8052.627 8113.181 8236.860 8028.503 8068.627
##  1     3       7481.684 7565.528 7737.522 7447.534 7502.684
## 
## Best model according to AIC is Model 1 with 3 classes.
## Best model according to BIC is Model 1 with 3 classes.
## Best model according to AWE is Model 1 with 3 classes.
## Best model according to CLC is Model 1 with 3 classes.
## Best model according to KIC is Model 1 with 3 classes.
## 
## An analytic hierarchy process, based on the fit indices AIC, AWE, BIC, CLC, and KIC (Akogul & Erisoglu, 2017), suggests the best solution is Model 1 with 3 classes.
plot_profiles(df3)

plot_density(df3)

Estimating using multiple models and classes

The estimation below suggests that Model 2 and 6 with 6 classes are the best fit.

df4 <- df %>%
    select(learnhpv_duration, learnvac_duration, getvac_duration, getans_duration) %>%
    single_imputation() %>%
    scale() %>%
    estimate_profiles(1:6, models = c(1, 2, 3, 6))
## The 'variances'/'covariances' arguments were ignored in favor of the 'models' argument.
df4
## tidyLPA analysis using mclust: 
## 
##  Model Classes AIC     BIC     Entropy prob_min prob_max n_min n_max BLRT_p
##  1     1       8854.82 8892.09 1.00    1.00     1.00     1.00  1.00        
##  1     2       8052.63 8113.18 0.94    0.91     0.99     0.10  0.90  0.01  
##  1     3       7481.68 7565.53 0.93    0.91     0.99     0.02  0.79  0.01  
##  1     4       7491.68 7598.82 0.61    0.00     0.99     0.00  0.79  0.64  
##  1     5       7501.69 7632.11 0.41    0.00     0.99     0.00  0.77  0.97  
##  1     6       7355.62 7509.33 0.49    0.00     1.00     0.00  0.55  0.01  
##  2     1       8854.82 8892.09 1.00    1.00     1.00     1.00  1.00        
##  2     2       5842.68 5921.86 0.91    0.97     0.98     0.40  0.60  0.01  
##  2     3       4963.72 5084.83 0.88    0.92     0.97     0.21  0.45  0.01  
##  2     4       4570.03 4733.06 0.86    0.89     0.96     0.10  0.36  0.01  
##  2     5       4404.89 4609.84 0.83    0.87     0.95     0.08  0.31  0.01  
##  2     6       4309.37 4556.25 0.83    0.74     0.95     0.05  0.28  0.01  
##  3     1       8052.09 8117.30 1.00    1.00     1.00     1.00  1.00        
##  3     2       7449.89 7538.39 0.99    0.97     1.00     0.03  0.97  0.01  
##  3     3       7459.89 7571.68 0.49    0.00     1.00     0.00  0.97  0.01  
##  3     4       7260.24 7395.33 0.60    0.00     1.00     0.00  0.94  0.01  
##  3     5       7270.24 7428.62 0.36    0.00     1.00     0.00  0.94  0.01  
##  3     6       6971.03 7152.69 0.43    0.00     0.99     0.00  0.92  0.01  
##  6     1       8052.09 8117.30 1.00    1.00     1.00     1.00  1.00        
##  6     2       5289.68 5424.77 0.89    0.95     0.98     0.32  0.68  0.01  
##  6     3       4742.37 4947.32 0.85    0.90     0.95     0.18  0.53  0.01  
##  6     4       4462.24 4737.06 0.82    0.88     0.96     0.12  0.39  0.01  
##  6     5       4286.92 4631.61 0.82    0.84     0.98     0.12  0.31  0.01  
##  6     6       4186.14 4600.70 0.82    0.82     0.98     0.08  0.30  0.01
compare_solutions(df4, statistics = c("AIC", "BIC"))
## Compare tidyLPA solutions:
## 
##  Model Classes AIC      BIC      Warnings
##  1     1       8854.822 8892.086         
##  1     2       8052.627 8113.181         
##  1     3       7481.684 7565.528         
##  1     4       7491.683 7598.818 Warning 
##  1     5       7501.686 7632.111 Warning 
##  1     6       7355.617 7509.332 Warning 
##  2     1       8854.822 8892.086         
##  2     2       5842.676 5921.862         
##  2     3       4963.725 5084.833         
##  2     4       4570.033 4733.064         
##  2     5       4404.888 4609.840         
##  2     6       4309.374 4556.249         
##  3     1       8052.088 8117.300         
##  3     2       7449.892 7538.394         
##  3     3       7459.888 7571.680 Warning 
##  3     4       7260.244 7395.326 Warning 
##  3     5       7270.243 7428.616 Warning 
##  3     6       6971.030 7152.693 Warning 
##  6     1       8052.088 8117.300         
##  6     2       5289.685 5424.767         
##  6     3       4742.371 4947.324         
##  6     4       4462.238 4737.061         
##  6     5       4286.918 4631.611         
##  6     6       4186.137 4600.700         
## 
## Best model according to AIC is Model 6 with 6 classes.
## Best model according to BIC is Model 2 with 6 classes.
## 
## An analytic hierarchy process, based on the fit indices AIC, AWE, BIC, CLC, and KIC (Akogul & Erisoglu, 2017), suggests the best solution is Model 6 with 6 classes.
# More Statistics Check
compare_solutions(df4, statistics = c("AIC", "BIC", "AWE", "CLC", "KIC"))
## Compare tidyLPA solutions:
## 
##  Model Classes AIC      BIC      AWE      CLC      KIC      Warnings
##  1     1       8854.822 8892.086 8967.351 8840.822 8865.822         
##  1     2       8052.627 8113.181 8236.860 8028.503 8068.627         
##  1     3       7481.684 7565.528 7737.522 7447.534 7502.684         
##  1     4       7491.683 7598.818 7819.726 7446.909 7517.683 Warning 
##  1     5       7501.686 7632.111 7901.710 7446.511 7532.686 Warning 
##  1     6       7355.617 7509.332 7827.058 7290.605 7391.617 Warning 
##  2     1       8854.822 8892.086 8967.351 8840.822 8865.822         
##  2     2       5842.676 5921.862 6084.237 5810.487 5862.676         
##  2     3       4963.725 5084.833 5334.184 4913.481 4992.725         
##  2     4       4570.033 4733.064 5069.368 4501.760 4608.033         
##  2     5       4404.888 4609.840 5033.135 4318.546 4451.888         
##  2     6       4309.374 4556.249 5066.466 4205.031 4365.374         
##  3     1       8052.088 8117.300 8250.512 8026.088 8069.088         
##  3     2       7449.892 7538.394 7719.911 7413.878 7471.892         
##  3     3       7459.888 7571.680 7802.494 7412.867 7486.888 Warning 
##  3     4       7260.244 7395.326 7674.211 7203.441 7292.244 Warning 
##  3     5       7270.243 7428.616 7756.276 7202.955 7307.243 Warning 
##  3     6       6971.030 7152.693 7528.491 6893.895 7013.030 Warning 
##  6     1       8052.088 8117.300 8250.512 8026.088 8069.088         
##  6     2       5289.685 5424.767 5703.077 5233.458 5321.685         
##  6     3       4742.371 4947.324 5370.580 4656.067 4789.371         
##  6     4       4462.238 4737.061 5305.240 4345.881 4524.238         
##  6     5       4286.918 4631.611 5344.661 4140.561 4363.918         
##  6     6       4186.137 4600.700 5458.623 4009.776 4278.137         
## 
## Best model according to AIC is Model 6 with 6 classes.
## Best model according to BIC is Model 2 with 6 classes.
## Best model according to AWE is Model 2 with 5 classes.
## Best model according to CLC is Model 6 with 6 classes.
## Best model according to KIC is Model 6 with 6 classes.
## 
## An analytic hierarchy process, based on the fit indices AIC, AWE, BIC, CLC, and KIC (Akogul & Erisoglu, 2017), suggests the best solution is Model 6 with 6 classes.
plot_profiles(df4)

plot_density(df4)

Conclusion

The best Models and class for our data based on AIC & BIC statistics would be: #### 1. Model 1 with 3 Classes #### 2. Model 2 with 6 Classes #### 3. Model 6 with 6 Classes