Gene expression data from Khan et al. (2001). This data set contains 83 samples with 2308 genes: 29 cases of Ewing sarcoma (EWS), coded 1, 11 cases of Burkitt lymphoma (BL), coded 2, 18 cases of neuroblastoma (NB), coded 3, 25 cases of rhabdomyosarcoma (RMS), coded 4. A total of 63 training samples and 25 test samples are provided in Khan et al. (2001). Five of the test set are non-SRBCT and are not considered here. The training sample indexes correspond to 1:65 and the test sample indexes (without non-SRBCT sample) correspond to 66:83.
library(plsgenomics)
# For any news related to the 'plsgenomics' package (update, corrected bugs), please check http://thoth.inrialpes.fr/people/gdurif/
# C++ based sparse PLS routines will soon be available on the CRAN in the new 'fastPLS' package.
library(MultiGroupO)
data(SRBCT)
mydata<-SRBCT$X
mydata<-mydata[,1:5]
groups<-as.factor(SRBCT$Y)
pca(datos=mydata,grupos=groups,Plot=TRUE,center=TRUE,scale=FALSE)
# $loadings
# PC1 PC2 PC3 PC4 PC5
# [1,] -0.94728054 0.24001708 0.1989556 0.073801089 -0.004632259
# [2,] -0.13989846 -0.16047800 -0.1118758 -0.970072631 0.033438370
# [3,] 0.18054603 0.94484241 -0.2223145 -0.157444629 -0.021526400
# [4,] 0.22108232 0.14600740 0.9356202 -0.169465632 -0.160314251
# [5,] -0.04017129 -0.05092408 -0.1519591 -0.002253519 -0.986253706
#
# $variates
# PC1 PC2 PC3 PC4 PC5
# [1,] -1.67856734 0.4079880063 -0.02241524 0.411531062 -0.1533598693
# [2,] -0.21804365 0.0353967641 -0.35318728 0.308196478 0.1512264910
# [3,] -1.78092361 0.2809271853 0.03216541 0.399140376 0.0642475642
# [4,] 0.27707958 -0.7137731389 -0.32594713 0.231513374 0.0705114323
# [5,] -1.33172703 -0.3566092997 0.11843153 0.302386587 -0.0247454847
# [6,] -0.61819806 0.0008864521 -0.20045600 0.335464257 -0.0485580316
# [7,] -0.38616443 0.0490137475 -0.17974845 0.249450807 -0.0437162704
# [8,] -1.30203326 -0.2271466393 0.11129535 0.331562426 -0.1373604682
# [9,] -0.91223009 -0.0529229324 -0.05866381 0.372645295 -0.0766223702
# [10,] -0.57431782 -0.3629691448 -0.15696626 0.211832185 0.0226571473
# [11,] -2.12322787 0.0893237052 0.31135457 0.452348803 -0.1207324174
# [12,] -0.76242684 -0.3497289670 -0.01743087 0.376028044 -0.1178658699
# [13,] -0.84654213 -0.2042954368 0.25730831 0.265738571 -0.1591611445
# [14,] 0.70174005 0.6553666039 0.50602520 -0.164504642 -0.0928488055
# [15,] 0.40851695 -0.4117042562 -0.48359776 0.175410060 -0.0400886269
# [16,] 0.54404432 0.2856977809 -0.64829398 0.160581028 -0.1816327039
# [17,] -0.97382499 1.0539560060 -0.26513531 0.207302097 -0.1119526626
# [18,] 0.82911920 1.2994826330 0.41744126 -0.256760018 -0.0276008605
# [19,] 0.73416847 0.9854924318 0.41669253 -0.178448913 -0.0033259140
# [20,] 0.19487659 0.3346419706 0.97759377 0.055351019 -0.0044948652
# [21,] -0.78274193 -0.2472377511 -0.15989915 0.394356833 0.0659659897
# [22,] 1.10341154 -0.4984696627 0.24168347 0.109430767 0.0773652018
# [23,] 0.62603357 0.7670014643 0.20805516 -0.076614433 0.0611049959
# [24,] 1.34908148 -0.0592679453 0.52510894 -0.027738560 -0.1680024700
# [25,] 1.58928423 0.5468119419 0.43307200 -0.191718417 0.0083639769
# [26,] 1.37023042 -0.9229849418 0.65211945 0.087878189 0.0179268446
# [27,] 1.31365525 -0.1628517205 0.55931348 0.035651783 0.1083538911
# [28,] 1.22870879 -0.2934555708 -0.62478614 0.193831743 -0.0402473372
# [29,] 1.18609440 0.5382514049 -0.75427979 0.079185705 -0.0041571822
# [30,] 1.10351734 0.0918803747 -0.47484516 0.119216014 -0.1474312384
# [31,] 1.19310090 -0.7899329660 -0.58285432 0.202442671 -0.2678543431
# [32,] 0.22208054 0.3163119242 -0.53607758 0.053229115 -0.0863587151
# [33,] 0.50232425 1.6699724029 -0.83194464 -0.080521760 -0.1733855942
# [34,] 0.63572183 -0.0607644021 -0.48678507 0.139324759 0.0478879819
# [35,] 0.94231336 -0.3372141669 1.02785346 0.026911819 -0.0020463708
# [36,] 0.19019432 0.7567766580 1.15874139 -0.203999642 -0.1221636734
# [37,] 0.79037962 2.2083711869 0.51497309 -0.360622421 -0.0307591633
# [38,] 0.98541194 0.2631986609 0.19384815 0.025621240 0.1183392538
# [39,] 0.92240203 -0.7282071267 0.73168477 0.084156401 0.0447847177
# [40,] 0.46236121 0.3082099166 0.51585105 0.001310997 0.0642385594
# [41,] 0.50172024 0.3975934233 0.83054886 0.018956414 0.0604932540
# [42,] 0.88928386 0.8206476271 0.54902440 -0.149987730 -0.0194574400
# [43,] 1.09651840 -0.3313917207 0.97289301 -0.108293043 -0.0648443022
# [44,] -1.24036595 0.2710232627 0.18750880 0.354547150 0.1675517223
# [45,] -0.80086562 -0.7151095320 0.01273562 0.183658951 -0.0057240936
# [46,] 0.21174542 -0.6804132915 1.19509963 -0.040118566 -0.0437583165
# [47,] 0.29117431 -0.1385115736 0.94825797 0.011499409 0.0260075991
# [48,] 0.26736439 -0.7042684593 0.90433002 -0.065814504 -0.0349132308
# [49,] 0.78928953 -0.0217484490 0.67243515 -0.247472893 0.0003969374
# [50,] 0.08330340 -0.4896842028 0.74724280 0.126095527 0.0451927414
# [51,] 0.20931203 -0.7421378374 -0.54055378 -0.500345784 -0.3660624017
# [52,] 0.07010603 -0.1755805707 0.74997378 0.178103683 0.1474002320
# [53,] -1.11053994 -0.0254422667 -0.25366979 -0.555311781 0.0030640513
# [54,] -0.04110380 -1.0568532612 -0.47298085 -0.885329403 -0.1698802532
# [55,] -2.22531301 -0.3923611218 0.04470955 -0.631982133 0.0768769142
# [56,] -0.83937933 -0.4545513842 -0.31899204 -0.408983273 -0.2896033697
# [57,] -1.69352449 -0.2406806068 0.28001153 0.166224529 0.2228415260
# [58,] -0.70702173 -0.5625797851 0.04530671 -0.076927097 -0.2729976178
# [59,] -1.13818363 -0.8201899480 -0.19117424 -1.351380809 0.0281888972
# [60,] -0.49312246 -0.3020180582 -0.07971039 -0.102134354 -0.0606863154
# [61,] 0.06742049 -0.2280472555 -0.46378125 -0.089413953 -0.0199769602
# [62,] -0.08496562 -0.9279078714 -0.23412326 -0.290892162 0.2166931076
# [63,] -0.65120446 0.0329683734 -0.30548867 -0.289696720 0.1526697488
# [64,] 0.64029157 -0.0441217957 -0.52918648 0.100432448 0.1686478235
# [65,] 0.89314773 -0.9038412245 -0.48588769 0.032026401 0.2103180130
# [66,] 0.35017016 0.5488885967 -0.66597387 -0.071897066 0.0879692612
# [67,] -1.32500608 2.2697547987 -0.43703686 0.040981027 0.0616241350
# [68,] -1.04550749 -0.2088329114 -0.24831841 -0.800298362 0.1678953248
# [69,] 1.26148785 -0.0674167743 -0.72102197 0.113994450 0.0598042267
# [70,] -2.81969292 0.4263504171 0.31582445 0.433514227 0.0820331826
# [71,] -0.06075892 -0.8343390573 -0.25306175 0.009617833 -0.1421766721
# [72,] -0.56029054 -0.1200565122 -0.13227814 0.274985647 -0.0230993323
# [73,] -0.55986487 -0.3710256786 -0.15945119 0.213636976 0.0257022257
# [74,] -1.46430709 0.5760027237 0.02081738 0.281958595 0.0194752741
# [75,] -2.38489616 0.3115038758 0.04022211 -1.088046651 0.1759149570
# [76,] 1.35748512 0.5821119401 -0.78788064 0.023848691 0.1476416016
# [77,] 0.44230712 -1.0030136856 -0.37505620 0.123065228 0.0675698614
# [78,] 0.77328236 0.9834109586 -0.79219366 -0.099825686 0.0045409947
# [79,] 0.77498747 0.0544995642 -0.63579078 0.007548415 0.1279642696
# [80,] 0.87411434 0.6870883227 -0.70253381 -0.159868717 0.0624876364
# [81,] 0.57676191 -0.0261843151 -0.53007352 -0.061254961 0.0772289301
# [82,] 1.11865721 -0.9522778059 -0.50171825 0.261213105 0.2142690268
# [83,] 0.59110002 -0.5866800802 -0.44630268 0.261265247 0.0682152350
#
# $prop_expl_var
# [1] 0.55 0.24 0.15 0.06 0.01
#
# attr(,"class")
# [1] "pca"
library(plsgenomics)
data(SRBCT)
mydata<-SRBCT$X
mydata<-mydata[,1:5]
groups<-as.factor(SRBCT$Y)
mat.to.diag1<-new.cov(x=mydata,cls=groups,A=diag(ncol(mydata)))
mgpca(mat.to.diag=mat.to.diag1,mat.x=as.matrix(mydata),cls=groups,Plot=TRUE,ncomp=2,center = TRUE,scale = TRUE)
# $variates
# [,1] [,2] [,3] [,4] [,5]
# [1,] -1.72403001 0.508402635 -0.45492278 0.828527233 1.191417771
# [2,] -0.20672447 0.134090675 -0.58738092 0.721960626 -0.684209083
# [3,] -1.81731150 0.346363923 -0.23726780 0.754159429 -0.180261753
# [4,] 0.15430112 -0.976150762 -0.57607111 0.537723073 -0.098069321
# [5,] -1.47808450 -0.606372349 -0.11903926 0.528329253 0.398492094
# [6,] -0.66302434 0.008941405 -0.53321498 0.748848978 0.558328904
# [7,] -0.40779846 0.085523590 -0.43749633 0.572500626 0.460107575
# [8,] -1.43343854 -0.422371202 -0.18924938 0.631522349 1.082242907
# [9,] -0.97354219 -0.097064020 -0.35750545 0.805146753 0.702999438
# [10,] -0.69729481 -0.553189472 -0.43842657 0.392986080 0.156024794
# [11,] -2.21297908 0.003891979 0.05806129 0.855311928 0.907041155
# [12,] -0.87144680 -0.534017411 -0.31190400 0.816298889 0.980932230
# [13,] -0.91423762 -0.355644661 0.16752769 0.561411297 1.031318093
# [14,] 0.96093811 1.015725867 1.10350709 -0.170498169 -0.048449470
# [15,] 0.30569733 -0.546982439 -0.88563856 0.437763728 0.618740572
# [16,] 0.54883989 0.483592318 -1.18173020 0.491095936 1.440611306
# [17,] -0.87820586 1.507868599 -0.65540354 0.460818420 0.816509430
# [18,] 1.22007262 1.986726277 1.08498489 -0.333758241 -0.579086640
# [19,] 1.06667904 1.528796821 1.04530951 -0.181661666 -0.640211428
# [20,] 0.47367378 0.564183541 1.90389483 0.325173793 -0.772635287
# [21,] -0.85902411 -0.343907328 -0.44013035 0.842752338 -0.108462792
# [22,] 1.19611234 -0.577209204 0.68906952 0.452637496 -0.739422910
# [23,] 0.89460669 1.222659484 0.65501500 0.014134844 -0.831633999
# [24,] 1.54114764 0.033502437 1.14627075 0.234381074 0.471306537
# [25,] 1.92292858 0.962156698 1.21765255 -0.108986029 -0.773677567
# [26,] 1.45772199 -1.195033714 1.42043752 0.447899251 -0.594642670
# [27,] 1.54993208 -0.053937157 1.38657624 0.366678809 -1.277450493
# [28,] 1.22030517 -0.275434527 -0.95695728 0.631096484 0.542485653
# [29,] 1.31424340 0.946530346 -1.08777376 0.396487395 0.211119292
# [30,] 1.15668535 0.253675542 -0.73656557 0.479263681 1.048186368
# [31,] 1.03951884 -1.069551242 -1.10482446 0.614338815 2.085611784
# [32,] 0.21426169 0.486112129 -0.97433203 0.160691516 0.807671026
# [33,] 0.72343166 2.497528693 -1.37148960 -0.018601970 1.191001611
# [34,] 0.64275356 0.015014971 -0.74010357 0.415622711 -0.063514599
# [35,] 1.16097600 -0.371169323 2.08180607 0.317773073 -0.795325645
# [36,] 0.51808311 1.110711933 2.20065384 -0.280720289 -0.251853955
# [37,] 1.37039724 3.326166798 1.36030902 -0.503039443 -0.839558330
# [38,] 1.21285912 0.542062574 0.69030436 0.286314342 -1.128700551
# [39,] 1.02143196 -0.945234047 1.51347908 0.385470403 -0.787550471
# [40,] 0.68444444 0.541939618 1.14422497 0.172811355 -0.927267727
# [41,] 0.80652999 0.692789313 1.74826320 0.270994745 -1.152746174
# [42,] 1.22935683 1.305377471 1.29589149 -0.081221023 -0.618636785
# [43,] 1.28453301 -0.395649111 1.96554481 -0.009589968 -0.386301095
# [44,] -1.18144527 0.403947280 0.24019641 0.743458556 -1.040091711
# [45,] -1.00602893 -1.118573267 -0.23301164 0.260914921 0.343436792
# [46,] 0.28395182 -0.992695195 2.16397324 -0.005298199 -0.432810089
# [47,] 0.46935352 -0.144991439 1.83478624 0.170768426 -0.848633519
# [48,] 0.28512312 -1.034731261 1.63624869 -0.098046757 -0.289382285
# [49,] 0.94131884 0.004590750 1.41692477 -0.433965021 -0.609198631
# [50,] 0.15321531 -0.667605970 1.38997787 0.371708166 -0.707973121
# [51,] -0.19492872 -1.316953907 -1.32152134 -1.387317961 2.848772114
# [52,] 0.23694663 -0.161122531 1.50247360 0.532658807 -1.433079495
# [53,] -1.39507175 -0.319061711 -0.72975302 -1.686183076 0.366872700
# [54,] -0.57031958 -1.883675330 -1.15879566 -2.481965252 1.677916021
# [55,] -2.66066014 -0.995918063 -0.40790041 -2.100146394 -0.021622735
# [56,] -1.22417886 -0.955328800 -1.04545755 -1.286698344 2.326397479
# [57,] -1.80685882 -0.456212673 0.28835290 0.119021588 -1.250105471
# [58,] -0.96557946 -1.001002342 -0.32917174 -0.365433006 1.966316405
# [59,] -1.74349451 -1.730272482 -0.71601292 -3.858099787 0.364373439
# [60,] -0.65919189 -0.552171573 -0.33658933 -0.393761962 0.603623490
# [61,] -0.07921936 -0.375778563 -0.89395612 -0.296846327 0.495321740
# [62,] -0.35593996 -1.450371229 -0.41937155 -0.919862587 -0.971792465
# [63,] -0.80009867 -0.079109525 -0.60752386 -0.917662497 -0.645397074
# [64,] 0.65861820 0.052884698 -0.73225661 0.302951778 -0.805732969
# [65,] 0.75414486 -1.224286246 -0.67008136 0.077666665 -0.938192185
# [66,] 0.39115249 0.848365921 -1.04216384 -0.145732763 -0.287584175
# [67,] -1.03557839 3.286493565 -0.79169134 0.062329865 -0.395773429
# [68,] -1.38045341 -0.622164954 -0.61764540 -2.347540749 -0.650349592
# [69,] 1.29123898 0.064751175 -1.03452503 0.434522127 -0.085921121
# [70,] -2.87786572 0.469185378 0.09727047 0.702921070 -0.340501221
# [71,] -0.31853305 -1.296295622 -0.68321191 -0.094224200 1.293203755
# [72,] -0.62033377 -0.176675365 -0.39133568 0.593410628 0.367909362
# [73,] -0.68251182 -0.562687220 -0.43868244 0.398949336 0.137757269
# [74,] -1.43583245 0.785653466 -0.18979208 0.538263476 -0.015535958
# [75,] -2.75926509 -0.057114082 -0.31062410 -3.254925376 -0.786936068
# [76,] 1.52524315 1.045968122 -1.00271429 0.272498913 -0.770981786
# [77,] 0.24362116 -1.424996156 -0.67080577 0.246711853 -0.004253116
# [78,] 0.91146554 1.523635441 -1.19439611 -0.103377739 0.149948492
# [79,] 0.78416949 0.180753104 -0.92150442 0.085719017 -0.520155909
# [80,] 0.97368533 1.085472571 -1.00083079 -0.268960435 -0.227277194
# [81,] 0.54206248 0.010775882 -0.81428063 -0.123671481 -0.216384428
# [82,] 1.03815982 -1.209389165 -0.64751266 0.711474928 -0.982172157
# [83,] 0.51459855 -0.744710351 -0.71844086 0.672919867 -0.086490946
#
# $loadings
# [,1] [,2] [,3] [,4] [,5]
# [1,] -0.93921916 0.27678629 0.19056337 0.07027279 0.002015891
# [2,] -0.14846641 -0.19210171 -0.09662235 -0.96495034 -0.024282003
# [3,] 0.22168438 0.93454616 -0.19067352 -0.20161311 0.021800808
# [4,] 0.21207162 0.10600135 0.94579078 -0.15249441 0.161290425
# [5,] -0.04131301 -0.04328361 -0.15320947 0.00549353 0.986365269
#
# $prop_expl_var
# [1] 56.40 23.19 14.05 5.65 0.71
#
# attr(,"class")
# [1] "mgpca"
library(plsgenomics)
data(SRBCT)
mydata<-SRBCT$X
mydata<-mydata[,1:5]
groups<-as.factor(SRBCT$Y)
mydata<-split(as.data.frame(mydata),groups)
mdr(g=c(29,11,18,25),grp=groups,data.x=mydata,c=2)
# $variates
# V1 V2
# 1 3.12202176 -0.821840479
# 2 1.59601843 -0.815421086
# 3 3.19351655 -0.675033314
# 4 0.96173934 -0.248191188
# 5 2.62641826 -0.186473588
# 6 1.99336399 -0.697375665
# 7 1.76629017 -0.763485594
# 8 2.62973615 -0.321697736
# 9 2.28264534 -0.590075377
# 10 1.86028044 -0.336384244
# 11 3.51718635 -0.441444760
# 12 2.08399635 -0.366983036
# 13 2.19519126 -0.428479665
# 14 0.81774008 -1.400475271
# 15 0.87611500 -0.529004301
# 16 0.87157853 -1.176914092
# 17 2.51859002 -1.489369550
# 18 0.79927593 -1.964447242
# 19 0.84147391 -1.694077685
# 20 1.31135152 -1.071361224
# 21 2.11366050 -0.458186627
# 22 0.22782228 -0.590485766
# 23 0.90382926 -1.515588029
# 24 3.05356781 -2.408330961
# 25 4.24802863 -0.554183285
# 26 1.90789878 -0.579941444
# 27 1.84484902 -0.333574180
# 28 2.92707061 -0.969156826
# 29 0.68099806 -0.452015376
# 30 0.07902264 -0.986420975
# 31 -0.06985239 -1.514802041
# 32 -0.08656825 -0.270430892
# 33 0.10102938 -0.906384146
# 34 0.10277898 -0.847239929
# 35 0.27888174 -1.526406320
# 36 0.29923080 -1.126845238
# 37 0.04741245 -0.406547431
# 38 0.09384939 -1.022781851
# 39 0.10817210 -1.583933587
# 40 0.09437601 -0.259207594
# 41 1.17583097 -1.078191735
# 42 1.13121560 -2.295174559
# 43 0.71875988 -0.880029695
# 44 0.45768545 -0.653024251
# 45 1.37024418 -1.340190390
# 46 1.00538890 -2.715296664
# 47 0.47357144 -1.200251812
# 48 0.38764563 -0.327760965
# 49 1.00568606 -1.097142484
# 50 1.01066255 -1.189705730
# 51 0.67397690 -1.597442927
# 52 0.28474238 -0.644696642
# 53 0.70601123 -0.878932571
# 54 1.06511637 -1.264522535
# 55 0.73125839 -1.745627267
# 56 0.57328484 -0.964640487
# 57 0.57087070 -1.483461202
# 58 0.74497419 -0.816276902
# 59 2.67267029 -0.780445452
# 60 2.01664477 0.043711589
# 61 1.09467821 -0.139665161
# 62 1.11523969 -0.659996537
# 63 1.01141553 -0.125191926
# 64 0.59592249 -0.788236205
# 65 1.25092103 -0.345112431
# 66 0.89036181 0.074664639
# 67 1.33282685 -0.638146291
# 68 2.30740446 -0.197582836
# 69 1.00584282 0.571725222
# 70 3.31532714 0.439825462
# 71 1.98670759 0.050155344
# 72 2.98186403 -0.138733308
# 73 1.91933878 -0.015127747
# 74 2.04687561 0.827889538
# 75 1.74805569 -0.286574117
# 76 1.19721947 -0.500400564
# 77 1.18396499 0.241875198
# 78 1.91516519 -0.467418666
# 79 0.28362805 -0.154640916
# 80 2.16479920 0.047981812
# 81 1.23465926 0.028026774
# 82 3.52898464 0.040489155
# 83 0.72383697 0.008385486
#
# $loadings
# [,1] [,2]
# [1,] 0.98614287 -0.002436152
# [2,] -0.06903002 0.560697342
# [3,] -0.02923694 -0.819796115
# [4,] -0.14390561 -0.109894629
# [5,] 0.03454657 0.038341319
#
# $prop_expl_dim
# [1] 66.78 25.87 7.36 0.00 0.00
#
# attr(,"class")
# [1] "mdr"