gpca: Main function gpca, Generalized Principal Component of...

Description Usage Arguments Value Author(s) References Examples

Description

Performs an analysis in principal axes of multiple tables of symbolic interval variables. The function uses a class "Resdata" object.

Usage

1
2
3
gpca(xmin = list, xmax = list, reduire = 0, nomVar = NULL, 
axes = c(1, 2), axes2=c(1,2,3), nomInd = NULL, legend = NULL, xlim = NULL,
 ylim = NULL, nametable = NULL, plot3d.table=NULL)

Arguments

xmin

List of all data frames containing all min of initial data. These data have the same number of rows and columns.

xmax

List of all data frames containing all max of initial data. These data have the same number of rows and columns.

reduire

is a logical argument of the Centrage function. To centering without scaling by standard deviation, use reduire=0. Otherwise use reduire=1.

nomVar

Set the column names of all data frames

axes

a length 2 vector specifying the components to plot

axes2

a length 2 vector specifying the components to plot

nomInd

Set the column row names of all data frames

legend

This function could be used to add legends to plots.

xlim

range for the plotted "x" values, defaulting to the range of the finite values of "x"

ylim

range for the plotted "y" values, defaulting to the range of the finite values of "y"

nametable

Set the column names of the tables

plot3d.table

for visualization in 2D and 3D of tables

Value

Returns a list including:

PC

array containing the projections of the min and max of the average of input interval datasets.

Correl

Correlations based on interval variables - dimensions

Pval2

a matrix containing all the eigenvalues, the percentage of variance and the cumulative percentage of variance

PCinterval

array list containing the coordinates of the individuals on the principal axes

Author(s)

Brahim Brahim and Sun Makosso-Kallyth

References

S.Makosso-Kallyth, Analysis of m sets of symbolic interval variables. Revue des Nouvelles Technologies de l"Informatique, vol. RNTI-E25. pp. 97-108, 2013.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
data(Judge1)
data(Judge2)
data(Judge3)

preparation1<-Resdata(list(Judge1,Judge2,Judge3))
List1min<-preparation1$tablemin
List1max<-preparation1$tablemax

# example 1 with the use of some parameters by default
example1<-gpca(xmin=List1min,xmax=List1max,nomInd=paste('Region',1:6),
              nomVar=c('Banana','Coffee','Thea','Cocoa'))

# example 1 with visualization of table containing the coordinates
# of the individuals onto the principal axes
example1<-gpca(xmin=List1min,xmax=List1max,nomInd=paste('Region',1:6),nomVar=c('Banana',
              'Coffee','Thea','Cocoa'),axes=c(1,2),axes2=c(1,2,3),plot3d.table=c(1:3),
			   nametable=paste('Expert',1:3,sep='-'))

# example 1 with visualization of the table 2 and 3 containing
#the coordinates of the individuals onto the principal axes
example1<-gpca(xmin=List1min,xmax=List1max,nomInd=paste('Region',1:6),
              nomVar=c('Banana','Coffee','Thea','Cocoa'),axes=c(1,2),
			  axes2=c(1,2,3),plot3d.table=c(2:3))

#### print numeric output of example1
# input tables onto the axes of the compromise
example1$PCinterval

# Principal components of the compromise
example1$PCCompromise

# Correlation between initial interval variables and principal
#component of the compromise
example1$Correl

# print eigenvalue, % of variance, cumulative % percentage
# of PCA of the compromise
example1$Pval


data(video1)
data(video2)
data(video3)
preparation2<-Resdata(list(video1,video2,video3))
List2min<-preparation2$tablemin
List2max<-preparation2$tablemax

# example2 : analysis of video dataset
example2<-gpca(xmin=List2min,xmax=List2max,nomVar=c('nvisit','nwatch',
'nlike','ncoment','nshare'),
nametable=paste('Video', 1:3))

# example2 : analysis of video dataset with the 3D graphics
example2<-gpca(xmin=List2min,xmax=List2max,nomVar=c('nvisit',
'nwatch','nlike','ncoment','nshare'),nametable=paste('Video', 1:3),
nomInd=paste('Obs',1:10),plot3d.table=c(1,2,3))


