The purpose of this vignette is to facilitate benchmarking the output from the use of two packages, MPlus (via the MplusAutomation package) and mclust (via the mclust package). As CRAN does not allow for MPlus to be used, this vignette is not rendered, but can be rendered on your own computer as long as you have MPlus (and MplusAutomation) installed.
library(tidyLPA)
#> tidyLPA is intended for academic use. We do not make any money on this and only ask that you please cite this in publications when you use the results. You can use the function citation('tidyLPA') to create a citation.Mplus is not installed. Use only package = 'mclust' when calling estimate_profiles().
library(dplyr)
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
iris %>%
select(Sepal.Length, Sepal.Width, Petal.Length, Petal.Width) %>%
estimate_profiles(n_profiles = 2) %>%
get_fit() %>%
as.data.frame()
#> Model Classes LogLik AIC AWE BIC CAIC CLC KIC
#> 1 1 2 -488.9148 1003.83 1145.123 1042.968 1055.968 979.8126 1019.83
#> SABIC ICL Entropy prob_min prob_max n_min n_max BLRT_val
#> 1 1001.825 -1043.542 0.9914483 0.9946212 1 0.3333333 0.6666667 504.2054
#> BLRT_p
#> 1 0.00990099
iris %>%
select(Sepal.Length, Sepal.Width, Petal.Length, Petal.Width) %>%
estimate_profiles(n_profiles = 2, package = "mplus") %>%
get_fit() %>%
as.data.frame()
#> Model Classes LogLik AIC AWE BIC CAIC CLC KIC
#> 1 1 2 -488.915 1003.83 1145.125 1042.968 1055.968 979.812 1019.83
#> SABIC ICL Entropy prob_min prob_max n_min n_max BLRT_val BLRT_p
#> 1 1001.826 -1043.542 0.991 0.995 1 0.33333 0.66667 504.205 0
library(tidyLPA)
library(dplyr)
iris %>%
select(Sepal.Length, Sepal.Width, Petal.Length, Petal.Width) %>%
estimate_profiles(n_profiles = 2:4, models = c(1, 2, 3, 6)) %>%
get_fit() %>%
as.data.frame()
#> The 'variances'/'covariances' arguments were ignored in favor of the 'models' argument.
#> Model Classes LogLik AIC AWE BIC CAIC CLC
#> 1 1 2 -488.9148 1003.8297 1145.1233 1042.9679 1055.9679 979.8126
#> 2 1 3 -361.4295 758.8590 955.3303 813.0504 831.0504 724.7706
#> 3 1 4 -356.0795 758.1590 1009.8759 827.4036 850.4036 713.9313
#> 4 2 2 -386.1853 806.3707 991.7323 857.5515 874.5515 774.3707
#> 5 2 3 -307.1808 666.3617 951.0214 744.6382 770.6382 616.2549
#> 6 2 4 -287.8238 645.6475 1029.5289 751.0198 786.0198 577.5106
#> 7 3 2 -296.4476 630.8951 838.2994 688.0972 707.0972 594.8950
#> 8 3 3 -256.3547 560.7095 823.2972 632.9647 656.9647 514.6323
#> 9 3 4 -250.3587 558.7173 876.4869 646.0258 675.0258 502.5646
#> 10 6 2 -214.3547 486.7094 804.3264 574.0178 603.0178 430.7093
#> 11 6 3 -180.1858 448.3717 931.3664 580.8396 624.8396 362.3128
#> 12 6 4 -167.4862 452.9725 1101.3164 630.6000 689.6000 336.8835
#> KIC SABIC ICL Entropy prob_min prob_max n_min
#> 1 1019.8297 1001.8254 -1043.5425 0.9914483 0.9946212 1.0000000 0.33333333
#> 2 779.8590 756.0839 -820.7712 0.9558015 0.9656544 0.9999999 0.30000000
#> 3 784.1590 754.6130 -851.8917 0.8861692 0.6699228 0.9978376 0.09333333
#> 4 826.3707 803.7497 -857.5515 0.9999984 0.9999999 1.0000000 0.33333333
#> 5 695.3617 662.3532 -751.8156 0.9466325 0.9436416 1.0000000 0.24666667
#> 6 683.6475 640.2515 -763.2056 0.9315473 0.9436393 0.9834466 0.10666667
#> 7 652.8951 627.9659 -688.0985 0.9999402 0.9999932 0.9999970 0.33333333
#> 8 587.7095 557.0093 -637.8401 0.9613981 0.9727667 1.0000000 0.32666667
#> 9 590.7173 554.2463 -661.1847 0.9236419 0.5759597 0.9834601 0.04000000
#> 10 518.7094 482.2384 -574.0191 0.9999487 0.9999937 1.0000000 0.33333333
#> 11 495.3717 441.5881 -584.0522 0.9705683 0.9845990 1.0000000 0.30000000
#> 12 514.9725 443.8763 -637.9705 0.9555100 0.9574423 0.9919093 0.08000000
#> n_max BLRT_val BLRT_p
#> 1 0.6666667 504.20541 0.00990099
#> 2 0.3666667 254.97066 0.00990099
#> 3 0.4266667 10.70000 0.18811881
#> 4 0.6666667 709.66438 0.00990099
#> 5 0.4200000 158.00903 0.00990099
#> 6 0.4200000 38.71413 0.01980198
#> 7 0.6666667 166.93411 0.00990099
#> 8 0.3400000 80.18566 0.00990099
#> 9 0.3400000 11.99215 0.08910891
#> 10 0.6666667 331.11985 0.00990099
#> 11 0.3666667 68.33773 0.00990099
#> 12 0.3666667 25.39920 0.74257426
iris %>%
select(Sepal.Length, Sepal.Width, Petal.Length, Petal.Width) %>%
estimate_profiles(n_profiles = 2:4, models = c(1, 2, 3, 6),
package = "mplus") %>%
get_fit() %>%
as.data.frame()
#> The 'variances'/'covariances' arguments were ignored in favor of the 'models' argument.
#> Warning:
#> One or more analyses resulted in warnings! Examine these analyses carefully: model_3_class_2, model_3_class_3, model_3_class_4, model_6_class_2, model_6_class_3, model_6_class_4
#> Model Classes LogLik AIC AWE BIC CAIC CLC
#> 1 1 2 -488.915 1003.830 1145.1245 1042.9683 1055.9683 979.812
#> 2 1 3 -361.426 758.852 955.3209 813.0434 831.0434 724.766
#> 3 1 4 -310.117 666.234 917.8332 735.4786 758.4786 622.124
#> 4 2 2 -386.185 806.370 991.7316 857.5508 874.5508 774.370
#> 5 2 3 -307.178 666.356 951.0130 744.6325 770.6325 616.252
#> 6 2 4 -264.848 599.696 983.5445 705.0682 740.0682 531.592
#> 7 3 2 -296.448 630.896 838.3001 688.0981 707.0981 594.896
#> 8 3 3 -256.354 560.708 823.2945 632.9632 656.9632 514.632
#> 9 3 4 -223.049 504.098 821.7848 591.4064 620.4064 448.028
#> 10 6 2 -214.355 486.710 804.3268 574.0184 603.0184 430.710
#> 11 6 3 -180.185 448.370 931.3659 580.8380 624.8380 362.310
#> 12 6 4 -163.069 444.138 1092.4650 621.7655 680.7655 328.066
#> KIC SABIC ICL Entropy prob_min prob_max n_min n_max
#> 1 1019.830 1001.8257 -1043.5420 0.991 0.995 1 0.33333 0.66667
#> 2 779.852 756.0769 -820.7280 0.957 0.964 1 0.30000 0.36667
#> 3 692.234 662.6880 -747.2726 0.945 0.916 1 0.15333 0.33333
#> 4 826.370 803.7491 -857.5510 1.000 1.000 1 0.33333 0.66667
#> 5 695.356 662.3475 -751.4712 0.948 0.935 1 0.24000 0.42667
#> 6 637.696 594.2999 -713.6308 0.948 0.947 1 0.15333 0.33333
#> 7 652.896 627.9667 -688.0970 1.000 1.000 1 0.33333 0.66667
#> 8 587.708 557.0078 -637.7937 0.962 0.973 1 0.32667 0.34000
#> 9 536.098 499.6270 -597.6706 0.965 0.900 1 0.09333 0.34000
#> 10 518.710 482.2390 -574.0200 1.000 1.000 1 0.33333 0.66667
#> 11 495.370 441.5864 -584.0539 0.970 0.985 1 0.30000 0.36667
#> 12 506.138 435.0418 -626.7831 0.964 0.947 1 0.08667 0.33333
#> BLRT_val BLRT_p
#> 1 504.205 0.00
#> 2 254.979 0.00
#> 3 102.617 0.00
#> 4 709.664 0.00
#> 5 158.016 0.00
#> 6 84.026 0.00
#> 7 166.934 0.00
#> 8 80.187 0.00
#> 9 66.611 0.00
#> 10 331.120 0.00
#> 11 68.338 0.00
#> 12 47.002 0.04