R Under development (unstable) (2024-08-16 r87026 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. > ## VT::15.09.2013 - this will render the output independent > ## from the version of the package > suppressPackageStartupMessages(library(rrcovHD)) > > data(hemophilia) > hemophilia$gr <- factor(hemophilia$gr) > > obj <- OutlierSign1(gr~., data=hemophilia) > getDistance(obj) # returns an array of distances [1] 0.90920617 0.52202377 2.16765807 0.64084435 0.12521644 0.70361969 [7] 0.33686547 0.84747451 0.85961135 0.12184633 4.55133854 0.73727503 [13] 1.05533850 1.70205321 0.51338363 3.09348637 3.59192472 0.11720880 [19] 1.10226472 0.50393083 0.92304012 3.00093933 0.11720880 0.29527991 [25] 0.58790262 1.79169435 1.07061202 0.33117160 0.49583698 0.49351056 [31] 0.29692177 0.68586078 0.70862692 1.35197584 0.55773851 1.98113573 [37] 0.28784783 0.83384273 0.56276081 0.15221495 0.70266896 0.20224293 [43] 0.51970186 0.47826409 0.14572454 0.44447203 0.67975240 0.48742556 [49] 1.22669075 1.07940113 0.10676548 0.54803254 1.10844616 0.30711820 [55] 0.24147547 0.01017579 0.03219030 0.93038922 0.54730480 1.18216814 [61] 0.42285640 1.30439229 1.21915353 0.18565100 0.99596479 0.82021530 [67] 0.78453662 0.43578338 1.06169210 0.24806925 1.13200026 0.98295001 [73] 0.92555899 0.71233107 0.31280874 > getClassLabels(obj, 1) # returns an array of indices for a given class [1] 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 [26] 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 > getCutoff(obj) # returns an array of cutoff values (for each class, usually equal) [1] 2.241403 2.241403 > getFlag(obj) # returns an 0/1 array of flags [1] 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 0 0 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [39] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 > plot(obj, class=2) # standard plot function > > obj <- OutlierSign2(gr~., data=hemophilia) > getDistance(obj) # returns an array of distances [1] 2.26010583 0.95225852 2.36253011 0.82782622 2.05178930 0.87267959 [7] 1.50655255 1.18304107 1.53301613 0.71021626 5.02708634 1.02872570 [13] 1.17177897 1.75877758 0.64671676 3.33647983 3.78125548 0.34144276 [19] 1.85116935 1.07727384 1.71996634 2.94750600 0.05112412 0.57366948 [25] 0.74994950 1.70803524 1.26758657 0.32148879 0.94288586 0.40458334 [31] 1.23266481 1.32126839 1.34262229 1.76892283 1.28051882 2.46014910 [37] 1.39203208 1.09754977 1.15439679 0.96034110 1.11275689 0.44333157 [43] 1.46030037 0.89028834 0.19261211 2.49323763 1.17741002 1.58802699 [49] 1.54313127 1.16669777 0.69286437 0.81997500 1.93600235 0.58199546 [55] 0.78990174 0.47442908 0.74970650 1.77075309 0.77649477 1.33988777 [61] 0.93447594 1.68091017 1.59115453 1.50198431 0.95278920 0.81613407 [67] 1.36498226 0.49444256 1.84180638 0.93292743 1.46507297 1.02589410 [73] 1.49659360 0.98698916 1.68499104 > getClassLabels(obj, 1) # returns an array of indices for a given class [1] 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 [26] 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 > getCutoff(obj) # returns an array of cutoff values (for each class, usually equal) [1] 2.716203 2.716203 > getFlag(obj) # returns an 0/1 array of flags [1] 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 0 0 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [39] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 > plot(obj, class=2) # standard plot function > > obj <- OutlierPCDist(gr~., data=hemophilia) > getDistance(obj) # returns an array of distances [1] 2.54564754 0.80907855 2.26004767 0.65133622 1.90732982 0.69276088 [7] 1.47647967 0.93712177 1.29038871 0.81398950 4.27614142 0.81109094 [13] 1.40232800 1.52789191 0.52668363 2.83874613 3.49024646 0.25190668 [19] 2.15905378 1.06040740 1.45669693 2.98270975 0.08347159 0.49479730 [25] 0.66552776 1.67384806 1.04991427 0.48114294 0.91525338 0.53832313 [31] 1.17406452 1.20325670 1.32078619 1.71385195 1.35804724 2.54370967 [37] 1.32290690 1.04958551 1.04121984 0.90841101 1.08493741 0.36267394 [43] 1.40312189 0.84409718 0.24128661 2.41485355 1.06943695 1.54171122 [49] 1.51627696 1.29924977 0.68435106 0.76588803 1.90997832 0.65163558 [55] 0.81730434 0.42219500 0.71738572 1.63586481 0.70509373 1.56830904 [61] 0.82944776 1.90940556 1.80831696 1.47430211 1.15053687 1.01024802 [67] 1.49559654 0.56342324 1.99932953 0.89086665 1.53082224 1.16464728 [73] 1.38673785 1.03031025 1.62060469 > getClassLabels(obj, 1) # returns an array of indices for a given class [1] 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 [26] 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 > getCutoff(obj) # returns an array of cutoff values (for each class, usually equal) [1] 2.716203 2.716203 > getFlag(obj) # returns an 0/1 array of flags [1] 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 0 0 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [39] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 > plot(obj, class=2) # standard plot function > > obj <- OutlierPCOut(gr~., data=hemophilia) > getDistance(obj) # returns an array of distances [1] 1.25292601 1.14545691 3.93259292 0.98013176 0.22438430 1.08970755 [7] 0.67150575 1.36168443 1.76907705 0.05390552 8.23500520 1.16160734 [13] 1.60573690 2.83402079 1.08233675 5.31015271 6.44856108 0.37063822 [19] 1.62575223 0.99955554 1.89388333 5.02569969 0.02405772 0.72752526 [25] 1.19321270 2.94760973 2.07695811 0.37610061 0.99713506 0.66615572 [31] 1.13641702 1.29089641 1.32101985 1.87629379 1.10756034 2.60917270 [37] 1.27483814 1.17840342 1.11774237 0.88576896 1.14145384 0.46673423 [43] 1.36545929 0.89969917 0.12651271 2.24081738 1.17741002 1.47251716 [49] 1.65809168 1.25325510 0.56758636 0.86732155 1.89785612 0.47914840 [55] 0.65110417 0.46095471 0.62509629 1.72767591 0.83245367 1.35116223 [61] 0.89716013 1.63728338 1.53968425 1.27427774 1.03340478 0.84258894 [67] 1.22576809 0.52180439 1.67864163 0.86921992 1.51524368 1.10861915 [73] 1.51184283 1.00450410 1.53227421 > getClassLabels(obj, 1) # returns an array of indices for a given class [1] 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 [26] 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 > getCutoff(obj) # returns an array of cutoff values (for each class, usually equal) [1] 2.326753 3.221399 > getFlag(obj) # returns an 0/1 array of flags [1] 1 1 0 1 1 1 1 1 1 1 0 1 1 0 1 0 0 1 1 1 1 0 1 1 1 0 1 1 1 1 1 1 1 1 1 0 1 1 [39] 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 > plot(obj, class=2) # standard plot function > > proc.time() user system elapsed 1.03 0.15 1.18