data(oils)
preparation3<-Resdata(list(oils))
List3min<-preparation3$tablemin
List3max<-preparation3$tablemax

# example3 Interval Principal component analysis based on min and max
example3<-gpca(xmin=List3min,xmax=List3max,nomInd=rownames(oils),
nomVar=c('Gravity','Freezing','Iodine','Saponification'))

#### print numeric output of example3

# interval Principal components
example3$PCinterval

# Correlation between initial interval variables and principal
#components
example3$Correl

# print eigenvalue, % of variance, cumulative % percentage
# of PCA of the compromise
example3$Pval

# example3 Interval Principal component analysis based on min and max
#with standardisation of variables
example3bis<-gpca(xmin=List3min,xmax=List3max,nomInd=rownames(oils),
nomVar=c('Gravity','Freezing','Iodine','Saponification'),reduire=1)

# interval Principal components
example3bis$PCinterval

# Correlation between initial interval variables and principal
#components
example3bis$Correl

# print eigenvalue, % of variance, cumulative % percentage
# of PCA of the compromise
example3bis$Pval

Example output

Loading required package: scatterplot3d
Loading required package: sqldf
Loading required package: gsubfn
Loading required package: proto
Could not load tcltk.  Will use slower R code instead.
Loading required package: RSQLite
dev.new(): using pdf(file="Rplots1.pdf")
dev.new(): using pdf(file="Rplots2.pdf")
dev.new(): using pdf(file="Rplots3.pdf")
dev.new(): using pdf(file="Rplots4.pdf")
dev.new(): using pdf(file="Rplots5.pdf")
dev.new(): using pdf(file="Rplots6.pdf")
dev.new(): using pdf(file="Rplots7.pdf")
dev.new(): using pdf(file="Rplots8.pdf")
dev.new(): using pdf(file="Rplots9.pdf")
dev.new(): using pdf(file="Rplots10.pdf")
dev.new(): using pdf(file="Rplots11.pdf")
dev.new(): using pdf(file="Rplots12.pdf")
dev.new(): using pdf(file="Rplots13.pdf")
dev.new(): using pdf(file="Rplots14.pdf")
dev.new(): using pdf(file="Rplots15.pdf")
dev.new(): using pdf(file="Rplots16.pdf")
dev.new(): using pdf(file="Rplots17.pdf")
dev.new(): using pdf(file="Rplots18.pdf")
dev.new(): using pdf(file="Rplots19.pdf")
dev.new(): using pdf(file="Rplots20.pdf")
dev.new(): using pdf(file="Rplots21.pdf")
dev.new(): using pdf(file="Rplots22.pdf")
dev.new(): using pdf(file="Rplots23.pdf")
dev.new(): using pdf(file="Rplots24.pdf")
[[1]]
     PCMin.1    PCmax.1    PCMin.2     PCmax.2     PCMin.3     PCmax.3
1 -1.9043828 -1.6906276 -1.6973097 -1.46980541 -0.32840685 -0.23713980
2  0.6648543  0.7170355  0.1383440  0.18996763 -0.29651786 -0.22931097
3  1.8233001  1.9320340  0.1132950  0.14814026  0.05462642  0.09074404
4  1.9751944  1.9985675 -0.1480274 -0.05822476  0.07702845  0.07849832
5 -1.4453316 -1.3771256  0.2951176  0.53211899 -0.08157594  0.09690224
6 -1.5565107 -1.1370076  0.9751102  0.98127362  0.32916072  0.44599125
       PCMin.4     PCmax.4
1 -0.322242415  0.05587024
2 -0.062027447  0.22145976
3 -0.007930257  0.10923748
4 -0.759909103 -0.66987506
5  0.431136944  0.56441518
6  0.135657847  0.30420683

[[2]]
     PCMin.1    PCmax.1    PCMin.2    PCmax.2     PCMin.3     PCmax.3
1 -1.3721097 -1.2850463 -1.8447834 -1.2446613 -0.27484546 -0.09065018
2  0.1005696  0.2463789 -1.3713815 -0.9102382 -0.37663737  0.08622497
3  1.6325415  1.6735795  0.4749717  0.9530985  0.06097001  0.37048551
4  1.9974705  2.0757157  0.2746279  0.7343251 -0.01208360  0.40077155
5 -1.1616927 -0.9340642  0.7951728  0.7952078 -0.24061029 -0.05928570
6 -1.6112550 -1.3620879  0.6115381  0.7321224  0.06483170  0.07082887
      PCMin.4     PCmax.4
