R Under development (unstable) (2024-10-18 r87246 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > # This file is part of the standard setup for testthat. > # It is recommended that you do not modify it. > # > # Where should you do additional test configuration? > # Learn more about the roles of various files in: > # * https://r-pkgs.org/testing-design.html#sec-tests-files-overview > # * https://testthat.r-lib.org/articles/special-files.html > > library(testthat) > library(MNormTest) Loading required package: Rmpfr Loading required package: gmp Attaching package: 'gmp' The following objects are masked from 'package:base': %*%, apply, crossprod, matrix, tcrossprod C code of R package 'Rmpfr': GMP using 64 bits per limb Attaching package: 'Rmpfr' The following object is masked from 'package:gmp': outer The following objects are masked from 'package:stats': dbinom, dgamma, dnbinom, dnorm, dpois, dt, pnorm The following objects are masked from 'package:base': cbind, pmax, pmin, rbind > > test_check("MNormTest") H0: Sigma1 = Sigma2 = ... = Sigmak, k = 3 The sample mean is: (5.84333.05733.7581.1993)' The sample mean of each group is: $setosa Sepal.Length Sepal.Width Petal.Length Petal.Width 5.006 3.428 1.462 0.246 $versicolor Sepal.Length Sepal.Width Petal.Length Petal.Width 5.936 2.770 4.260 1.326 $virginica Sepal.Length Sepal.Width Petal.Length Petal.Width 6.588 2.974 5.552 2.026 The sample deviation of each group is: $setosa Sepal.Length Sepal.Width Petal.Length Petal.Width Sepal.Length 6.0882 4.8616 0.8014 0.5062 Sepal.Width 4.8616 7.0408 0.5732 0.4556 Petal.Length 0.8014 0.5732 1.4778 0.2974 Petal.Width 0.5062 0.4556 0.2974 0.5442 $versicolor Sepal.Length Sepal.Width Petal.Length Petal.Width Sepal.Length 13.0552 4.174 8.962 2.7332 Sepal.Width 4.1740 4.825 4.050 2.0190 Petal.Length 8.9620 4.050 10.820 3.5820 Petal.Width 2.7332 2.019 3.582 1.9162 $virginica Sepal.Length Sepal.Width Petal.Length Petal.Width Sepal.Length 19.8128 4.5944 14.8612 2.4056 Sepal.Width 4.5944 5.0962 3.4976 2.3338 Petal.Length 14.8612 3.4976 14.9248 2.3924 Petal.Width 2.4056 2.3338 2.3924 3.6962 The sample deviation within group is: Sepal.Length Sepal.Width Petal.Length Petal.Width Sepal.Length 38.9562 13.6300 24.6246 5.6450 Sepal.Width 13.6300 16.9620 8.1208 4.8084 Petal.Length 24.6246 8.1208 27.2226 6.2718 Petal.Width 5.6450 4.8084 6.2718 6.1566 The statistics, p value and critical value are: Value p.value Critical.Value Likelihood Ratio 3.180759e-33 Likelihood Ratio (Adjusted) 1.420627e-32 M 1.466632e+02 Chi2 1.409430e+02 0 31.4104328442309 The degree of freedom of Chi-square statistic is:Chi2( 20 ) The Modified factor is: 0.0390022675736961 Conclusion: Reject H0: Sigma = Sigma0 The sample mean is: (5.84333.05733.7581.1993)' The sample deviation is: Sepal.Length Sepal.Width Petal.Length Petal.Width Sepal.Length 102.168333 -6.322667 189.8730 76.92433 Sepal.Width -6.322667 28.306933 -49.1188 -18.12427 Petal.Length 189.873000 -49.118800 464.3254 193.04580 Petal.Width 76.924333 -18.124267 193.0458 86.56993 The statistics, p value and critical value are: Value p.value Critical.Value Likelihood Ratio 3.829315e-223 Chi2 1.024268e+03 0 18.3070380532751 The degree of freedom of Chi-square statistic is:Chi2( 10 ) Conclusion: Reject H0: Sigma = sigma^2 * Sigma0 The sample mean is: (5.84333.05733.7581.1993)' The sample deviation is: Sepal.Length Sepal.Width Petal.Length Petal.Width Sepal.Length 102.168333 -6.322667 189.8730 76.92433 Sepal.Width -6.322667 28.306933 -49.1188 -18.12427 Petal.Length 189.873000 -49.118800 464.3254 193.04580 Petal.Width 76.924333 -18.124267 193.0458 86.56993 The estimation of sigma^2 is: 1.13561766666667 The statistics, p value and critical value are: Value p.value Critical.Value Likelihood Ratio 8.616505e-321 W 5.400950e-05 Chi2 1.448568e+03 0 16.9189776046204 The degree of freedom of Chi-square statistic is:Chi2( 9 ) Conclusion: Reject H0: Sigma = sigma^2 * Sigma0 The sample mean is: (5.84333.05733.7581.1993)' The sample deviation is: Sepal.Length Sepal.Width Petal.Length Petal.Width Sepal.Length 102.168333 -6.322667 189.8730 76.92433 Sepal.Width -6.322667 28.306933 -49.1188 -18.12427 Petal.Length 189.873000 -49.118800 464.3254 193.04580 Petal.Width 76.924333 -18.124267 193.0458 86.56993 The estimation of sigma^2 is: 0.567808833333333 The statistics, p value and critical value are: Value p.value Critical.Value Likelihood Ratio 8.616505e-321 W 5.400950e-05 Chi2 1.448568e+03 0 16.9189776046204 The degree of freedom of Chi-square statistic is:Chi2( 9 ) Conclusion: Reject H0: The random vectors are independent of each other The sample mean is: (5.84333.05733.7581.1993)' The sample deviation is: Sepal.Length Sepal.Width Petal.Length Petal.Width Sepal.Length 102.168333 -6.322667 189.8730 76.92433 Sepal.Width -6.322667 28.306933 -49.1188 -18.12427 Petal.Length 189.873000 -49.118800 464.3254 193.04580 Petal.Width 76.924333 -18.124267 193.0458 86.56993 The sample deviation of Submatrix is: [[1]] [,1] [1,] 102.1683 [[2]] [,1] [1,] 28.30693 [[3]] [,1] [1,] 464.3254 [[4]] [,1] [1,] 86.56993 The statistics, p value and critical value are: Value p.value Critical.Value V 8.109611e-03 Likelihood Ratio 1.496239e-157 Chi2 7.069592e+02 0 12.591587243744 The degree of freedom is: [1] "Chi2( 6 )" The Modify Factor is: 146.833333333333 Conclusion: Reject H0: The random vectors are independent of each other The sample mean is: (5.84333.05733.7581.1993)' The sample deviation is: Sepal.Length Sepal.Width Petal.Length Petal.Width Sepal.Length 102.168333 -6.322667 189.8730 76.92433 Sepal.Width -6.322667 28.306933 -49.1188 -18.12427 Petal.Length 189.873000 -49.118800 464.3254 193.04580 Petal.Width 76.924333 -18.124267 193.0458 86.56993 The sample deviation of Submatrix is: [[1]] Sepal.Length Sepal.Width Sepal.Length 102.168333 -6.322667 Sepal.Width -6.322667 28.306933 [[2]] [,1] [1,] 464.3254 [[3]] [,1] [1,] 86.56993 The statistics, p value and critical value are: Value p.value Critical.Value V 8.223278e-03 Likelihood Ratio 4.249857e-157 Chi2 7.042754e+02 0 11.0704976935164 The degree of freedom is: [1] "Chi2( 5 )" The Modify Factor is: 146.7 Conclusion: Reject H0: mu1 = mu2 = ... = muk, k = 3 The sample mean is: (5.84333.05733.7581.1993)' The sample mean within group is: $setosa Sepal.Length Sepal.Width Petal.Length Petal.Width 5.006 3.428 1.462 0.246 $versicolor Sepal.Length Sepal.Width Petal.Length Petal.Width 5.936 2.770 4.260 1.326 $virginica Sepal.Length Sepal.Width Petal.Length Petal.Width 6.588 2.974 5.552 2.026 The total sample deviation is: Sepal.Length Sepal.Width Petal.Length Petal.Width Sepal.Length 102.168333 -6.322667 189.8730 76.92433 Sepal.Width -6.322667 28.306933 -49.1188 -18.12427 Petal.Length 189.873000 -49.118800 464.3254 193.04580 Petal.Width 76.924333 -18.124267 193.0458 86.56993 The sample deviation between group is: Sepal.Length Sepal.Width Petal.Length Petal.Width Sepal.Length 63.21213 -19.95267 165.2484 71.27933 Sepal.Width -19.95267 11.34493 -57.2396 -22.93267 Petal.Length 165.24840 -57.23960 437.1028 186.77400 Petal.Width 71.27933 -22.93267 186.7740 80.41333 The sample deviation within group is: $setosa Sepal.Length Sepal.Width Petal.Length Petal.Width Sepal.Length 6.0882 4.8616 0.8014 0.5062 Sepal.Width 4.8616 7.0408 0.5732 0.4556 Petal.Length 0.8014 0.5732 1.4778 0.2974 Petal.Width 0.5062 0.4556 0.2974 0.5442 $versicolor Sepal.Length Sepal.Width Petal.Length Petal.Width Sepal.Length 13.0552 4.174 8.962 2.7332 Sepal.Width 4.1740 4.825 4.050 2.0190 Petal.Length 8.9620 4.050 10.820 3.5820 Petal.Width 2.7332 2.019 3.582 1.9162 $virginica Sepal.Length Sepal.Width Petal.Length Petal.Width Sepal.Length 19.8128 4.5944 14.8612 2.4056 Sepal.Width 4.5944 5.0962 3.4976 2.3338 Petal.Length 14.8612 3.4976 14.9248 2.3924 Petal.Width 2.4056 2.3338 2.3924 3.6962 The sample deviation within group (total) is: Sepal.Length Sepal.Width Petal.Length Petal.Width Sepal.Length 38.9562 13.6300 24.6246 5.6450 Sepal.Width 13.6300 16.9620 8.1208 4.8084 Petal.Length 24.6246 8.1208 27.2226 6.2718 Petal.Width 5.6450 4.8084 6.2718 6.1566 The statistics, p value and critical value are: Value p.value Critical.Value Wilks Lambda 2.343863e-02 Bartlett's Chi2 5.461153e+02 0 15.5073130558655 Rao's F 1.274530e+04 0 1.9706194163219 The degree of freedom is: df Wilks Lambda Lambda( 4 , 147 , 2 ) Bartlett's Chi2 Chi2( 8 ) Rao's F F( 8 , 288 ) Conclusion: Bartlett's Chi-square: Reject ; Rao's F: Reject H0: mu = (5.8, 3, 4.3, 1.3)' when Sigma is unknown The sample mean is: (5.84333.05733.7581.1993)' The sample deviation is: Sepal.Length Sepal.Width Petal.Length Petal.Width Sepal.Length 102.168333 -6.322667 189.8730 76.92433 Sepal.Width -6.322667 28.306933 -49.1188 -18.12427 Petal.Length 189.873000 -49.118800 464.3254 193.04580 Petal.Width 76.924333 -18.124267 193.0458 86.56993 The statistics, p value and critical value are: Value p.value Critical.Value Hotelling T2 244.22150 F 59.82607 0 2.43363344771214 The degree of freedom is: df Hotelling T2 T2( 4 , 149 ) F F( 4 , 146 ) Conclusion: Reject H0: mu = (5.8, 3, 4.3, 1.3)' when Sigma is known The sample mean is: (5.84333.05733.7581.1993)' The statistics, p value and critical value are: Value p.value Critical.Value Chi2 46.3594 2.073171e-09 9.487729 The degree of Chi-square is: 4 Conclusion: Reject H0: mu1 = mu2 with unknown but equal covariance matrix The sample mean of group 1 is: (5.0063.4281.4620.246)' The sample deviation of group 1 is: Sepal.Length Sepal.Width Petal.Length Petal.Width Sepal.Length 6.0882 4.8616 0.8014 0.5062 Sepal.Width 4.8616 7.0408 0.5732 0.4556 Petal.Length 0.8014 0.5732 1.4778 0.2974 Petal.Width 0.5062 0.4556 0.2974 0.5442 The sample mean of group 2 is: (5.9362.774.261.326)' The sample deviation of group 2 is: Sepal.Length Sepal.Width Petal.Length Petal.Width Sepal.Length 13.0552 4.174 8.962 2.7332 Sepal.Width 4.1740 4.825 4.050 2.0190 Petal.Length 8.9620 4.050 10.820 3.5820 Petal.Width 2.7332 2.019 3.582 1.9162 The mixed sample deviation is: Sepal.Length Sepal.Width Petal.Length Petal.Width Sepal.Length 0.19534082 0.09220000 0.09962653 0.03305510 Sepal.Width 0.09220000 0.12107959 0.04717551 0.02525102 Petal.Length 0.09962653 0.04717551 0.12548776 0.03958571 Petal.Width 0.03305510 0.02525102 0.03958571 0.02510612 The statistics, p value and critical value are: Value p.value Critical.Value Hotelling T2 2580.8385 F 625.4583 0 2.46749362344965 The degree of freedom is: df Hotelling T2 T2( 4 98 ) F F( 4 95 ) Conclusion: Reject H0: mu1 = mu2 with unknown and different covariance matrix The coupled sample mean is: (-0.930.658-2.798-1.08)' The coupled sample deviation is: Sepal.Length Sepal.Width Petal.Length Petal.Width Sepal.Length 20.585 9.9570 10.9730 3.200 Sepal.Width 9.957 13.5418 5.6142 2.402 Petal.Length 10.973 5.6142 13.8298 4.238 Petal.Width 3.200 2.4020 4.2380 2.820 The statistics, p value and critical value are: Value p.value Critical.Value Hotelling T2 45.86582 F 10.76443 3.05133847366967e-06 2.57403502518323 The degree of freedom is: df Hotelling T2 T2( 4 , 49 ) F F( 4 , 46 ) Conclusion: Reject H0: mu1 = mu2, with unknown but different covariance matrix The sample mean is: (-0.930.658-2.798-1.08)' The sample deviation is: Sepal.Length Sepal.Width Petal.Length Petal.Width Sepal.Length 20.585 9.9570 10.9730 3.200 Sepal.Width 9.957 13.5418 5.6142 2.402 Petal.Length 10.973 5.6142 13.8298 4.238 Petal.Width 3.200 2.4020 4.2380 2.820 The statistics, p value and critical value are: Value p.value Critical.Value Hotelling T2 45.86582 F 10.76443 3.05133847366967e-06 2.57403502518323 The degree of freedom is: df Hotelling T2 T2( 4 , 49 ) F F( 4 , 46 ) Conclusion: Reject H0: mu1 = mu2 = ... = muk, Sigma1 = Sigma2 = ... = Sigmak, k = 3 The sample mean is: (5.84333.05733.7581.1993)' The sample mean of each group is: $setosa Sepal.Length Sepal.Width Petal.Length Petal.Width 5.006 3.428 1.462 0.246 $versicolor Sepal.Length Sepal.Width Petal.Length Petal.Width 5.936 2.770 4.260 1.326 $virginica Sepal.Length Sepal.Width Petal.Length Petal.Width 6.588 2.974 5.552 2.026 The total sample deviation is: Sepal.Length Sepal.Width Petal.Length Petal.Width Sepal.Length 102.168333 -6.322667 189.8730 76.92433 Sepal.Width -6.322667 28.306933 -49.1188 -18.12427 Petal.Length 189.873000 -49.118800 464.3254 193.04580 Petal.Width 76.924333 -18.124267 193.0458 86.56993 The sample deviation of each group is: $setosa Sepal.Length Sepal.Width Petal.Length Petal.Width Sepal.Length 6.0882 4.8616 0.8014 0.5062 Sepal.Width 4.8616 7.0408 0.5732 0.4556 Petal.Length 0.8014 0.5732 1.4778 0.2974 Petal.Width 0.5062 0.4556 0.2974 0.5442 $versicolor Sepal.Length Sepal.Width Petal.Length Petal.Width Sepal.Length 13.0552 4.174 8.962 2.7332 Sepal.Width 4.1740 4.825 4.050 2.0190 Petal.Length 8.9620 4.050 10.820 3.5820 Petal.Width 2.7332 2.019 3.582 1.9162 $virginica Sepal.Length Sepal.Width Petal.Length Petal.Width Sepal.Length 19.8128 4.5944 14.8612 2.4056 Sepal.Width 4.5944 5.0962 3.4976 2.3338 Petal.Length 14.8612 3.4976 14.9248 2.3924 Petal.Width 2.4056 2.3338 2.3924 3.6962 The sample deviation within group is: Sepal.Length Sepal.Width Petal.Length Petal.Width Sepal.Length 38.9562 13.6300 24.6246 5.6450 Sepal.Width 13.6300 16.9620 8.1208 4.8084 Petal.Length 24.6246 8.1208 27.2226 6.2718 Petal.Width 5.6450 4.8084 6.2718 6.1566 The statistics, p value and critical value are: Value p.value Critical.Value Likelihood Ratio 1.767862e-155 Likelihood Ratio (Modified) 2.200389e-152 M 6.984086e+02 Chi2 6.809880e+02 0 41.3371381514274 The degree of freedom of Chi-square statistic is:Chi2( 28 ) The Modified factor is: 0.0249433106575964 Conclusion: Reject [ FAIL 0 | WARN 0 | SKIP 0 | PASS 13 ] > > proc.time() user system elapsed 1.35 0.35 1.75