1  0.70485335  0.82128562
2 -0.41096683  0.02181701
3  0.51543312  0.67702477
4 -0.48010353 -0.43990933
5 -1.05654835 -0.38698116
6 -0.05866723  0.09276254

[[3]]
     PCMin.1    PCmax.1    PCMin.2    PCmax.2     PCMin.3     PCmax.3
1 -0.3580956 -0.1361526 -0.8274940 -0.8201524  0.59519733  0.95264381
2  0.7892446  0.8717568 -0.2017383 -0.1120540 -0.67004036 -0.66255124
3  2.6832210  2.8291702  0.1402089  0.2305543 -0.52305273 -0.38570872
4  0.1711216  0.1768957 -0.4451009 -0.2965103  0.64426819  0.69736516
5 -1.6111417 -1.3813749  0.4810522  0.5803501 -0.05201749  0.04808676
6 -2.1383522 -1.8962929  0.5154993  0.7553851 -0.35929054 -0.28490018
      PCMin.4     PCmax.4
1 -0.63003738 -0.50809007
2 -0.07937279  0.09854730
3 -0.55899758 -0.43656706
4  1.02971630  1.13318317
5 -0.24486740  0.07855425
6 -0.13973020  0.25766145

     PCMin.1    PCmax.1    PCMin.2    PCmax.2     PCMin.3     PCmax.3
1 -1.1402776 -1.1085272 -1.4540819 -1.1806535  0.05871343  0.14688618
2  0.5182229  0.6117237 -0.4483638 -0.3073363 -0.42532957 -0.29094805
3  2.0463542  2.1449279  0.2428252  0.4439310 -0.09003743 -0.02060773
4  1.3831869  1.4151349 -0.1061668  0.1265300  0.23689430  0.39172172
5 -1.4060553 -1.2308549  0.5568918  0.6027814 -0.12473457  0.02856776
6 -1.7687059 -1.4651295  0.7027704  0.8208726  0.03636408  0.05250986
      PCMin.4      PCmax.4
1 -0.04182638  0.082372826
2 -0.18412235  0.113941355
3  0.03669898  0.062701182
4 -0.05670071 -0.005598472
5 -0.13785964 -0.066903872
6  0.08574639  0.111550691
       Component 1 Component 2 Component 3  Component 4
Banana   0.9475776  0.28760035 -0.06420047 -0.123535371
Coffee  -0.9788854  0.01704021 -0.20342589 -0.010529542
Thea    -0.9082117 -0.40071121  0.10574003 -0.058318485
Cocoa   -0.7314283  0.67698066  0.08178909 -0.004518791
       eigenvalue percentage of variance cumulative percentage of variance
comp 1 4.10714018             78.9645203                          78.96452
comp 2 0.98804906             18.9963859                          97.96091
comp 3 0.08818825              1.6955212                          99.65643
comp 4 0.01787006              0.3435726                         100.00000
dev.new(): using pdf(file="Rplots25.pdf")
dev.new(): using pdf(file="Rplots26.pdf")
dev.new(): using pdf(file="Rplots27.pdf")
dev.new(): using pdf(file="Rplots28.pdf")
dev.new(): using pdf(file="Rplots29.pdf")
dev.new(): using pdf(file="Rplots30.pdf")
dev.new(): using pdf(file="Rplots31.pdf")
dev.new(): using pdf(file="Rplots32.pdf")
dev.new(): using pdf(file="Rplots33.pdf")
dev.new(): using pdf(file="Rplots34.pdf")
dev.new(): using pdf(file="Rplots35.pdf")
dev.new(): using pdf(file="Rplots36.pdf")
dev.new(): using pdf(file="Rplots37.pdf")
dev.new(): using pdf(file="Rplots38.pdf")
dev.new(): using pdf(file="Rplots39.pdf")
dev.new(): using pdf(file="Rplots40.pdf")
dev.new(): using pdf(file="Rplots41.pdf")
dev.new(): using pdf(file="Rplots42.pdf")
       PCMin.1     PCmax.1     PCMin.2    PCmax.2    PCMin.3    PCmax.3
1 -2.777942976 -1.86800934 -0.72797797  1.1742529 -0.9088893 -0.1684641
2 -1.427877361 -1.19250193 -1.37224148 -1.0972948 -0.5752133 -0.4181994
3 -0.118956988 -0.07267297 -0.31996162 -0.3167105  0.4211059  0.4495401
4 -1.033084069 -0.27195335 -0.33313137  0.9257008 -0.1160384  0.3729293
5 -0.875403208 -0.46821222 -0.04131050  1.3592194  0.4381686  1.1656965
6 -0.001737265  0.22466975 -0.04997672  0.3970405  0.2423624  0.4398678
7  2.449889906  2.56662173  0.23544143  0.5165745 -0.4774781 -0.3122823
8  2.155007810  2.71216248 -0.77216778  0.4225431 -0.4380188 -0.1150868
     PCMin.4      PCmax.4
1  0.2160371  0.342281865
2 -0.1358097 -0.098052444
3 -0.1196108 -0.005565342
4 -0.2648157 -0.207579595
5  0.1884373  0.406702409
6 -0.3927452 -0.346653211
7 -0.1547665 -0.084390324
8  0.2713041  0.385226101
               Component 1 Component 2 Component 3 Component 4
Gravity         -0.9483807  -0.1604614   0.1845905 -0.20187270
Freezing         0.9362286  -0.0627428  -0.2991362 -0.17336920
Iodine          -0.8118563  -0.4627703  -0.3511809  0.05835227
Saponification   0.7251872  -0.6469225   0.2344409  0.02514482
       eigenvalue percentage of variance cumulative percentage of variance
comp 1  5.1816748              74.023926                          74.02393
comp 2  1.1591118              16.558740                          90.58267
comp 3  0.5282316               7.546166                          98.12883
comp 4  0.1309818               1.871168                         100.00000
dev.new(): using pdf(file="Rplots43.pdf")
dev.new(): using pdf(file="Rplots44.pdf")
     PCMin.1    PCmax.1    PCMin.2    PCmax.2    PCMin.3    PCmax.3
1 -88.902038 -79.261269  -8.314733  46.032639  -6.962809  25.248600
2 -89.251536 -86.082264 -27.061680 -17.939659   3.369509   4.002519
3   2.986508   3.269241  -4.370036   3.002492  -8.975449  -5.408637
4  -1.799106  -1.267630  -4.021274   7.897671  -7.189329  -4.439322
5  16.974239  28.792078  10.964405  22.444283 -26.267866 -17.159775
6  23.693967  26.537784  -1.223200   6.328128  -5.379904  -1.374109
7  68.817983  75.029000 -10.800809  -3.631286  12.000982  17.238101
8  46.075834  54.387210  -9.786896  -9.520046   7.193457  14.104032
       PCMin.4      PCmax.4
1 -0.013877666 -0.001677701
2  0.001647901  0.004104825
3  0.002363158  0.005346489
4  0.007669855  0.008832632
5 -0.010859778 -0.006642694
6  0.013436084  0.015013543
7 -0.003321378  0.005846788
8 -0.015861174 -0.012020886
               Component 1 Component 2 Component 3   Component 4
Gravity         -0.7986670  0.23710871 -0.43018703  3.476343e-01
Freezing         0.6916349 -0.48693247  0.53342098  5.077643e-07
Iodine          -0.9966081 -0.07716975  0.02858404 -3.144872e-08
Saponification   0.4228250 -0.78155566 -0.45868261 -1.040742e-07
         eigenvalue percentage of variance cumulative percentage of variance
comp 1 5.926919e+03           8.724434e+01                          87.24434
comp 2 5.413405e+02           7.968542e+00                          95.21289
comp 3 3.252110e+02           4.787111e+00                         100.00000
comp 4 1.744089e-04           2.567302e-06                         100.00000

GPCSIV documentation built on May 1, 2019, 9:04 p.m.

Related to gpca in GPCSIV...