1 Introduction

Glass is made from different materials. The most important ingredient is silica in the sand. To make ordinary glass, sodium carbonate and limestone (calcium carbonate) are added. The green glass is caused by iron impurities in the sand. Modern glass incorporates other ingredients to improve color and some of its properties, such as heat resistance. In this analysis report of Glass Classification we will make Clustering for Business Decision Making by applying PCA Analysis & K-Means Clustering Method in the provided data.

The provided data is from the archive of https://archive.ics.uci.edu/ml/datasets/Glass+Identification from B. German and Vina Spiehler (more contact on acknowledgment section in the end)

2 Call Library

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
library(factoextra)
## Warning: package 'factoextra' was built under R version 4.2.2
## Loading required package: ggplot2
## Warning: package 'ggplot2' was built under R version 4.2.2
## Welcome! Want to learn more? See two factoextra-related books at https://goo.gl/ve3WBa
library(FactoMineR)
## Warning: package 'FactoMineR' was built under R version 4.2.2

3 Read Data

glass <- read.csv("data/glass.csv",
                 stringsAsFactors = T)
head(glass)
##        RI    Na   Mg   Al    Si    K   Ca Ba   Fe Type
## 1 1.52101 13.64 4.49 1.10 71.78 0.06 8.75  0 0.00    1
## 2 1.51761 13.89 3.60 1.36 72.73 0.48 7.83  0 0.00    1
## 3 1.51618 13.53 3.55 1.54 72.99 0.39 7.78  0 0.00    1
## 4 1.51766 13.21 3.69 1.29 72.61 0.57 8.22  0 0.00    1
## 5 1.51742 13.27 3.62 1.24 73.08 0.55 8.07  0 0.00    1
## 6 1.51596 12.79 3.61 1.62 72.97 0.64 8.07  0 0.26    1

This is a Glass Identification Data Set from UCI. It contains 7 attributes components of glass material including id and type of glass usage in Industry.

4 Data Cleansing

4.1 Removing Data

glass_clean <- glass %>%
  
  # delet non-numeric colomn
  select(-c(Type))

head(glass_clean)
##        RI    Na   Mg   Al    Si    K   Ca Ba   Fe
## 1 1.52101 13.64 4.49 1.10 71.78 0.06 8.75  0 0.00
## 2 1.51761 13.89 3.60 1.36 72.73 0.48 7.83  0 0.00
## 3 1.51618 13.53 3.55 1.54 72.99 0.39 7.78  0 0.00
## 4 1.51766 13.21 3.69 1.29 72.61 0.57 8.22  0 0.00
## 5 1.51742 13.27 3.62 1.24 73.08 0.55 8.07  0 0.00
## 6 1.51596 12.79 3.61 1.62 72.97 0.64 8.07  0 0.26

Then we check the structure of the data.

glimpse(glass_clean)
## Rows: 214
## Columns: 9
## $ RI <dbl> 1.52101, 1.51761, 1.51618, 1.51766, 1.51742, 1.51596, 1.51743, 1.51…
## $ Na <dbl> 13.64, 13.89, 13.53, 13.21, 13.27, 12.79, 13.30, 13.15, 14.04, 13.0…
## $ Mg <dbl> 4.49, 3.60, 3.55, 3.69, 3.62, 3.61, 3.60, 3.61, 3.58, 3.60, 3.46, 3…
## $ Al <dbl> 1.10, 1.36, 1.54, 1.29, 1.24, 1.62, 1.14, 1.05, 1.37, 1.36, 1.56, 1…
## $ Si <dbl> 71.78, 72.73, 72.99, 72.61, 73.08, 72.97, 73.09, 73.24, 72.08, 72.9…
## $ K  <dbl> 0.06, 0.48, 0.39, 0.57, 0.55, 0.64, 0.58, 0.57, 0.56, 0.57, 0.67, 0…
## $ Ca <dbl> 8.75, 7.83, 7.78, 8.22, 8.07, 8.07, 8.17, 8.24, 8.30, 8.40, 8.09, 8…
## $ Ba <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0…
## $ Fe <dbl> 0.00, 0.00, 0.00, 0.00, 0.00, 0.26, 0.00, 0.00, 0.00, 0.11, 0.24, 0…

4.2 Check Missing value

anyNA(glass_clean)
## [1] FALSE
colSums(is.na(glass_clean))
## RI Na Mg Al Si  K Ca Ba Fe 
##  0  0  0  0  0  0  0  0  0

There is no missing value therefore we can proceed with EDA process

5 Exploratory Data Analysis (EDA)

summary(glass_clean)
##        RI              Na              Mg              Al       
##  Min.   :1.511   Min.   :10.73   Min.   :0.000   Min.   :0.290  
##  1st Qu.:1.517   1st Qu.:12.91   1st Qu.:2.115   1st Qu.:1.190  
##  Median :1.518   Median :13.30   Median :3.480   Median :1.360  
##  Mean   :1.518   Mean   :13.41   Mean   :2.685   Mean   :1.445  
##  3rd Qu.:1.519   3rd Qu.:13.82   3rd Qu.:3.600   3rd Qu.:1.630  
##  Max.   :1.534   Max.   :17.38   Max.   :4.490   Max.   :3.500  
##        Si              K                Ca               Ba       
##  Min.   :69.81   Min.   :0.0000   Min.   : 5.430   Min.   :0.000  
##  1st Qu.:72.28   1st Qu.:0.1225   1st Qu.: 8.240   1st Qu.:0.000  
##  Median :72.79   Median :0.5550   Median : 8.600   Median :0.000  
##  Mean   :72.65   Mean   :0.4971   Mean   : 8.957   Mean   :0.175  
##  3rd Qu.:73.09   3rd Qu.:0.6100   3rd Qu.: 9.172   3rd Qu.:0.000  
##  Max.   :75.41   Max.   :6.2100   Max.   :16.190   Max.   :3.150  
##        Fe         
##  Min.   :0.00000  
##  1st Qu.:0.00000  
##  Median :0.00000  
##  Mean   :0.05701  
##  3rd Qu.:0.10000  
##  Max.   :0.51000

Interpretation: The range is different, so to do PCA, normalization (data standardization) will be carried out with the help of the scale function.

Let’s also check the covariance matrix of Glass:

cov(glass_clean)
##               RI            Na            Mg            Al           Si
## RI  9.222541e-06 -0.0004758592 -0.0005356087 -0.0006175934 -0.001275010
## Na -4.758592e-04  0.6668413672 -0.3224221359  0.0639256198 -0.044153850
## Mg -5.356087e-04 -0.3224221359  2.0805403909 -0.3469674148 -0.185375148
## Al -6.175934e-04  0.0639256198 -0.3469674148  0.2492701790 -0.002136062
## Si -1.275010e-03 -0.0441538502 -0.1853751481 -0.0021360625  0.599921188
## K  -5.740478e-04 -0.1417129305  0.0050758479  0.1061384560 -0.097661555
## Ca  3.502498e-03 -0.3201060901 -0.9109157453 -0.1844498157 -0.230084941
## Ba -5.828836e-07  0.1326108990 -0.3530469264  0.1190103330 -0.039340419
## Fe  4.231770e-05 -0.0192036418  0.0116737133 -0.0036195296 -0.007109398
##                K           Ca            Ba            Fe
## RI -0.0005740478  0.003502498 -5.828836e-07  0.0000423177
## Na -0.1417129305 -0.320106090  1.326109e-01 -0.0192036418
## Mg  0.0050758479 -0.910915745 -3.530469e-01  0.0116737133
## Al  0.1061384560 -0.184449816  1.190103e-01 -0.0036195296
## Si -0.0976615550 -0.230084941 -3.934042e-02 -0.0071093984
## K   0.4253542034 -0.295005697 -1.382028e-02 -0.0004905357
## Ca -0.2950056974  2.025365848 -7.984845e-02  0.0173293712
## Ba -0.0138202843 -0.079848449  2.472270e-01 -0.0028435216
## Fe -0.0004905357  0.017329371 -2.843522e-03  0.0094943004
# variance that summarize from each PC
plot(prcomp(glass_clean))

Interpretation: The variance of each variable is much different because the range of each variable is different, as well as covariance. The value of variance and covariance is affected by the scale of the data. The higher the scale, the higher the variance or covariance value.

6 Data Preprocessing: Scaling

Scaling is done so that the variables have a scale that is not much different. The scaling value used is Z-score (mean = 0, standard deviation = 1)

# scaling
glass_clean_z <- scale(glass_clean)
head(glass_clean_z)
##              RI         Na        Mg         Al          Si           K
## [1,]  0.8708258  0.2842867 1.2517037 -0.6908222 -1.12444556 -0.67013422
## [2,] -0.2487502  0.5904328 0.6346799 -0.1700615  0.10207972 -0.02615193
## [3,] -0.7196308  0.1495824 0.6000157  0.1904651  0.43776033 -0.16414813
## [4,] -0.2322859 -0.2422846 0.6970756 -0.3102663 -0.05284979  0.11184428
## [5,] -0.3113148 -0.1688095 0.6485456 -0.4104126  0.55395746  0.08117845
## [6,] -0.7920739 -0.7566101 0.6416128  0.3506992  0.41193874  0.21917466
##              Ca         Ba         Fe
## [1,] -0.1454254 -0.3520514 -0.5850791
## [2,] -0.7918771 -0.3520514 -0.5850791
## [3,] -0.8270103 -0.3520514 -0.5850791
## [4,] -0.5178378 -0.3520514 -0.5850791
## [5,] -0.6232375 -0.3520514 -0.5850791
## [6,] -0.6232375 -0.3520514  2.0832652
cov(glass_clean_z)
##               RI          Na           Mg          Al          Si            K
## RI  1.0000000000 -0.19188538 -0.122274039 -0.40732603 -0.54205220 -0.289832711
## Na -0.1918853790  1.00000000 -0.273731961  0.15679367 -0.06980881 -0.266086504
## Mg -0.1222740393 -0.27373196  1.000000000 -0.48179851 -0.16592672  0.005395667
## Al -0.4073260341  0.15679367 -0.481798509  1.00000000 -0.00552372  0.325958446
## Si -0.5420521997 -0.06980881 -0.165926723 -0.00552372  1.00000000 -0.193330854
## K  -0.2898327111 -0.26608650  0.005395667  0.32595845 -0.19333085  1.000000000
## Ca  0.8104026963 -0.27544249 -0.443750026 -0.25959201 -0.20873215 -0.317836155
## Ba -0.0003860189  0.32660288 -0.492262118  0.47940390 -0.10215131 -0.042618059
## Fe  0.1430096093 -0.24134641  0.083059529 -0.07440215 -0.09420073 -0.007719049
##            Ca            Ba           Fe
## RI  0.8104027 -0.0003860189  0.143009609
## Na -0.2754425  0.3266028795 -0.241346411
## Mg -0.4437500 -0.4922621178  0.083059529
## Al -0.2595920  0.4794039017 -0.074402151
## Si -0.2087322 -0.1021513105 -0.094200731
## K  -0.3178362 -0.0426180594 -0.007719049
## Ca  1.0000000 -0.1128409671  0.124968219
## Ba -0.1128410  1.0000000000 -0.058691755
## Fe  0.1249682 -0.0586917554  1.000000000
# re-visit the variance that summarize each PC
plot(prcomp(glass_clean_z))

Interpretation: Now, PC1 no longer dominates other PCs in the magnitude of the variance captured.

7 Principal Component Analysis

# make PCA with prcomp()
pca <- prcomp(glass_clean_z)  
pca
## Standard deviations (1, .., p=9):
## [1] 1.58466518 1.43180731 1.18526115 1.07604017 0.95603465 0.72638502 0.60741950
## [8] 0.25269141 0.04011007
## 
## Rotation (n x k) = (9 x 9):
##           PC1         PC2           PC3         PC4          PC5         PC6
## RI -0.5451766  0.28568318 -0.0869108293 -0.14738099  0.073542700 -0.11528772
## Na  0.2581256  0.27035007  0.3849196197 -0.49124204 -0.153683304  0.55811757
## Mg -0.1108810 -0.59355826 -0.0084179590 -0.37878577 -0.123509124 -0.30818598
## Al  0.4287086  0.29521154 -0.3292371183  0.13750592 -0.014108879  0.01885731
## Si  0.2288364 -0.15509891  0.4587088382  0.65253771 -0.008500117 -0.08609797
## K   0.2193440 -0.15397013 -0.6625741197  0.03853544  0.307039842  0.24363237
## Ca -0.4923061  0.34537980  0.0009847321  0.27644322  0.188187742  0.14866937
## Ba  0.2503751  0.48470218 -0.0740547309 -0.13317545 -0.251334261 -0.65721884
## Fe -0.1858415 -0.06203879 -0.2844505524  0.23049202 -0.873264047  0.24304431
##            PC7         PC8         PC9
## RI -0.08186724 -0.75221590 -0.02573194
## Na -0.14858006 -0.12769315  0.31193718
## Mg  0.20604537 -0.07689061  0.57727335
## Al  0.69923557 -0.27444105  0.19222686
## Si -0.21606658 -0.37992298  0.29807321
## K  -0.50412141 -0.10981168  0.26050863
## Ca  0.09913463  0.39870468  0.57932321
## Ba -0.35178255  0.14493235  0.19822820
## Fe -0.07372136 -0.01627141  0.01466944

There are three main components in a paca object:

7.1 Standard Deviation

pca$sdev: the standard deviation (root variance) captured by each PC, also referred to as the eigenvalue. Used to find out how much information each PC captures.

# Variance that captured from every PC
# std
pca$sdev
## [1] 1.58466518 1.43180731 1.18526115 1.07604017 0.95603465 0.72638502 0.60741950
## [8] 0.25269141 0.04011007
# variance
pca$sdev^2
## [1] 2.511163726 2.050072185 1.404843994 1.157862446 0.914002247 0.527635193
## [7] 0.368958443 0.063852948 0.001608818
# variance shown in the form of PCA plot
plot(pca)

7.2 PCA Rotation

pca$rotation: a rotational matrix that serves as a formula for projecting points onto each PC, this matrix consists of eigen vectors. Used to find out the contribution of each variable to the PC.

data.frame(pca$rotation)
##           PC1         PC2           PC3         PC4          PC5         PC6
## RI -0.5451766  0.28568318 -0.0869108293 -0.14738099  0.073542700 -0.11528772
## Na  0.2581256  0.27035007  0.3849196197 -0.49124204 -0.153683304  0.55811757
## Mg -0.1108810 -0.59355826 -0.0084179590 -0.37878577 -0.123509124 -0.30818598
## Al  0.4287086  0.29521154 -0.3292371183  0.13750592 -0.014108879  0.01885731
## Si  0.2288364 -0.15509891  0.4587088382  0.65253771 -0.008500117 -0.08609797
## K   0.2193440 -0.15397013 -0.6625741197  0.03853544  0.307039842  0.24363237
## Ca -0.4923061  0.34537980  0.0009847321  0.27644322  0.188187742  0.14866937
## Ba  0.2503751  0.48470218 -0.0740547309 -0.13317545 -0.251334261 -0.65721884
## Fe -0.1858415 -0.06203879 -0.2844505524  0.23049202 -0.873264047  0.24304431
##            PC7         PC8         PC9
## RI -0.08186724 -0.75221590 -0.02573194
## Na -0.14858006 -0.12769315  0.31193718
## Mg  0.20604537 -0.07689061  0.57727335
## Al  0.69923557 -0.27444105  0.19222686
## Si -0.21606658 -0.37992298  0.29807321
## K  -0.50412141 -0.10981168  0.26050863
## Ca  0.09913463  0.39870468  0.57932321
## Ba -0.35178255  0.14493235  0.19822820
## Fe -0.07372136 -0.01627141  0.01466944

7.3 New Data Value: PCA X

pca$x the resulting value of the projected point to the PC for each row. Used to get new data values.

# data hasil proyeksi
as.data.frame(pca$x)
##              PC1         PC2          PC3           PC4         PC5
## 1   -1.148446843 -0.52824907  0.371225255 -1.7248568105  0.25134650
## 2    0.572794160 -0.75801049  0.555405924 -0.7584539597  0.25646936
## 3    0.937960515 -0.92766091  0.553609408 -0.2057718428  0.23695030
## 4    0.141750924 -0.95942790  0.116850709 -0.4147515674  0.47518475
## 5    0.350271021 -1.08869658  0.483944005 -0.0689406529  0.43107920
## 6    0.289587596 -1.32091046 -0.866646619  0.9256271150 -1.81041578
## 7    0.252080399 -1.11353870  0.539373202 -0.0801402072  0.45745086
## 8    0.120018063 -1.21898810  0.623280854  0.1157506818  0.49341814
## 9    0.020767338 -0.32117955  0.108804570 -1.3684635985  0.37463504
## 10   0.002346727 -1.06332030 -0.120572324  0.3751414534 -0.44843827
## 11   0.381620164 -1.37690564 -0.687911388  1.1548529059 -1.59526869
## 12   0.013322630 -1.10213499  0.144462275  0.2405245805  0.60944640
## 13   0.308999887 -1.41971148 -0.484926709  1.0744886211 -1.61068277
## 14  -0.156154882 -1.23303717 -0.139379929  0.7700931118 -0.97473109
## 15   0.089746238 -1.17848894  0.215034763  0.6072786736  0.62964517
## 16   0.114985420 -1.15756800  0.333239665  0.4155419550  0.58406637
## 17  -0.173052569 -1.17967372  0.203528766  0.3816328266  0.66149090
## 18  -1.454712901  0.09861017  0.485746132 -2.3646823834  0.29945807
## 19  -0.546035993 -0.29496853  0.701291213 -1.2538048999  0.23400049
## 20   0.308094642 -0.76137698 -0.329388809  0.1717920231 -0.10872667
## 21  -0.205192769 -0.99684539 -0.634539069  0.5433672707 -1.12776253
## 22  -1.213208879 -0.43587413  1.653753272 -2.1188842738  0.10854485
## 23  -0.041071630 -1.02547897  0.009772241  0.1229303264  0.62575091
## 24   0.112941203 -1.02521801  0.086005091  0.3014342156  0.62337700
## 25   0.147178281 -0.93158280  0.516972396 -0.2445061170  0.44445717
## 26   0.050368425 -1.04478108  0.212549641  0.1354472052  0.60746551
## 27   0.155409596 -0.73642288  0.028810565 -0.2724098526  0.53316915
## 28   0.216585957 -1.03703567  0.209275686  0.2802505628  0.56346809
## 29   0.114824408 -1.05047634  0.038586273  0.5755947771  0.64498663
## 30   0.065683485 -0.90076385  0.175949905 -0.0306774280  0.56850026
## 31  -0.297563762 -1.16216838 -0.324185111  0.7788437611 -0.58697467
## 32   0.022184328 -1.16001759  0.449166058  0.4451783444  0.59241090
## 33  -0.395658424 -1.07056331 -0.497469340  0.7040730014 -1.39254224
## 34   0.068924668 -1.16118163  0.017364209  0.9240585453  0.12024705
## 35  -0.081562535 -0.96375973  0.036503202  0.3323683008  0.65494792
## 36   0.388008888 -1.00741797  0.353057923 -0.1483908082  0.47489599
## 37  -0.256820650 -0.09870461 -0.051218092 -1.4411483670  0.39367260
## 38  -0.026979837 -0.93894934 -0.015419761  0.3129696922  0.67737203
## 39  -1.928590539 -0.14178187  0.971056260 -1.9658570205  0.37844933
## 40  -1.928590539 -0.14178187  0.971056260 -1.9658570205  0.37844933
## 41  -0.213478266 -1.06256034  0.202365548  0.2926908461  0.68291325
## 42  -0.017324756 -1.09835639  0.274628190  0.5173143752  0.65076122
## 43   0.098872422 -0.74506000  0.157275658 -0.1318372421  0.55958633
## 44  -1.903383686 -0.13483009  0.513922964 -1.5839050048  0.51011688
## 45  -0.753472266 -1.19150824 -0.772515223  1.0089734478 -2.00199097
## 46  -0.414177960 -0.29260121 -0.197869624 -0.9822537857  0.57219482
## 47  -0.603009537 -0.77837482 -0.249165126  0.1906762302 -0.82009431
## 48  -2.964411026  0.46205713  0.261094551 -1.8449299890 -0.37004649
## 49  -2.067962926 -0.19322084  0.396383105 -0.9939418999  0.63081373
## 50  -0.392192030 -0.33946226 -0.038692283 -0.9399317350  0.57479889
## 51  -2.720831501 -0.11277416  0.225399358 -1.2301085988 -0.87434164
## 52  -0.721377492 -0.47378107 -0.423976206 -0.1645345439 -0.30039776
## 53  -0.105912122 -0.41353643  0.436352469 -0.0297550675  0.61216117
## 54  -0.180936809 -0.40899893  0.238132445  0.1794857000  0.67896654
## 55  -0.171403012 -0.50909413  0.136450864  0.4869834635 -0.17967551
## 56  -0.458182481 -0.96979793 -0.280883058  1.9469375204 -1.35366315
## 57   0.422208437 -1.81230677 -0.452330029  1.0691808961 -2.33481319
## 58  -0.015803508 -0.95521440  0.112238600  0.1457878535  0.60936056
## 59   0.326476940 -1.09978334  0.530991959 -0.3331146990  0.40069610
## 60  -0.037285663 -1.05185437  0.056765191 -0.1153089853 -0.53740673
## 61  -0.456237146 -0.55062038  0.834996791 -0.6432518396  0.31516964
## 62  -0.235668276  0.56700077  0.147767878 -1.7147353720 -0.06942653
## 63  -1.880429045 -0.29578219 -0.048976438 -1.1441284233 -0.44828554
## 64  -1.902003672  0.18475364  0.606925487 -2.1976147153  0.35015476
## 65  -1.763255868 -0.23430181  0.222300088 -0.9876925303 -0.09113910
## 66  -1.204275509 -0.01677727  0.464003138 -1.2324312553  0.41605089
## 67  -2.090457226 -0.42601501 -0.131908081 -0.2432589907 -0.86858279
## 68  -2.060912640 -0.44603951 -0.072685135 -0.1590112016 -0.86968023
## 69  -2.000195008 -0.36264837 -0.141596362 -0.3026924257 -0.77190490
## 70  -2.246687624  0.02790854  0.325493827 -0.9337981478  0.39232356
## 71   1.108031745 -0.35961601  0.280291857 -1.7158206820 -1.26692466
## 72  -0.747591211 -0.86805941 -0.980361673 -0.5389940990 -2.46239781
## 73   0.932881463 -1.20112937  0.147040580  0.1739669174  0.44806672
## 74   0.879271955 -0.97003865  0.145935881 -0.1615039917  0.39273028
## 75   0.920404247 -1.19412945  0.055347471  0.2529835594  0.49665636
## 76   0.875987173 -1.20610130  0.113172374  0.2606878580  0.48803938
## 77   0.683486067 -0.83967114 -0.126353608 -0.6214622177  0.42204284
## 78   0.688744268 -1.06380504 -0.017044634  0.0295195707  0.47601440
## 79   0.461914711 -0.98593559  0.476870331 -0.2415521421 -1.06865153
## 80   1.071986894 -0.96253189 -0.391904137  0.2870674530  0.52397126
## 81   1.210858930 -0.77727570 -0.637143984  0.1541296777  0.51290555
## 82   0.907062903 -1.13633552  0.385057615  0.1509494864  0.40743801
## 83   0.534404350 -1.06728175  0.279272670 -0.2993944880  0.45532641
## 84   0.649880372 -1.11386078 -0.281574873  0.2625774851 -0.31681885
## 85   2.310957633 -0.57263981 -0.542875215 -0.9601296877  0.32444693
## 86   0.618078428 -0.87501030  0.283711016 -0.2689491226  0.35755341
## 87   0.865733629 -1.07549645  0.641758843  0.2559552429  0.31227446
## 88   0.535049604 -0.92131867 -0.279391824 -0.1054967634 -0.44734157
## 89   0.649380950 -1.06175662  0.076026153  0.0978529022  0.48571099
## 90   0.753625777 -1.09669524 -0.496044621  0.9699016858 -0.23319282
## 91  -0.989339128 -1.01950958 -0.826467898  0.0448572384 -1.29040497
## 92   0.561325997 -1.06331730  0.311359384  0.3407327827  0.45189428
## 93   0.306078725 -0.96181127  0.274129756  0.8797100999 -1.45806298
## 94   0.732885652 -0.92022927  0.537762200  0.1962808871  0.36168223
## 95   0.653714815 -1.14035879  0.085804075  0.6763940268  0.60365095
## 96  -0.094419371 -0.45509758 -0.076211910 -0.6683683840  0.51386808
## 97  -0.902171426 -0.89608666 -0.510371923 -0.0735566444 -0.64648025
## 98  -0.612459362 -1.39906120 -0.458608726  1.7784299129 -1.34673910
## 99   0.652579399 -0.70923980 -0.194875405  0.8529481865  0.72670902
## 100  0.133270547 -0.41103490  0.030726432  0.2802260655  0.60701027
## 101  0.022594935 -0.80845352 -0.429582833  1.3354455416 -1.35659135
## 102  0.072201040 -0.51545452 -0.474160583  0.8913514201  0.89367086
## 103 -0.981204161 -1.01772225  0.483211623  1.7356726879 -1.05856842
## 104 -3.843370505  1.34191831 -0.168879778 -2.3500711451  0.90436868
## 105 -2.345864419  1.13753133 -0.056539312 -1.6856064797  0.71067182
## 106 -3.325489759  2.02142921 -2.764831118  2.8711695115 -0.98833757
## 107 -3.631698232  6.17895704 -4.905112880  0.0567794593 -1.83040027
## 108 -7.121999125  3.99506958 -2.253856170  0.2574396209  0.08261555
## 109 -1.691057932  2.06929378  1.055945888  0.3722184019  0.17763763
## 110 -0.739858727  0.78350436  2.515983086  2.0757233714  0.80613623
## 111 -4.508174751  2.02298240  0.229873693  2.8929923531  1.97523590
## 112 -4.861635479  2.10617054  0.045815414  2.9222822422  2.07193707
## 113 -4.585745031  2.69313310  0.162203333  0.9090086613  1.74434831
## 114 -0.323226651 -0.91302971 -0.226640482 -0.3926394033 -0.80786215
## 115 -0.258602691 -1.01607386 -0.024882309 -0.5896170425  0.53811036
## 116 -0.028560236 -0.80182435  0.085468307 -0.8010545700  0.42087385
## 117 -0.186277287 -0.88672993 -0.404767376 -0.4685130923 -0.42723822
## 118  0.833021446 -0.52246571 -0.366078469 -1.0728324989  0.34535097
## 119  0.062966211 -1.08825359 -0.947457846  0.2418896414 -2.15239399
## 120  0.687034382 -0.84256912  0.030404857 -0.6700525065  0.38722704
## 121 -0.093117107 -0.79564812 -0.041197784 -0.6242683151  0.51316316
## 122  0.325189921 -1.15859792 -0.679407371  0.6928045513 -1.37161460
## 123  0.570672276 -0.92587090  0.170757964 -0.1268546052  0.43666460
## 124  0.779587582 -0.64038561 -0.118989257 -0.4952658556  0.41030948
## 125 -0.791185959 -0.60291463  0.200491427 -0.4696803943  0.60541977
## 126 -0.272108434 -0.75907116 -0.642807732  0.0487903289 -0.47753180
## 127  0.121066173 -1.06021781  0.131498420 -0.0003670475  0.55372598
## 128 -1.113133982  0.61898725 -0.569769365 -0.3099875829 -0.77791876
## 129 -0.639406292  0.89846847 -0.800139510 -0.0135953058 -0.88505299
## 130 -1.063446961  1.36437865 -0.647821035 -0.1394985260 -0.79663979
## 131 -1.374166428  1.59961314  0.220350791 -0.0168146211  0.97833235
## 132 -3.410946173  3.12756662 -0.633112032 -0.0588898519  0.53248541
## 133  0.002295681 -1.02207703  0.196671115 -0.7904610243  0.42020806
## 134 -0.094095789 -0.64350258 -0.704660813 -1.0490788767 -0.98929059
## 135  0.120254788 -1.01336614  0.337385821 -0.4409698160  0.41230049
## 136 -0.613006461 -1.08900951 -0.869730035  0.0017255183 -2.02041021
## 137 -0.336892385 -1.28808449  0.076638408  0.3073310593 -0.54315296
## 138  0.540055552 -1.02896747 -0.035912893  0.1758038021  0.52061499
## 139  0.764433983 -1.21633493  0.133856591  0.5710687112  0.53126555
## 140  0.773019346 -1.07892467 -0.014680290  0.3715267033  0.51956621
## 141  0.656788819 -0.77890419 -0.168263014 -0.3963739948  0.47600601
## 142 -0.477940705 -1.00661777 -0.146021901  0.1054610972 -1.03734990
## 143  0.062404858 -1.21800694 -0.734550929  0.8616055130 -1.69323269
## 144  0.700549198 -0.74937994 -0.320573624  0.0249409962  0.54148514
## 145 -0.301931694 -1.04165925 -0.411146384  0.8726507557 -1.53586685
## 146 -0.966160449 -1.14627570 -1.136558021  0.6444032929 -2.48822120
## 147 -0.115693913 -0.73624410  1.004609683 -0.5411627453  0.23269262
## 148  0.491277923 -0.95400513  0.231790699 -0.2841190918  0.43628969
## 149  0.166474308 -0.96314821 -0.128499100  0.0246081760 -0.41880042
## 150  0.070734912 -1.29815877 -0.215418670  0.6338651851  0.69378679
## 151  0.315062048 -0.75140806 -0.799408890  0.1943106492 -1.01569621
## 152 -1.525552359  0.05429671  0.761448000 -2.1616607524  0.26049625
## 153 -0.594046038 -0.95219028  1.487670826 -0.4091474684  0.26842539
## 154  0.446137136 -0.95518209  0.335464973 -0.3204913267  0.44645609
## 155  0.002275404 -0.95705362 -0.080311333 -0.0217817150  0.62667593
## 156  0.276799815 -1.00792433  0.380473139  0.2176109047  0.52347311
## 157  0.262011133 -0.76994380  0.320096242 -0.2993219587  0.46962717
## 158 -1.743028857 -0.18277801  0.852251385 -1.7344854315  0.40243395
## 159  0.081749620 -0.34275204 -0.232545956 -0.8441318718  0.52119493
## 160 -0.076819978 -0.27831645 -0.636441839 -0.6604230935 -0.27470566
## 161 -0.105813225 -0.28241967 -0.275946206 -0.6051893686  0.59375813
## 162 -1.216126815 -0.67179766  0.346143165 -0.1971245490 -1.86856318
## 163 -2.188146555 -0.15981999 -0.772872117 -1.3677824317 -2.93915676
## 164  4.312761323  2.64764894 -3.953222992 -3.1714941005 -0.58275412
## 165 -0.259728974  0.54675137 -0.498993313  0.8742848282  1.00356987
## 166 -1.799158000  0.52749091 -0.692437850  1.7553237405  1.40314553
## 167 -1.782007895  0.31202030 -0.703658985  2.6644321840  1.58579360
## 168 -0.682176998  1.39401482  0.444670009  2.4899477535  1.27313984
## 169  0.793164967  0.79287059 -0.006957136  2.4344324079  1.24977077
## 170 -0.543270058  1.76311117  0.143954941  1.4870650170  1.18002359
## 171 -1.925304089  2.48661199 -0.091215219  0.6406712593  1.30385527
## 172  4.379266673 -0.10320759 -7.968509793 -0.3370566392  3.18044729
## 173  4.422171206 -0.16828555 -7.835909582 -0.1534423802  3.17960592
## 174 -1.591311056  2.10837265  0.100285810  0.8617700975  1.28004662
## 175 -1.007681786  0.88200991 -2.675809147  1.5272629380 -3.63527429
## 176 -1.627260177  1.31553283 -0.129111882  2.3871908688 -1.43447931
## 177 -0.255898780  0.63772997  0.716862071 -0.5153373914  0.37665740
## 178 -0.652932605  0.34174447  1.083700159 -0.1442776521  0.45483825
## 179  0.199183253  0.73849379  0.922457793 -0.7510510167  0.24172814
## 180  0.144052200  0.63835256  0.887172243 -0.2595128489  0.32483371
## 181  2.320228067 -0.46131869  2.385509867  1.1553102688 -0.07489729
## 182  0.272836175  1.78463743  1.156330196 -0.4469317765  0.36781913
## 183  0.066740479  2.23844551  0.668896632  0.7288686390  0.70992748
## 184 -1.111557735  1.45370407  2.294413470  0.7245987513  0.72567558
## 185  3.275117723 -0.04169360  5.152987119  0.1203132842 -0.63112149
## 186  3.941270834 -0.72680250 -1.084877203 -0.7453128733 -0.15407927
## 187  2.753888832  1.26409106 -1.945355157 -2.7501608771 -0.41707789
## 188 -1.064602604 -0.07126640 -0.056510568 -0.8176646031  0.69382326
## 189 -0.587586194  1.90720773 -1.325819398 -2.7068738764  0.70584157
## 190  0.021652455  3.46570911 -0.117649609 -3.9897173618 -0.60272191
## 191  1.384460992  1.08659766  0.914265854  0.1587232903 -0.13692403
## 192  2.144237273  2.29023858  0.857760710  0.6246401796 -0.92241064
## 193  2.102052174  2.12573463  0.376896511  1.3910676423 -0.63138630
## 194  2.076487442  3.07120430  0.761289596 -0.0184659248 -1.28266301
## 195  2.156114015  2.89298752  0.887287957  0.3150229164 -1.15961208
## 196  2.293087851  2.20948886  0.446897236  1.2330706153 -0.35997164
## 197  2.100074245  2.36848931  0.340308386  1.1382016940  0.02981555
## 198  1.954075394  2.45742637  1.037547595  0.4618497913 -0.04116806
## 199  2.384788886  2.39496974  0.587613421  0.7189302870  0.01065432
## 200  2.334785562  2.42797362  0.937606974  0.2001445075 -0.05698161
## 201  2.673092939  2.12583599  1.506023223  0.3475290593 -0.24426046
## 202  1.374163606 -0.86872243 -0.998639968  3.7684765297  2.07218524
## 203  2.725920175  2.03252171  1.391542484  0.7857141463 -0.15157117
## 204  2.519291587  3.11368211  1.077706943 -0.2158149569 -0.68429086
## 205  2.264430828  2.34282262  1.243219483  0.3131145705 -0.14988799
## 206  2.040536696  3.06875444  1.205518125 -0.3884328049 -0.56340050
## 207  2.182759112  2.84980279  1.275970503 -0.1626314233 -0.49201654
## 208  3.548777004  3.45864136 -0.808972009 -0.8922192914 -0.72463816
## 209  1.988983290  2.59331608  0.406679659  0.5797531831  0.12005822
## 210  2.378258340  3.05451519 -0.090233797  0.3757303197 -0.10298530
## 211  2.392043354  3.10096497  1.114887999 -0.2877797172 -0.62326191
## 212  1.676315859  3.27713965  0.928172257  0.1706138251 -0.45063081
## 213  2.364204406  2.75042396  1.231812566  0.5240557739 -0.51380325
## 214  2.257356100  3.02150712  0.888760893  0.4135215127 -0.50429158
##               PC6          PC7           PC8           PC9
## 1   -0.3394142610  0.394674671 -0.1966988832 -0.0163082481
## 2    0.1156889019  0.024101420 -0.2835487302  0.0107645558
## 3   -0.1263341038  0.366657877 -0.0957162515 -0.0215895670
## 4   -0.2851361031  0.052373918 -0.0029524146 -0.0918202020
## 5   -0.2973353225 -0.158198584 -0.1908680543 -0.0023091290
## 6    0.1408913827  0.263667891  0.0328623344  0.0017692117
## 7   -0.2561731889 -0.325847976 -0.1239422179  0.0190984663
## 8   -0.3822605070 -0.455916331 -0.1360302916  0.0122746094
## 9    0.3144943272  0.117859184 -0.2632809148  0.0237408051
## 10  -0.1516744259  0.002037298 -0.1308834127  0.0558959000
## 11   0.0701654841  0.106860998  0.0377835077 -0.0003594827
## 12  -0.5563011751 -0.015602827 -0.0248190258  0.0364312692
## 13   0.1674526312 -0.196033733  0.0039133097  0.0081180584
## 14  -0.1276458786 -0.187334019 -0.1585326225  0.0259224006
## 15  -0.7145556027 -0.001839998 -0.1641493009  0.0265793118
## 16  -0.5753756318 -0.150588841 -0.1501210552 -0.0116840988
## 17  -0.6453353623 -0.177931865 -0.0096511557  0.0499308475
## 18   0.3675182140 -0.072010475 -0.0921226522 -0.0491674912
## 19   0.0526497989  0.316970650  0.1022518930  0.0135810529
## 20  -0.1830289382  0.586157902 -0.1121996112  0.0664931427
## 21  -0.0296527038  0.249031522 -0.0161124165 -0.0258492093
## 22   0.5998942374 -1.041007419  0.4030497729  0.0009060587
## 23  -0.5150741279  0.096463997  0.1851425158 -0.0088976109
## 24  -0.5131664328  0.068838500 -0.0357043987  0.0600990956
## 25  -0.1470666933 -0.187584673  0.1243847348 -0.0030418684
## 26  -0.3936289023 -0.187744400 -0.0279830392  0.0378898933
## 27  -0.2199109028  0.173959408 -0.0838478378 -0.0269326822
## 28  -0.4836469139  0.054795607  0.0004804316 -0.0395596437
## 29  -0.7151329164  0.213542461 -0.1493847422 -0.0163457519
## 30  -0.3268425758 -0.045520895 -0.0630878072 -0.0087966714
## 31  -0.2794783484 -0.086051809 -0.0478859601  0.0551666319
## 32  -0.5385014400 -0.265797785 -0.0350538822  0.0189894845
## 33  -0.0517618055 -0.336365121 -0.0233459536  0.0246774339
## 34  -0.5585763168  0.003760317 -0.2136362777  0.0669310710
## 35  -0.5954802978  0.133075969 -0.0015268653  0.0139127540
## 36  -0.0882798863 -0.059015421  0.5701912889  0.0172568999
## 37   0.1402675671  0.139987714  0.1200116575  0.0433130228
## 38  -0.5356996049  0.063865485 -0.0826232792  0.0149773808
## 39   0.2324492466 -0.696001610  0.0449827629  0.0311546623
## 40   0.2324492466 -0.696001610  0.0449827629  0.0311546623
## 41  -0.5113475828 -0.276673442  0.0357056531  0.0174414125
## 42  -0.5826397231 -0.169090461 -0.0087592063 -0.0185829088
## 43  -0.1950129869  0.030506072 -0.0144344544  0.0187444705
## 44  -0.0480202784 -0.286617624  0.0314135102  0.0416300343
## 45   0.2165782342 -0.365730884  0.0173894980 -0.0036301660
## 46   0.0498745953  0.273243513  0.1451918396 -0.0016262236
## 47   0.1768986136 -0.280770564 -0.0872069382  0.0361247408
## 48   0.2086014516 -0.392265081 -1.0040828095 -0.0430680090
## 49  -0.4020144679 -0.121209577  0.0181407489  0.0273425263
## 50   0.1264788017 -0.002677554  0.1132491330 -0.0359374300
## 51   0.3248421206 -0.659839351 -0.0363503273  0.0181576822
## 52   0.1333095588 -0.026958208 -0.0160625024  0.0497142226
## 53   0.0722846774 -0.248442295  0.0747705988  0.0322320107
## 54  -0.1240524266 -0.081737084  0.0067153449 -0.0382271449
## 55   0.1428488768 -0.145770968  0.0519433137  0.0126026001
## 56  -0.0348281756 -0.369549755 -0.1770202400  0.0189478521
## 57   0.5786333821 -0.395925304  1.2961679179 -0.0207205943
## 58  -0.4993126344 -0.034803908 -0.1952469660 -0.0823455100
## 59  -0.1658788718 -0.289135790 -0.1951434762  0.0630267526
## 60   0.1046663477 -0.251433924 -0.0374612609  0.0336318916
## 61  -0.1707507687  0.043471774 -0.0965890271  0.0076671620
## 62  -0.8647195471  0.051905007  0.2094795600  0.0230403886
## 63   0.0903760307 -0.161308739 -0.0282944251  0.0010759273
## 64   0.2317723689 -0.049218035  0.1048452629 -0.0266791602
## 65  -0.0393268378 -0.132564694 -0.1014032700  0.0364556987
## 66  -0.0523316117  0.257439732 -0.0738226894 -0.0036832229
## 67  -0.0526298961 -0.229059236 -0.0174892451  0.0238851383
## 68  -0.0637458262 -0.256955144 -0.0665403130  0.0623687520
## 69   0.0003901133 -0.229642767 -0.0448537493  0.0287231999
## 70  -0.2344069113 -0.149806991 -0.1558863246  0.0561097976
## 71   1.0753129668  0.803941037  0.1393556244 -0.0605711246
## 72   0.8080877458 -0.080898474  0.0265580889 -0.0434160713
## 73  -0.3292762264  0.187525654 -0.0432207352 -0.0047126493
## 74  -0.1572538832  0.313681343 -0.0631264974  0.0107581530
## 75  -0.3462133286  0.186616482 -0.0428129642  0.0163025321
## 76  -0.3553923615  0.173654271  0.0044285814  0.0295542408
## 77  -0.0172424876  0.360415077  0.1671656383 -0.0555303890
## 78  -0.3712661013  0.357642358  0.0775487320 -0.0806619469
## 79   0.5082477740 -0.162022386  0.0954614493  0.0400379903
## 80  -0.4345888460  0.820900675 -0.0451416057 -0.0166877584
## 81  -0.3774684015  1.176989098 -0.0791789161  0.0061588311
## 82  -0.2204698350  0.041309084 -0.0271341310 -0.0190907641
## 83  -0.0681627596 -0.176862849  0.1422158572 -0.0046277042
## 84  -0.0367922978  0.222934700  0.0992820459 -0.0026749502
## 85   0.8348053389  0.583060484  0.0696789671  0.0203809920
## 86  -0.1561319502  0.388855909  0.1822156888  0.0007345878
## 87  -0.3022814229  0.278640190  0.0568681726  0.0186507374
## 88   0.2097933722  0.170105597  0.0589031896  0.0129240445
## 89  -0.3482361297  0.259354982  0.1301887953 -0.0795361777
## 90  -0.4582533028  0.691550673 -0.2637447079  0.0251288197
## 91   0.1664291535 -0.238803513  0.2719977909 -0.0191078793
## 92  -0.4697921151  0.318987577  0.1848552130 -0.0934443624
## 93   0.0243528206  0.556135105  0.0887882247  0.0367093322
## 94  -0.2379466942  0.298901129  0.1379707631 -0.0195486427
## 95  -0.5254178324  0.146152670 -0.0160475787 -0.0323576601
## 96  -0.1012734087  0.329156844 -0.0340970710 -0.0966118072
## 97   0.0881778712 -0.294280694  0.3216907323  0.0297484664
## 98  -0.2937371783 -0.437662060 -0.0122042965 -0.0071739299
## 99  -0.4095431273  0.375134719 -0.1470721390 -0.0289659194
## 100 -0.4605828529  0.008512340 -0.0699768011 -0.0102597126
## 101  0.0172861935 -0.132604358  0.1375220307  0.0264368306
## 102 -0.5139835278  0.453507916  0.2190479160 -0.1114625201
## 103 -0.1188986649 -0.864347052  0.0091999434  0.0214424602
## 104  0.2466158668 -0.086903964 -0.0542412973  0.0050122000
## 105  0.3061127747  0.450100356 -0.0683344360  0.0166624124
## 106  0.5623336263  0.504763123 -0.0962977546 -0.0449253364
## 107 -4.2965937789 -0.568690791  0.4364916471 -0.0268999512
## 108  0.7881762701  0.250963218 -0.0642573011 -0.0078552662
## 109  1.5150701451 -0.709889725 -0.0062426770 -0.0621435151
## 110  0.6764306521 -1.483666136  0.3559349446 -0.0512606274
## 111 -0.8153107646 -0.361619369  0.1763735597  0.0316376954
## 112 -0.9443644287 -0.315869783  0.1766439536  0.0013147831
## 113  0.2271388888 -0.522602194  0.2261252513 -0.0257964015
## 114  0.1616819001 -0.138978855 -0.3418629886  0.0313977431
## 115 -0.4026273046 -0.010639375 -0.0091736925 -0.0350985190
## 116 -0.2106142915  0.193726199 -0.1253022320 -0.0148106602
## 117 -0.0463968869  0.252170050 -0.0916227295 -0.0195028951
## 118  0.1589936219  0.777691943 -0.0615999236 -0.0179860912
## 119  0.5737136271  0.117883633  0.0081854020 -0.0096833397
## 120  0.0465648378  0.226789724  0.1259986205 -0.0666374822
## 121 -0.2532597338  0.140867185 -0.0652767227 -0.0389912375
## 122  0.0983137688  0.247966803 -0.1492053116 -0.0061024931
## 123 -0.2440889075  0.249912652 -0.0515973058 -0.0286961608
## 124 -0.0128158202  0.547808457 -0.1474143068 -0.0143107825
## 125 -0.4465784786 -0.249071895 -0.9214996549 -0.0243543644
## 126 -0.1514938113  0.400960882 -0.2487611479  0.0020978730
## 127 -0.3957292607  0.069890563  0.3447123529 -0.0255683135
## 128  0.9247517880  0.078116708 -0.1282640600  0.0073890495
## 129  0.4298399694  0.138002213 -0.2815688421  0.0197536262
## 130  1.3781839497  0.388774400  0.2580897640 -0.0441710112
## 131  0.7652309921  0.064604871  0.0634449494 -0.0348449153
## 132  1.3239630066  0.269401294  0.1598932177  0.0346112513
## 133 -0.2089710649 -0.092086528 -0.0711977540 -0.0087343426
## 134  0.4526770309  0.468817430  0.0540403009 -0.0127388490
## 135 -0.3039219334 -0.030496564 -0.2227051490  0.0035831915
## 136  0.3930203110 -0.009137242  0.0821009932  0.0024531311
## 137 -0.2141174605 -0.398832448 -0.1587876197  0.0439697095
## 138 -0.4928871612  0.371353001 -0.1760925541 -0.0237160185
## 139 -0.5746775163  0.178361805 -0.3104426949 -0.0219307504
## 140 -0.4946487200  0.384941421 -0.2452430629  0.0111169380
## 141 -0.0927519460  0.404604749 -0.0163743450 -0.0041467913
## 142 -0.0192603548 -0.525836913 -0.1446378472  0.0119226653
## 143  0.0943709341 -0.097234744  0.0019040278  0.0286890951
## 144 -0.3239198709  0.671742295 -0.1723593026 -0.0007499822
## 145  0.3354352956 -0.284544226  0.3011200605  0.0247510060
## 146  0.3876831983 -0.234940811 -0.0172992936 -0.0182551460
## 147 -0.1358665952  0.052529821  0.1267851918  0.0272134003
## 148 -0.1067385656  0.118418928  0.3488023432 -0.0136728880
## 149  0.0595259295  0.103988663  0.1895417549  0.0496508709
## 150 -0.9162291198  0.279810696  0.3914884211 -0.2934810086
## 151  0.2408023339  0.611897511  0.0877588384  0.0275833023
## 152  0.3173466149 -0.022445897  0.1671949340  0.0706746148
## 153 -0.1715062313 -0.596537788  0.3450202019  0.0443102449
## 154 -0.0140445049 -0.114053473  0.3899581073 -0.0619142827
## 155 -0.3982692865  0.156549381  0.3779417847 -0.0077331609
## 156 -0.3204751969 -0.015645232  0.2658847281  0.0063038071
## 157 -0.0196773936  0.049280303  0.3763741194  0.0366824903
## 158  0.1674601253 -0.492970165  0.2563442560  0.0287923859
## 159  0.1249288645  0.464558226  0.2483339421  0.0227315639
## 160  0.3456295285  0.580464999  0.1869947852  0.0111311129
## 161 -0.0150052149  0.505357648  0.1439843158  0.0331820766
## 162  0.2693852235 -0.784138290  0.0592684111  0.0105559993
## 163  1.2130892198 -0.369584785 -0.1880142067 -0.0521042743
## 164 -1.7798549466  1.106194913  0.4653757269 -0.0011181589
## 165 -0.0574346810  0.719751703 -0.0325959286 -0.0007476276
## 166 -0.9015770781  0.592761690 -0.0121273109 -0.0220416642
## 167 -1.2213403704  0.438107801 -0.1148339904  0.0617874941
## 168  0.1983119432  0.137855930 -0.0177006650  0.0452775840
## 169  0.5343765757 -0.155446996  0.0553516960 -0.0436267998
## 170  0.7152744912  0.287200997  0.0405778574 -0.0004506243
## 171  0.8124168426  0.309072154 -0.1356051240 -0.0337172638
## 172  2.8223624455 -1.721059791  0.1183061200 -0.0090775600
## 173  2.7784506812 -1.810239794  0.0037254694  0.0476104375
## 174  0.9159307918  0.157791319  0.8366475243  0.0230605142
## 175  1.0638799007  0.495010785 -0.4644219064 -0.0623733854
## 176  0.9089936355 -0.047846892 -0.2824019145 -0.0652896700
## 177  0.4447643815  0.665178913  0.0420083804  0.0113572783
## 178  0.2483820414  0.084565020  0.0626332144  0.0254756883
## 179  0.7888282782  0.640190480  0.0415874497  0.0342392227
## 180  0.5134413886  0.673470884 -0.1022859028  0.0223693991
## 181  0.6371601555 -0.111152342 -0.0978868699 -0.0193938794
## 182  1.5038838318  0.501945355 -0.0411168402  0.0206431812
## 183  1.1694949237  1.023825643  0.0128923576 -0.0090800461
## 184  1.3250664600 -1.390597721  0.3907950360 -0.0228456184
## 185  2.8763807919 -2.838317319 -0.0409230345 -0.0755431564
## 186 -1.0337582440 -1.217398042  0.5019039812  0.0404360768
## 187 -1.3515469049 -0.558992065 -0.5315640934  0.0048425098
## 188 -0.1633433580 -0.188037374 -1.0684633105 -0.0418722992
## 189  1.5004891394  1.104009873 -0.2440582686 -0.0037294159
## 190 -0.3856984497 -1.168550026 -0.0898778881 -0.0079983528
## 191 -0.5671037336  0.196678511  0.3014482281  0.0522415743
## 192  0.8751283010  0.568051975 -0.1654981365  0.0100994502
## 193  0.7798045192  1.363042584 -0.4277835827  0.0214268458
## 194 -0.5277549835 -0.585541220  0.1108945053 -0.0007687369
## 195 -0.6742667706 -0.623576081  0.1013696526  0.0123586220
## 196  0.4127616758  1.113316772 -0.0608367295  0.0417150000
## 197 -0.0696506701  0.874108372  0.2597019937  0.0582513568
## 198  0.4925675454  0.572804746 -0.3555852750 -0.0014244548
## 199  0.4353202579  1.174530741  0.1161839390  0.0078028296
## 200  0.9591990929  0.895427026 -0.1723397321  0.0232281030
## 201  0.8313397632  0.341281250 -0.1215805414 -0.0212315745
## 202  0.2654028730 -2.668952401 -0.6946947246  0.0499940266
## 203  0.7037376425  0.623973212 -0.2972859449  0.0062250485
## 204 -0.8650839007 -0.659093084  0.1938194275 -0.0116860468
## 205  0.6620356016  0.429562763 -0.1578683523 -0.0095700725
## 206 -0.5385345995 -0.802770063  0.1961846047 -0.0094452488
## 207 -0.2920648728 -0.588481696  0.2831604774  0.0238876526
## 208 -2.3984653487 -2.843216289 -0.3579565626 -0.0517683003
## 209  0.5738061025  1.456189518  0.0076569834  0.0241105109
## 210 -0.2306214089  1.317098237  0.1889578144  0.0285902558
## 211 -0.6166100046 -0.580998610  0.1313431914  0.0136311692
## 212 -1.2444023575 -0.672545416 -0.8896238166 -0.0461753154
## 213 -1.0010053463 -0.677311250  0.0742859741  0.0272368151
## 214 -1.2107785311 -0.461379292  0.0631667988  0.0194042787
# perbandingan dengan data awal (glass_clean_z)
head(glass_clean_z)
##              RI         Na        Mg         Al          Si           K
## [1,]  0.8708258  0.2842867 1.2517037 -0.6908222 -1.12444556 -0.67013422
## [2,] -0.2487502  0.5904328 0.6346799 -0.1700615  0.10207972 -0.02615193
## [3,] -0.7196308  0.1495824 0.6000157  0.1904651  0.43776033 -0.16414813
## [4,] -0.2322859 -0.2422846 0.6970756 -0.3102663 -0.05284979  0.11184428
## [5,] -0.3113148 -0.1688095 0.6485456 -0.4104126  0.55395746  0.08117845
## [6,] -0.7920739 -0.7566101 0.6416128  0.3506992  0.41193874  0.21917466
##              Ca         Ba         Fe
## [1,] -0.1454254 -0.3520514 -0.5850791
## [2,] -0.7918771 -0.3520514 -0.5850791
## [3,] -0.8270103 -0.3520514 -0.5850791
## [4,] -0.5178378 -0.3520514 -0.5850791
## [5,] -0.6232375 -0.3520514 -0.5850791
## [6,] -0.6232375 -0.3520514  2.0832652
# pembuktian perhitungan untuk mendapatkan nilai data hasil proyeksi PC 1 baris 1
# PC1 dilakukan perkalian matriks dengan baris 1 data asli
glass_clean_z[1,] %*% pca$rotation[,1]
##           [,1]
## [1,] -1.148447

8 Reduce Dimension

For example, we only want to reduce 7 dimensions to 5 dimensions, then we use the PC1 to PC5 columns at pca$x. But how do we choose how many dimensions we should keep? For that, we see a cumulative variance with a summary() function.

head(glass_clean_z)
##              RI         Na        Mg         Al          Si           K
## [1,]  0.8708258  0.2842867 1.2517037 -0.6908222 -1.12444556 -0.67013422
## [2,] -0.2487502  0.5904328 0.6346799 -0.1700615  0.10207972 -0.02615193
## [3,] -0.7196308  0.1495824 0.6000157  0.1904651  0.43776033 -0.16414813
## [4,] -0.2322859 -0.2422846 0.6970756 -0.3102663 -0.05284979  0.11184428
## [5,] -0.3113148 -0.1688095 0.6485456 -0.4104126  0.55395746  0.08117845
## [6,] -0.7920739 -0.7566101 0.6416128  0.3506992  0.41193874  0.21917466
##              Ca         Ba         Fe
## [1,] -0.1454254 -0.3520514 -0.5850791
## [2,] -0.7918771 -0.3520514 -0.5850791
## [3,] -0.8270103 -0.3520514 -0.5850791
## [4,] -0.5178378 -0.3520514 -0.5850791
## [5,] -0.6232375 -0.3520514 -0.5850791
## [6,] -0.6232375 -0.3520514  2.0832652
head(pca$x)
##             PC1        PC2        PC3         PC4        PC5        PC6
## [1,] -1.1484468 -0.5282491  0.3712253 -1.72485681  0.2513465 -0.3394143
## [2,]  0.5727942 -0.7580105  0.5554059 -0.75845396  0.2564694  0.1156889
## [3,]  0.9379605 -0.9276609  0.5536094 -0.20577184  0.2369503 -0.1263341
## [4,]  0.1417509 -0.9594279  0.1168507 -0.41475157  0.4751847 -0.2851361
## [5,]  0.3502710 -1.0886966  0.4839440 -0.06894065  0.4310792 -0.2973353
## [6,]  0.2895876 -1.3209105 -0.8666466  0.92562711 -1.8104158  0.1408914
##              PC7          PC8          PC9
## [1,]  0.39467467 -0.196698883 -0.016308248
## [2,]  0.02410142 -0.283548730  0.010764556
## [3,]  0.36665788 -0.095716252 -0.021589567
## [4,]  0.05237392 -0.002952415 -0.091820202
## [5,] -0.15819858 -0.190868054 -0.002309129
## [6,]  0.26366789  0.032862334  0.001769212
summary(pca)
## Importance of components:
##                          PC1    PC2    PC3    PC4    PC5     PC6    PC7     PC8
## Standard deviation     1.585 1.4318 1.1853 1.0760 0.9560 0.72639 0.6074 0.25269
## Proportion of Variance 0.279 0.2278 0.1561 0.1286 0.1016 0.05863 0.0410 0.00709
## Cumulative Proportion  0.279 0.5068 0.6629 0.7915 0.8931 0.95173 0.9927 0.99982
##                            PC9
## Standard deviation     0.04011
## Proportion of Variance 0.00018
## Cumulative Proportion  1.00000

Note: standard deviation: the root of the variance captured by each PC proportion of variance: the percentage of information captured by each PC Cumulative Proportion: The sum of the cumulative proportion captured from PC1 to that PC.

  • Standard deviation: standard deviation (root of variance) captured by each PC, same as pca$sdev
  • Proportion of Variance: percentage of information captured by each PC
  • Cumulative Proportion: the total percentage of information captured cumulatively from PC1 to that PC

Selection of the number of PCs tailored to the needs. For example, we want to summarize at least 90% of the information, then the number of PCs we use is PC 1 - PC 4.

pc_keep <- pca$x[, 1:4] %>% 
  as.data.frame()
pc_keep
##              PC1         PC2          PC3           PC4
## 1   -1.148446843 -0.52824907  0.371225255 -1.7248568105
## 2    0.572794160 -0.75801049  0.555405924 -0.7584539597
## 3    0.937960515 -0.92766091  0.553609408 -0.2057718428
## 4    0.141750924 -0.95942790  0.116850709 -0.4147515674
## 5    0.350271021 -1.08869658  0.483944005 -0.0689406529
## 6    0.289587596 -1.32091046 -0.866646619  0.9256271150
## 7    0.252080399 -1.11353870  0.539373202 -0.0801402072
## 8    0.120018063 -1.21898810  0.623280854  0.1157506818
## 9    0.020767338 -0.32117955  0.108804570 -1.3684635985
## 10   0.002346727 -1.06332030 -0.120572324  0.3751414534
## 11   0.381620164 -1.37690564 -0.687911388  1.1548529059
## 12   0.013322630 -1.10213499  0.144462275  0.2405245805
## 13   0.308999887 -1.41971148 -0.484926709  1.0744886211
## 14  -0.156154882 -1.23303717 -0.139379929  0.7700931118
## 15   0.089746238 -1.17848894  0.215034763  0.6072786736
## 16   0.114985420 -1.15756800  0.333239665  0.4155419550
## 17  -0.173052569 -1.17967372  0.203528766  0.3816328266
## 18  -1.454712901  0.09861017  0.485746132 -2.3646823834
## 19  -0.546035993 -0.29496853  0.701291213 -1.2538048999
## 20   0.308094642 -0.76137698 -0.329388809  0.1717920231
## 21  -0.205192769 -0.99684539 -0.634539069  0.5433672707
## 22  -1.213208879 -0.43587413  1.653753272 -2.1188842738
## 23  -0.041071630 -1.02547897  0.009772241  0.1229303264
## 24   0.112941203 -1.02521801  0.086005091  0.3014342156
## 25   0.147178281 -0.93158280  0.516972396 -0.2445061170
## 26   0.050368425 -1.04478108  0.212549641  0.1354472052
## 27   0.155409596 -0.73642288  0.028810565 -0.2724098526
## 28   0.216585957 -1.03703567  0.209275686  0.2802505628
## 29   0.114824408 -1.05047634  0.038586273  0.5755947771
## 30   0.065683485 -0.90076385  0.175949905 -0.0306774280
## 31  -0.297563762 -1.16216838 -0.324185111  0.7788437611
## 32   0.022184328 -1.16001759  0.449166058  0.4451783444
## 33  -0.395658424 -1.07056331 -0.497469340  0.7040730014
## 34   0.068924668 -1.16118163  0.017364209  0.9240585453
## 35  -0.081562535 -0.96375973  0.036503202  0.3323683008
## 36   0.388008888 -1.00741797  0.353057923 -0.1483908082
## 37  -0.256820650 -0.09870461 -0.051218092 -1.4411483670
## 38  -0.026979837 -0.93894934 -0.015419761  0.3129696922
## 39  -1.928590539 -0.14178187  0.971056260 -1.9658570205
## 40  -1.928590539 -0.14178187  0.971056260 -1.9658570205
## 41  -0.213478266 -1.06256034  0.202365548  0.2926908461
## 42  -0.017324756 -1.09835639  0.274628190  0.5173143752
## 43   0.098872422 -0.74506000  0.157275658 -0.1318372421
## 44  -1.903383686 -0.13483009  0.513922964 -1.5839050048
## 45  -0.753472266 -1.19150824 -0.772515223  1.0089734478
## 46  -0.414177960 -0.29260121 -0.197869624 -0.9822537857
## 47  -0.603009537 -0.77837482 -0.249165126  0.1906762302
## 48  -2.964411026  0.46205713  0.261094551 -1.8449299890
## 49  -2.067962926 -0.19322084  0.396383105 -0.9939418999
## 50  -0.392192030 -0.33946226 -0.038692283 -0.9399317350
## 51  -2.720831501 -0.11277416  0.225399358 -1.2301085988
## 52  -0.721377492 -0.47378107 -0.423976206 -0.1645345439
## 53  -0.105912122 -0.41353643  0.436352469 -0.0297550675
## 54  -0.180936809 -0.40899893  0.238132445  0.1794857000
## 55  -0.171403012 -0.50909413  0.136450864  0.4869834635
## 56  -0.458182481 -0.96979793 -0.280883058  1.9469375204
## 57   0.422208437 -1.81230677 -0.452330029  1.0691808961
## 58  -0.015803508 -0.95521440  0.112238600  0.1457878535
## 59   0.326476940 -1.09978334  0.530991959 -0.3331146990
## 60  -0.037285663 -1.05185437  0.056765191 -0.1153089853
## 61  -0.456237146 -0.55062038  0.834996791 -0.6432518396
## 62  -0.235668276  0.56700077  0.147767878 -1.7147353720
## 63  -1.880429045 -0.29578219 -0.048976438 -1.1441284233
## 64  -1.902003672  0.18475364  0.606925487 -2.1976147153
## 65  -1.763255868 -0.23430181  0.222300088 -0.9876925303
## 66  -1.204275509 -0.01677727  0.464003138 -1.2324312553
## 67  -2.090457226 -0.42601501 -0.131908081 -0.2432589907
## 68  -2.060912640 -0.44603951 -0.072685135 -0.1590112016
## 69  -2.000195008 -0.36264837 -0.141596362 -0.3026924257
## 70  -2.246687624  0.02790854  0.325493827 -0.9337981478
## 71   1.108031745 -0.35961601  0.280291857 -1.7158206820
## 72  -0.747591211 -0.86805941 -0.980361673 -0.5389940990
## 73   0.932881463 -1.20112937  0.147040580  0.1739669174
## 74   0.879271955 -0.97003865  0.145935881 -0.1615039917
## 75   0.920404247 -1.19412945  0.055347471  0.2529835594
## 76   0.875987173 -1.20610130  0.113172374  0.2606878580
## 77   0.683486067 -0.83967114 -0.126353608 -0.6214622177
## 78   0.688744268 -1.06380504 -0.017044634  0.0295195707
## 79   0.461914711 -0.98593559  0.476870331 -0.2415521421
## 80   1.071986894 -0.96253189 -0.391904137  0.2870674530
## 81   1.210858930 -0.77727570 -0.637143984  0.1541296777
## 82   0.907062903 -1.13633552  0.385057615  0.1509494864
## 83   0.534404350 -1.06728175  0.279272670 -0.2993944880
## 84   0.649880372 -1.11386078 -0.281574873  0.2625774851
## 85   2.310957633 -0.57263981 -0.542875215 -0.9601296877
## 86   0.618078428 -0.87501030  0.283711016 -0.2689491226
## 87   0.865733629 -1.07549645  0.641758843  0.2559552429
## 88   0.535049604 -0.92131867 -0.279391824 -0.1054967634
## 89   0.649380950 -1.06175662  0.076026153  0.0978529022
## 90   0.753625777 -1.09669524 -0.496044621  0.9699016858
## 91  -0.989339128 -1.01950958 -0.826467898  0.0448572384
## 92   0.561325997 -1.06331730  0.311359384  0.3407327827
## 93   0.306078725 -0.96181127  0.274129756  0.8797100999
## 94   0.732885652 -0.92022927  0.537762200  0.1962808871
## 95   0.653714815 -1.14035879  0.085804075  0.6763940268
## 96  -0.094419371 -0.45509758 -0.076211910 -0.6683683840
## 97  -0.902171426 -0.89608666 -0.510371923 -0.0735566444
## 98  -0.612459362 -1.39906120 -0.458608726  1.7784299129
## 99   0.652579399 -0.70923980 -0.194875405  0.8529481865
## 100  0.133270547 -0.41103490  0.030726432  0.2802260655
## 101  0.022594935 -0.80845352 -0.429582833  1.3354455416
## 102  0.072201040 -0.51545452 -0.474160583  0.8913514201
## 103 -0.981204161 -1.01772225  0.483211623  1.7356726879
## 104 -3.843370505  1.34191831 -0.168879778 -2.3500711451
## 105 -2.345864419  1.13753133 -0.056539312 -1.6856064797
## 106 -3.325489759  2.02142921 -2.764831118  2.8711695115
## 107 -3.631698232  6.17895704 -4.905112880  0.0567794593
## 108 -7.121999125  3.99506958 -2.253856170  0.2574396209
## 109 -1.691057932  2.06929378  1.055945888  0.3722184019
## 110 -0.739858727  0.78350436  2.515983086  2.0757233714
## 111 -4.508174751  2.02298240  0.229873693  2.8929923531
## 112 -4.861635479  2.10617054  0.045815414  2.9222822422
## 113 -4.585745031  2.69313310  0.162203333  0.9090086613
## 114 -0.323226651 -0.91302971 -0.226640482 -0.3926394033
## 115 -0.258602691 -1.01607386 -0.024882309 -0.5896170425
## 116 -0.028560236 -0.80182435  0.085468307 -0.8010545700
## 117 -0.186277287 -0.88672993 -0.404767376 -0.4685130923
## 118  0.833021446 -0.52246571 -0.366078469 -1.0728324989
## 119  0.062966211 -1.08825359 -0.947457846  0.2418896414
## 120  0.687034382 -0.84256912  0.030404857 -0.6700525065
## 121 -0.093117107 -0.79564812 -0.041197784 -0.6242683151
## 122  0.325189921 -1.15859792 -0.679407371  0.6928045513
## 123  0.570672276 -0.92587090  0.170757964 -0.1268546052
## 124  0.779587582 -0.64038561 -0.118989257 -0.4952658556
## 125 -0.791185959 -0.60291463  0.200491427 -0.4696803943
## 126 -0.272108434 -0.75907116 -0.642807732  0.0487903289
## 127  0.121066173 -1.06021781  0.131498420 -0.0003670475
## 128 -1.113133982  0.61898725 -0.569769365 -0.3099875829
## 129 -0.639406292  0.89846847 -0.800139510 -0.0135953058
## 130 -1.063446961  1.36437865 -0.647821035 -0.1394985260
## 131 -1.374166428  1.59961314  0.220350791 -0.0168146211
## 132 -3.410946173  3.12756662 -0.633112032 -0.0588898519
## 133  0.002295681 -1.02207703  0.196671115 -0.7904610243
## 134 -0.094095789 -0.64350258 -0.704660813 -1.0490788767
## 135  0.120254788 -1.01336614  0.337385821 -0.4409698160
## 136 -0.613006461 -1.08900951 -0.869730035  0.0017255183
## 137 -0.336892385 -1.28808449  0.076638408  0.3073310593
## 138  0.540055552 -1.02896747 -0.035912893  0.1758038021
## 139  0.764433983 -1.21633493  0.133856591  0.5710687112
## 140  0.773019346 -1.07892467 -0.014680290  0.3715267033
## 141  0.656788819 -0.77890419 -0.168263014 -0.3963739948
## 142 -0.477940705 -1.00661777 -0.146021901  0.1054610972
## 143  0.062404858 -1.21800694 -0.734550929  0.8616055130
## 144  0.700549198 -0.74937994 -0.320573624  0.0249409962
## 145 -0.301931694 -1.04165925 -0.411146384  0.8726507557
## 146 -0.966160449 -1.14627570 -1.136558021  0.6444032929
## 147 -0.115693913 -0.73624410  1.004609683 -0.5411627453
## 148  0.491277923 -0.95400513  0.231790699 -0.2841190918
## 149  0.166474308 -0.96314821 -0.128499100  0.0246081760
## 150  0.070734912 -1.29815877 -0.215418670  0.6338651851
## 151  0.315062048 -0.75140806 -0.799408890  0.1943106492
## 152 -1.525552359  0.05429671  0.761448000 -2.1616607524
## 153 -0.594046038 -0.95219028  1.487670826 -0.4091474684
## 154  0.446137136 -0.95518209  0.335464973 -0.3204913267
## 155  0.002275404 -0.95705362 -0.080311333 -0.0217817150
## 156  0.276799815 -1.00792433  0.380473139  0.2176109047
## 157  0.262011133 -0.76994380  0.320096242 -0.2993219587
## 158 -1.743028857 -0.18277801  0.852251385 -1.7344854315
## 159  0.081749620 -0.34275204 -0.232545956 -0.8441318718
## 160 -0.076819978 -0.27831645 -0.636441839 -0.6604230935
## 161 -0.105813225 -0.28241967 -0.275946206 -0.6051893686
## 162 -1.216126815 -0.67179766  0.346143165 -0.1971245490
## 163 -2.188146555 -0.15981999 -0.772872117 -1.3677824317
## 164  4.312761323  2.64764894 -3.953222992 -3.1714941005
## 165 -0.259728974  0.54675137 -0.498993313  0.8742848282
## 166 -1.799158000  0.52749091 -0.692437850  1.7553237405
## 167 -1.782007895  0.31202030 -0.703658985  2.6644321840
## 168 -0.682176998  1.39401482  0.444670009  2.4899477535
## 169  0.793164967  0.79287059 -0.006957136  2.4344324079
## 170 -0.543270058  1.76311117  0.143954941  1.4870650170
## 171 -1.925304089  2.48661199 -0.091215219  0.6406712593
## 172  4.379266673 -0.10320759 -7.968509793 -0.3370566392
## 173  4.422171206 -0.16828555 -7.835909582 -0.1534423802
## 174 -1.591311056  2.10837265  0.100285810  0.8617700975
## 175 -1.007681786  0.88200991 -2.675809147  1.5272629380
## 176 -1.627260177  1.31553283 -0.129111882  2.3871908688
## 177 -0.255898780  0.63772997  0.716862071 -0.5153373914
## 178 -0.652932605  0.34174447  1.083700159 -0.1442776521
## 179  0.199183253  0.73849379  0.922457793 -0.7510510167
## 180  0.144052200  0.63835256  0.887172243 -0.2595128489
## 181  2.320228067 -0.46131869  2.385509867  1.1553102688
## 182  0.272836175  1.78463743  1.156330196 -0.4469317765
## 183  0.066740479  2.23844551  0.668896632  0.7288686390
## 184 -1.111557735  1.45370407  2.294413470  0.7245987513
## 185  3.275117723 -0.04169360  5.152987119  0.1203132842
## 186  3.941270834 -0.72680250 -1.084877203 -0.7453128733
## 187  2.753888832  1.26409106 -1.945355157 -2.7501608771
## 188 -1.064602604 -0.07126640 -0.056510568 -0.8176646031
## 189 -0.587586194  1.90720773 -1.325819398 -2.7068738764
## 190  0.021652455  3.46570911 -0.117649609 -3.9897173618
## 191  1.384460992  1.08659766  0.914265854  0.1587232903
## 192  2.144237273  2.29023858  0.857760710  0.6246401796
## 193  2.102052174  2.12573463  0.376896511  1.3910676423
## 194  2.076487442  3.07120430  0.761289596 -0.0184659248
## 195  2.156114015  2.89298752  0.887287957  0.3150229164
## 196  2.293087851  2.20948886  0.446897236  1.2330706153
## 197  2.100074245  2.36848931  0.340308386  1.1382016940
## 198  1.954075394  2.45742637  1.037547595  0.4618497913
## 199  2.384788886  2.39496974  0.587613421  0.7189302870
## 200  2.334785562  2.42797362  0.937606974  0.2001445075
## 201  2.673092939  2.12583599  1.506023223  0.3475290593
## 202  1.374163606 -0.86872243 -0.998639968  3.7684765297
## 203  2.725920175  2.03252171  1.391542484  0.7857141463
## 204  2.519291587  3.11368211  1.077706943 -0.2158149569
## 205  2.264430828  2.34282262  1.243219483  0.3131145705
## 206  2.040536696  3.06875444  1.205518125 -0.3884328049
## 207  2.182759112  2.84980279  1.275970503 -0.1626314233
## 208  3.548777004  3.45864136 -0.808972009 -0.8922192914
## 209  1.988983290  2.59331608  0.406679659  0.5797531831
## 210  2.378258340  3.05451519 -0.090233797  0.3757303197
## 211  2.392043354  3.10096497  1.114887999 -0.2877797172
## 212  1.676315859  3.27713965  0.928172257  0.1706138251
## 213  2.364204406  2.75042396  1.231812566  0.5240557739
## 214  2.257356100  3.02150712  0.888760893  0.4135215127

After selecting a PC that summarizes the required information, the PC can be combined with the initial data and used in further analysis (eg supervised learning).

glass_clean %>% 
  select_if(~!is.integer(.)) %>% # pick colomn beside integer
  cbind(pc_keep) # merge with PC colomn
##          RI    Na   Mg   Al    Si    K    Ca   Ba   Fe          PC1         PC2
## 1   1.52101 13.64 4.49 1.10 71.78 0.06  8.75 0.00 0.00 -1.148446843 -0.52824907
## 2   1.51761 13.89 3.60 1.36 72.73 0.48  7.83 0.00 0.00  0.572794160 -0.75801049
## 3   1.51618 13.53 3.55 1.54 72.99 0.39  7.78 0.00 0.00  0.937960515 -0.92766091
## 4   1.51766 13.21 3.69 1.29 72.61 0.57  8.22 0.00 0.00  0.141750924 -0.95942790
## 5   1.51742 13.27 3.62 1.24 73.08 0.55  8.07 0.00 0.00  0.350271021 -1.08869658
## 6   1.51596 12.79 3.61 1.62 72.97 0.64  8.07 0.00 0.26  0.289587596 -1.32091046
## 7   1.51743 13.30 3.60 1.14 73.09 0.58  8.17 0.00 0.00  0.252080399 -1.11353870
## 8   1.51756 13.15 3.61 1.05 73.24 0.57  8.24 0.00 0.00  0.120018063 -1.21898810
## 9   1.51918 14.04 3.58 1.37 72.08 0.56  8.30 0.00 0.00  0.020767338 -0.32117955
## 10  1.51755 13.00 3.60 1.36 72.99 0.57  8.40 0.00 0.11  0.002346727 -1.06332030
## 11  1.51571 12.72 3.46 1.56 73.20 0.67  8.09 0.00 0.24  0.381620164 -1.37690564
## 12  1.51763 12.80 3.66 1.27 73.01 0.60  8.56 0.00 0.00  0.013322630 -1.10213499
## 13  1.51589 12.88 3.43 1.40 73.28 0.69  8.05 0.00 0.24  0.308999887 -1.41971148
## 14  1.51748 12.86 3.56 1.27 73.21 0.54  8.38 0.00 0.17 -0.156154882 -1.23303717
## 15  1.51763 12.61 3.59 1.31 73.29 0.58  8.50 0.00 0.00  0.089746238 -1.17848894
## 16  1.51761 12.81 3.54 1.23 73.24 0.58  8.39 0.00 0.00  0.114985420 -1.15756800
## 17  1.51784 12.68 3.67 1.16 73.11 0.61  8.70 0.00 0.00 -0.173052569 -1.17967372
## 18  1.52196 14.36 3.85 0.89 71.36 0.15  9.15 0.00 0.00 -1.454712901  0.09861017
## 19  1.51911 13.90 3.73 1.18 72.12 0.06  8.89 0.00 0.00 -0.546035993 -0.29496853
## 20  1.51735 13.02 3.54 1.69 72.73 0.54  8.44 0.00 0.07  0.308094642 -0.76137698
## 21  1.51750 12.82 3.55 1.49 72.75 0.54  8.52 0.00 0.19 -0.205192769 -0.99684539
## 22  1.51966 14.77 3.75 0.29 72.02 0.03  9.00 0.00 0.00 -1.213208879 -0.43587413
## 23  1.51736 12.78 3.62 1.29 72.79 0.59  8.70 0.00 0.00 -0.041071630 -1.02547897
## 24  1.51751 12.81 3.57 1.35 73.02 0.62  8.59 0.00 0.00  0.112941203 -1.02521801
## 25  1.51720 13.38 3.50 1.15 72.85 0.50  8.43 0.00 0.00  0.147178281 -0.93158280
## 26  1.51764 12.98 3.54 1.21 73.00 0.65  8.53 0.00 0.00  0.050368425 -1.04478108
## 27  1.51793 13.21 3.48 1.41 72.64 0.59  8.43 0.00 0.00  0.155409596 -0.73642288
## 28  1.51721 12.87 3.48 1.33 73.04 0.56  8.43 0.00 0.00  0.216585957 -1.03703567
## 29  1.51768 12.56 3.52 1.43 73.15 0.57  8.54 0.00 0.00  0.114824408 -1.05047634
## 30  1.51784 13.08 3.49 1.28 72.86 0.60  8.49 0.00 0.00  0.065683485 -0.90076385
## 31  1.51768 12.65 3.56 1.30 73.08 0.61  8.69 0.00 0.14 -0.297563762 -1.16216838
## 32  1.51747 12.84 3.50 1.14 73.27 0.56  8.55 0.00 0.00  0.022184328 -1.16001759
## 33  1.51775 12.85 3.48 1.23 72.97 0.61  8.56 0.09 0.22 -0.395658424 -1.07056331
## 34  1.51753 12.57 3.47 1.38 73.39 0.60  8.55 0.00 0.06  0.068924668 -1.16118163
## 35  1.51783 12.69 3.54 1.34 72.95 0.57  8.75 0.00 0.00 -0.081562535 -0.96375973
## 36  1.51567 13.29 3.45 1.21 72.74 0.56  8.57 0.00 0.00  0.388008888 -1.00741797
## 37  1.51909 13.89 3.53 1.32 71.81 0.51  8.78 0.11 0.00 -0.256820650 -0.09870461
## 38  1.51797 12.74 3.48 1.35 72.96 0.64  8.68 0.00 0.00 -0.026979837 -0.93894934
## 39  1.52213 14.21 3.82 0.47 71.77 0.11  9.57 0.00 0.00 -1.928590539 -0.14178187
## 40  1.52213 14.21 3.82 0.47 71.77 0.11  9.57 0.00 0.00 -1.928590539 -0.14178187
## 41  1.51793 12.79 3.50 1.12 73.03 0.64  8.77 0.00 0.00 -0.213478266 -1.06256034
## 42  1.51755 12.71 3.42 1.20 73.20 0.59  8.64 0.00 0.00 -0.017324756 -1.09835639
## 43  1.51779 13.21 3.39 1.33 72.76 0.59  8.59 0.00 0.00  0.098872422 -0.74506000
## 44  1.52210 13.73 3.84 0.72 71.76 0.17  9.74 0.00 0.00 -1.903383686 -0.13483009
## 45  1.51786 12.73 3.43 1.19 72.95 0.62  8.76 0.00 0.30 -0.753472266 -1.19150824
## 46  1.51900 13.49 3.48 1.35 71.95 0.55  9.00 0.00 0.00 -0.414177960 -0.29260121
## 47  1.51869 13.19 3.37 1.18 72.72 0.57  8.83 0.00 0.16 -0.603009537 -0.77837482
## 48  1.52667 13.99 3.70 0.71 71.57 0.02  9.82 0.00 0.10 -2.964411026  0.46205713
## 49  1.52223 13.21 3.77 0.79 71.99 0.13 10.02 0.00 0.00 -2.067962926 -0.19322084
## 50  1.51898 13.58 3.35 1.23 72.08 0.59  8.91 0.00 0.00 -0.392192030 -0.33946226
## 51  1.52320 13.72 3.72 0.51 71.75 0.09 10.06 0.00 0.16 -2.720831501 -0.11277416
## 52  1.51926 13.20 3.33 1.28 72.36 0.60  9.14 0.00 0.11 -0.721377492 -0.47378107
## 53  1.51808 13.43 2.87 1.19 72.84 0.55  9.03 0.00 0.00 -0.105912122 -0.41353643
## 54  1.51837 13.14 2.84 1.28 72.85 0.55  9.07 0.00 0.00 -0.180936809 -0.40899893
## 55  1.51778 13.21 2.81 1.29 72.98 0.51  9.02 0.00 0.09 -0.171403012 -0.50909413
## 56  1.51769 12.45 2.71 1.29 73.70 0.56  9.06 0.00 0.24 -0.458182481 -0.96979793
## 57  1.51215 12.99 3.47 1.12 72.98 0.62  8.35 0.00 0.31  0.422208437 -1.81230677
## 58  1.51824 12.87 3.48 1.29 72.95 0.60  8.43 0.00 0.00 -0.015803508 -0.95521440
## 59  1.51754 13.48 3.74 1.17 72.99 0.59  8.03 0.00 0.00  0.326476940 -1.09978334
## 60  1.51754 13.39 3.66 1.19 72.79 0.57  8.27 0.00 0.11 -0.037285663 -1.05185437
## 61  1.51905 13.60 3.62 1.11 72.64 0.14  8.76 0.00 0.00 -0.456237146 -0.55062038
## 62  1.51977 13.81 3.58 1.32 71.72 0.12  8.67 0.69 0.00 -0.235668276  0.56700077
## 63  1.52172 13.51 3.86 0.88 71.79 0.23  9.54 0.00 0.11 -1.880429045 -0.29578219
## 64  1.52227 14.17 3.81 0.78 71.35 0.00  9.69 0.00 0.00 -1.902003672  0.18475364
## 65  1.52172 13.48 3.74 0.90 72.01 0.18  9.61 0.00 0.07 -1.763255868 -0.23430181
## 66  1.52099 13.69 3.59 1.12 71.96 0.09  9.40 0.00 0.00 -1.204275509 -0.01677727
## 67  1.52152 13.05 3.65 0.87 72.22 0.19  9.85 0.00 0.17 -2.090457226 -0.42601501
## 68  1.52152 13.05 3.65 0.87 72.32 0.19  9.85 0.00 0.17 -2.060912640 -0.44603951
## 69  1.52152 13.12 3.58 0.90 72.20 0.23  9.82 0.00 0.16 -2.000195008 -0.36264837
## 70  1.52300 13.31 3.58 0.82 71.99 0.12 10.17 0.00 0.03 -2.246687624  0.02790854
## 71  1.51574 14.86 3.67 1.74 71.87 0.16  7.36 0.00 0.12  1.108031745 -0.35961601
## 72  1.51848 13.64 3.87 1.27 71.96 0.54  8.32 0.00 0.32 -0.747591211 -0.86805941
## 73  1.51593 13.09 3.59 1.52 73.10 0.67  7.83 0.00 0.00  0.932881463 -1.20112937
## 74  1.51631 13.34 3.57 1.57 72.87 0.61  7.89 0.00 0.00  0.879271955 -0.97003865
## 75  1.51596 13.02 3.56 1.54 73.11 0.72  7.90 0.00 0.00  0.920404247 -1.19412945
## 76  1.51590 13.02 3.58 1.51 73.12 0.69  7.96 0.00 0.00  0.875987173 -1.20610130
## 77  1.51645 13.44 3.61 1.54 72.39 0.66  8.03 0.00 0.00  0.683486067 -0.83967114
## 78  1.51627 13.00 3.58 1.54 72.83 0.61  8.04 0.00 0.00  0.688744268 -1.06380504
## 79  1.51613 13.92 3.52 1.25 72.88 0.37  7.94 0.00 0.14  0.461914711 -0.98593559
## 80  1.51590 12.82 3.52 1.90 72.86 0.69  7.97 0.00 0.00  1.071986894 -0.96253189
## 81  1.51592 12.86 3.52 2.12 72.66 0.69  7.97 0.00 0.00  1.210858930 -0.77727570
## 82  1.51593 13.25 3.45 1.43 73.17 0.61  7.86 0.00 0.00  0.907062903 -1.13633552
## 83  1.51646 13.41 3.55 1.25 72.81 0.68  8.10 0.00 0.00  0.534404350 -1.06728175
## 84  1.51594 13.09 3.52 1.55 72.87 0.68  8.05 0.00 0.09  0.649880372 -1.11386078
## 85  1.51409 14.25 3.09 2.08 72.28 1.10  7.08 0.00 0.00  2.310957633 -0.57263981
## 86  1.51625 13.36 3.58 1.49 72.72 0.45  8.21 0.00 0.00  0.618078428 -0.87501030
## 87  1.51569 13.24 3.49 1.47 73.25 0.38  8.03 0.00 0.00  0.865733629 -1.07549645
## 88  1.51645 13.40 3.49 1.52 72.65 0.67  8.08 0.00 0.10  0.535049604 -0.92131867
## 89  1.51618 13.01 3.50 1.48 72.89 0.60  8.12 0.00 0.00  0.649380950 -1.06175662
## 90  1.51640 12.55 3.48 1.87 73.23 0.63  8.08 0.00 0.09  0.753625777 -1.09669524
## 91  1.51841 12.93 3.74 1.11 72.28 0.64  8.96 0.00 0.22 -0.989339128 -1.01950958
## 92  1.51605 12.90 3.44 1.45 73.06 0.44  8.27 0.00 0.00  0.561325997 -1.06331730
## 93  1.51588 13.12 3.41 1.58 73.26 0.07  8.39 0.00 0.19  0.306078725 -0.96181127
## 94  1.51590 13.24 3.34 1.47 73.10 0.39  8.22 0.00 0.00  0.732885652 -0.92022927
## 95  1.51629 12.71 3.33 1.49 73.28 0.67  8.24 0.00 0.00  0.653714815 -1.14035879
## 96  1.51860 13.36 3.43 1.43 72.26 0.51  8.60 0.00 0.00 -0.094419371 -0.45509758
## 97  1.51841 13.02 3.62 1.06 72.34 0.64  9.13 0.00 0.15 -0.902171426 -0.89608666
## 98  1.51743 12.20 3.25 1.16 73.55 0.62  8.90 0.00 0.24 -0.612459362 -1.39906120
## 99  1.51689 12.67 2.88 1.71 73.21 0.73  8.54 0.00 0.00  0.652579399 -0.70923980
## 100 1.51811 12.96 2.96 1.43 72.92 0.60  8.79 0.14 0.00  0.133270547 -0.41103490
## 101 1.51655 12.75 2.85 1.44 73.27 0.57  8.79 0.11 0.22  0.022594935 -0.80845352
## 102 1.51730 12.35 2.72 1.63 72.87 0.70  9.23 0.00 0.00  0.072201040 -0.51545452
## 103 1.51820 12.62 2.76 0.83 73.81 0.35  9.42 0.00 0.20 -0.981204161 -1.01772225
## 104 1.52725 13.80 3.15 0.66 70.57 0.08 11.64 0.00 0.00 -3.843370505  1.34191831
## 105 1.52410 13.83 2.90 1.17 71.15 0.08 10.79 0.00 0.00 -2.345864419  1.13753133
## 106 1.52475 11.45 0.00 1.88 72.19 0.81 13.24 0.00 0.34 -3.325489759  2.02142921
## 107 1.53125 10.73 0.00 2.10 69.81 0.58 13.30 3.15 0.28 -3.631698232  6.17895704
## 108 1.53393 12.30 0.00 1.00 70.16 0.12 16.19 0.00 0.24 -7.121999125  3.99506958
## 109 1.52222 14.43 0.00 1.00 72.67 0.10 11.52 0.00 0.08 -1.691057932  2.06929378
## 110 1.51818 13.72 0.00 0.56 74.45 0.00 10.99 0.00 0.00 -0.739858727  0.78350436
## 111 1.52664 11.23 0.00 0.77 73.21 0.00 14.68 0.00 0.00 -4.508174751  2.02298240
## 112 1.52739 11.02 0.00 0.75 73.08 0.00 14.96 0.00 0.00 -4.861635479  2.10617054
## 113 1.52777 12.64 0.00 0.67 72.02 0.06 14.40 0.00 0.00 -4.585745031  2.69313310
## 114 1.51892 13.46 3.83 1.26 72.55 0.57  8.21 0.00 0.14 -0.323226651 -0.91302971
## 115 1.51847 13.10 3.97 1.19 72.44 0.60  8.43 0.00 0.00 -0.258602691 -1.01607386
## 116 1.51846 13.41 3.89 1.33 72.38 0.51  8.28 0.00 0.00 -0.028560236 -0.80182435
## 117 1.51829 13.24 3.90 1.41 72.33 0.55  8.31 0.00 0.10 -0.186277287 -0.88672993
## 118 1.51708 13.72 3.68 1.81 72.06 0.64  7.88 0.00 0.00  0.833021446 -0.52246571
## 119 1.51673 13.30 3.64 1.53 72.53 0.65  8.03 0.00 0.29  0.062966211 -1.08825359
## 120 1.51652 13.56 3.57 1.47 72.45 0.64  7.96 0.00 0.00  0.687034382 -0.84256912
## 121 1.51844 13.25 3.76 1.32 72.40 0.58  8.42 0.00 0.00 -0.093117107 -0.79564812
## 122 1.51663 12.93 3.54 1.62 72.96 0.64  8.03 0.00 0.21  0.325189921 -1.15859792
## 123 1.51687 13.23 3.54 1.48 72.84 0.56  8.10 0.00 0.00  0.570672276 -0.92587090
## 124 1.51707 13.48 3.48 1.71 72.52 0.62  7.99 0.00 0.00  0.779587582 -0.64038561
## 125 1.52177 13.20 3.68 1.15 72.75 0.54  8.52 0.00 0.00 -0.791185959 -0.60291463
## 126 1.51872 12.93 3.66 1.56 72.51 0.58  8.55 0.00 0.12 -0.272108434 -0.75907116
## 127 1.51667 12.94 3.61 1.26 72.75 0.56  8.60 0.00 0.00  0.121066173 -1.06021781
## 128 1.52081 13.78 2.28 1.43 71.99 0.49  9.85 0.00 0.17 -1.113133982  0.61898725
## 129 1.52068 13.55 2.09 1.67 72.18 0.53  9.57 0.27 0.17 -0.639406292  0.89846847
## 130 1.52020 13.98 1.35 1.63 71.76 0.39 10.56 0.00 0.18 -1.063446961  1.36437865
## 131 1.52177 13.75 1.01 1.36 72.19 0.33 11.14 0.00 0.00 -1.374166428  1.59961314
## 132 1.52614 13.70 0.00 1.36 71.24 0.19 13.44 0.00 0.10 -3.410946173  3.12756662
## 133 1.51813 13.43 3.98 1.18 72.49 0.58  8.15 0.00 0.00  0.002295681 -1.02207703
## 134 1.51800 13.71 3.93 1.54 71.81 0.54  8.21 0.00 0.15 -0.094095789 -0.64350258
## 135 1.51811 13.33 3.85 1.25 72.78 0.52  8.12 0.00 0.00  0.120254788 -1.01336614
## 136 1.51789 13.19 3.90 1.30 72.33 0.55  8.44 0.00 0.28 -0.613006461 -1.08900951
## 137 1.51806 13.00 3.80 1.08 73.07 0.56  8.38 0.00 0.12 -0.336892385 -1.28808449
## 138 1.51711 12.89 3.62 1.57 72.96 0.61  8.11 0.00 0.00  0.540055552 -1.02896747
## 139 1.51674 12.79 3.52 1.54 73.36 0.66  7.90 0.00 0.00  0.764433983 -1.21633493
## 140 1.51674 12.87 3.56 1.64 73.14 0.65  7.99 0.00 0.00  0.773019346 -1.07892467
## 141 1.51690 13.33 3.54 1.61 72.54 0.68  8.11 0.00 0.00  0.656788819 -0.77890419
## 142 1.51851 13.20 3.63 1.07 72.83 0.57  8.41 0.09 0.17 -0.477940705 -1.00661777
## 143 1.51662 12.85 3.51 1.44 73.01 0.68  8.23 0.06 0.25  0.062404858 -1.21800694
## 144 1.51709 13.00 3.47 1.79 72.72 0.66  8.18 0.00 0.00  0.700549198 -0.74937994
## 145 1.51660 12.99 3.18 1.23 72.97 0.58  8.81 0.00 0.24 -0.301931694 -1.04165925
## 146 1.51839 12.85 3.67 1.24 72.57 0.62  8.68 0.00 0.35 -0.966160449 -1.14627570
## 147 1.51769 13.65 3.66 1.11 72.77 0.11  8.60 0.00 0.00 -0.115693913 -0.73624410
## 148 1.51610 13.33 3.53 1.34 72.67 0.56  8.33 0.00 0.00  0.491277923 -0.95400513
## 149 1.51670 13.24 3.57 1.38 72.70 0.56  8.44 0.00 0.10  0.166474308 -0.96314821
## 150 1.51643 12.16 3.52 1.35 72.89 0.57  8.53 0.00 0.00  0.070734912 -1.29815877
## 151 1.51665 13.14 3.45 1.76 72.48 0.60  8.38 0.00 0.17  0.315062048 -0.75140806
## 152 1.52127 14.32 3.90 0.83 71.50 0.00  9.49 0.00 0.00 -1.525552359  0.05429671
## 153 1.51779 13.64 3.65 0.65 73.00 0.06  8.93 0.00 0.00 -0.594046038 -0.95219028
## 154 1.51610 13.42 3.40 1.22 72.69 0.59  8.32 0.00 0.00  0.446137136 -0.95518209
## 155 1.51694 12.86 3.58 1.31 72.61 0.61  8.79 0.00 0.00  0.002275404 -0.95705362
## 156 1.51646 13.04 3.40 1.26 73.01 0.52  8.58 0.00 0.00  0.276799815 -1.00792433
## 157 1.51655 13.41 3.39 1.28 72.64 0.52  8.65 0.00 0.00  0.262011133 -0.76994380
## 158 1.52121 14.03 3.76 0.58 71.79 0.11  9.65 0.00 0.00 -1.743028857 -0.18277801
## 159 1.51776 13.53 3.41 1.52 72.04 0.58  8.79 0.00 0.00  0.081749620 -0.34275204
## 160 1.51796 13.50 3.36 1.63 71.94 0.57  8.81 0.00 0.09 -0.076819978 -0.27831645
## 161 1.51832 13.33 3.34 1.54 72.14 0.56  8.99 0.00 0.00 -0.105813225 -0.28241967
## 162 1.51934 13.64 3.54 0.75 72.65 0.16  8.89 0.15 0.24 -1.216126815 -0.67179766
## 163 1.52211 14.19 3.78 0.91 71.36 0.23  9.14 0.00 0.37 -2.188146555 -0.15981999
## 164 1.51514 14.01 2.68 3.50 69.89 1.68  5.87 2.20 0.00  4.312761323  2.64764894
## 165 1.51915 12.73 1.85 1.86 72.69 0.60 10.09 0.00 0.00 -0.259728974  0.54675137
## 166 1.52171 11.56 1.88 1.56 72.86 0.47 11.41 0.00 0.00 -1.799158000  0.52749091
## 167 1.52151 11.03 1.71 1.56 73.44 0.58 11.62 0.00 0.00 -1.782007895  0.31202030
## 168 1.51969 12.64 0.00 1.65 73.75 0.38 11.53 0.00 0.00 -0.682176998  1.39401482
## 169 1.51666 12.86 0.00 1.83 73.88 0.97 10.17 0.00 0.00  0.793164967  0.79287059
## 170 1.51994 13.27 0.00 1.76 73.03 0.47 11.32 0.00 0.00 -0.543270058  1.76311117
## 171 1.52369 13.44 0.00 1.58 72.22 0.32 12.24 0.00 0.00 -1.925304089  2.48661199
## 172 1.51316 13.02 0.00 3.04 70.48 6.21  6.96 0.00 0.00  4.379266673 -0.10320759
## 173 1.51321 13.00 0.00 3.02 70.70 6.21  6.93 0.00 0.00  4.422171206 -0.16828555
## 174 1.52043 13.38 0.00 1.40 72.25 0.33 12.50 0.00 0.00 -1.591311056  2.10837265
## 175 1.52058 12.85 1.61 2.17 72.18 0.76  9.70 0.24 0.51 -1.007681786  0.88200991
## 176 1.52119 12.97 0.33 1.51 73.39 0.13 11.27 0.00 0.28 -1.627260177  1.31553283
## 177 1.51905 14.00 2.39 1.56 72.37 0.00  9.57 0.00 0.00 -0.255898780  0.63772997
## 178 1.51937 13.79 2.41 1.19 72.76 0.00  9.77 0.00 0.00 -0.652932605  0.34174447
## 179 1.51829 14.46 2.24 1.62 72.38 0.00  9.26 0.00 0.00  0.199183253  0.73849379
## 180 1.51852 14.09 2.19 1.66 72.67 0.00  9.32 0.00 0.00  0.144052200  0.63835256
## 181 1.51299 14.40 1.74 1.54 74.55 0.00  7.59 0.00 0.00  2.320228067 -0.46131869
## 182 1.51888 14.99 0.78 1.74 72.50 0.00  9.95 0.00 0.00  0.272836175  1.78463743
## 183 1.51916 14.15 0.00 2.09 72.74 0.00 10.88 0.00 0.00  0.066740479  2.23844551
## 184 1.51969 14.56 0.00 0.56 73.48 0.00 11.22 0.00 0.00 -1.111557735  1.45370407
## 185 1.51115 17.38 0.00 0.34 75.41 0.00  6.65 0.00 0.00  3.275117723 -0.04169360
## 186 1.51131 13.69 3.20 1.81 72.81 1.76  5.43 1.19 0.00  3.941270834 -0.72680250
## 187 1.51838 14.32 3.26 2.22 71.25 1.46  5.79 1.63 0.00  2.753888832  1.26409106
## 188 1.52315 13.44 3.34 1.23 72.38 0.60  8.83 0.00 0.00 -1.064602604 -0.07126640
## 189 1.52247 14.86 2.20 2.06 70.26 0.76  9.76 0.00 0.00 -0.587586194  1.90720773
## 190 1.52365 15.79 1.83 1.31 70.43 0.31  8.61 1.68 0.00  0.021652455  3.46570911
## 191 1.51613 13.88 1.78 1.79 73.10 0.00  8.67 0.76 0.00  1.384460992  1.08659766
## 192 1.51602 14.85 0.00 2.38 73.28 0.00  8.76 0.64 0.09  2.144237273  2.29023858
## 193 1.51623 14.20 0.00 2.79 73.46 0.04  9.04 0.40 0.09  2.102052174  2.12573463
## 194 1.51719 14.75 0.00 2.00 73.02 0.00  8.53 1.59 0.08  2.076487442  3.07120430
## 195 1.51683 14.56 0.00 1.98 73.29 0.00  8.52 1.57 0.07  2.156114015  2.89298752
## 196 1.51545 14.14 0.00 2.68 73.39 0.08  9.07 0.61 0.05  2.293087851  2.20948886
## 197 1.51556 13.87 0.00 2.54 73.23 0.14  9.41 0.81 0.01  2.100074245  2.36848931
## 198 1.51727 14.70 0.00 2.34 73.28 0.00  8.95 0.66 0.00  1.954075394  2.45742637
## 199 1.51531 14.38 0.00 2.66 73.10 0.04  9.08 0.64 0.00  2.384788886  2.39496974
## 200 1.51609 15.01 0.00 2.51 73.05 0.05  8.83 0.53 0.00  2.334785562  2.42797362
## 201 1.51508 15.15 0.00 2.25 73.50 0.00  8.34 0.63 0.00  2.673092939  2.12583599
## 202 1.51653 11.95 0.00 1.19 75.18 2.70  8.93 0.00 0.00  1.374163606 -0.86872243
## 203 1.51514 14.85 0.00 2.42 73.72 0.00  8.39 0.56 0.00  2.725920175  2.03252171
## 204 1.51658 14.80 0.00 1.99 73.11 0.00  8.28 1.71 0.00  2.519291587  3.11368211
## 205 1.51617 14.95 0.00 2.27 73.30 0.00  8.71 0.67 0.00  2.264430828  2.34282262
## 206 1.51732 14.95 0.00 1.80 72.99 0.00  8.61 1.55 0.00  2.040536696  3.06875444
## 207 1.51645 14.94 0.00 1.87 73.11 0.00  8.67 1.38 0.00  2.182759112  2.84980279
## 208 1.51831 14.39 0.00 1.82 72.86 1.41  6.47 2.88 0.00  3.548777004  3.45864136
## 209 1.51640 14.37 0.00 2.74 72.85 0.00  9.45 0.54 0.00  1.988983290  2.59331608
## 210 1.51623 14.14 0.00 2.88 72.61 0.08  9.18 1.06 0.00  2.378258340  3.05451519
## 211 1.51685 14.92 0.00 1.99 73.06 0.00  8.40 1.59 0.00  2.392043354  3.10096497
## 212 1.52065 14.36 0.00 2.02 73.42 0.00  8.44 1.64 0.00  1.676315859  3.27713965
## 213 1.51651 14.38 0.00 1.94 73.61 0.00  8.48 1.57 0.00  2.364204406  2.75042396
## 214 1.51711 14.23 0.00 2.08 73.36 0.00  8.62 1.67 0.00  2.257356100  3.02150712
##              PC3           PC4
## 1    0.371225255 -1.7248568105
## 2    0.555405924 -0.7584539597
## 3    0.553609408 -0.2057718428
## 4    0.116850709 -0.4147515674
## 5    0.483944005 -0.0689406529
## 6   -0.866646619  0.9256271150
## 7    0.539373202 -0.0801402072
## 8    0.623280854  0.1157506818
## 9    0.108804570 -1.3684635985
## 10  -0.120572324  0.3751414534
## 11  -0.687911388  1.1548529059
## 12   0.144462275  0.2405245805
## 13  -0.484926709  1.0744886211
## 14  -0.139379929  0.7700931118
## 15   0.215034763  0.6072786736
## 16   0.333239665  0.4155419550
## 17   0.203528766  0.3816328266
## 18   0.485746132 -2.3646823834
## 19   0.701291213 -1.2538048999
## 20  -0.329388809  0.1717920231
## 21  -0.634539069  0.5433672707
## 22   1.653753272 -2.1188842738
## 23   0.009772241  0.1229303264
## 24   0.086005091  0.3014342156
## 25   0.516972396 -0.2445061170
## 26   0.212549641  0.1354472052
## 27   0.028810565 -0.2724098526
## 28   0.209275686  0.2802505628
## 29   0.038586273  0.5755947771
## 30   0.175949905 -0.0306774280
## 31  -0.324185111  0.7788437611
## 32   0.449166058  0.4451783444
## 33  -0.497469340  0.7040730014
## 34   0.017364209  0.9240585453
## 35   0.036503202  0.3323683008
## 36   0.353057923 -0.1483908082
## 37  -0.051218092 -1.4411483670
## 38  -0.015419761  0.3129696922
## 39   0.971056260 -1.9658570205
## 40   0.971056260 -1.9658570205
## 41   0.202365548  0.2926908461
## 42   0.274628190  0.5173143752
## 43   0.157275658 -0.1318372421
## 44   0.513922964 -1.5839050048
## 45  -0.772515223  1.0089734478
## 46  -0.197869624 -0.9822537857
## 47  -0.249165126  0.1906762302
## 48   0.261094551 -1.8449299890
## 49   0.396383105 -0.9939418999
## 50  -0.038692283 -0.9399317350
## 51   0.225399358 -1.2301085988
## 52  -0.423976206 -0.1645345439
## 53   0.436352469 -0.0297550675
## 54   0.238132445  0.1794857000
## 55   0.136450864  0.4869834635
## 56  -0.280883058  1.9469375204
## 57  -0.452330029  1.0691808961
## 58   0.112238600  0.1457878535
## 59   0.530991959 -0.3331146990
## 60   0.056765191 -0.1153089853
## 61   0.834996791 -0.6432518396
## 62   0.147767878 -1.7147353720
## 63  -0.048976438 -1.1441284233
## 64   0.606925487 -2.1976147153
## 65   0.222300088 -0.9876925303
## 66   0.464003138 -1.2324312553
## 67  -0.131908081 -0.2432589907
## 68  -0.072685135 -0.1590112016
## 69  -0.141596362 -0.3026924257
## 70   0.325493827 -0.9337981478
## 71   0.280291857 -1.7158206820
## 72  -0.980361673 -0.5389940990
## 73   0.147040580  0.1739669174
## 74   0.145935881 -0.1615039917
## 75   0.055347471  0.2529835594
## 76   0.113172374  0.2606878580
## 77  -0.126353608 -0.6214622177
## 78  -0.017044634  0.0295195707
## 79   0.476870331 -0.2415521421
## 80  -0.391904137  0.2870674530
## 81  -0.637143984  0.1541296777
## 82   0.385057615  0.1509494864
## 83   0.279272670 -0.2993944880
## 84  -0.281574873  0.2625774851
## 85  -0.542875215 -0.9601296877
## 86   0.283711016 -0.2689491226
## 87   0.641758843  0.2559552429
## 88  -0.279391824 -0.1054967634
## 89   0.076026153  0.0978529022
## 90  -0.496044621  0.9699016858
## 91  -0.826467898  0.0448572384
## 92   0.311359384  0.3407327827
## 93   0.274129756  0.8797100999
## 94   0.537762200  0.1962808871
## 95   0.085804075  0.6763940268
## 96  -0.076211910 -0.6683683840
## 97  -0.510371923 -0.0735566444
## 98  -0.458608726  1.7784299129
## 99  -0.194875405  0.8529481865
## 100  0.030726432  0.2802260655
## 101 -0.429582833  1.3354455416
## 102 -0.474160583  0.8913514201
## 103  0.483211623  1.7356726879
## 104 -0.168879778 -2.3500711451
## 105 -0.056539312 -1.6856064797
## 106 -2.764831118  2.8711695115
## 107 -4.905112880  0.0567794593
## 108 -2.253856170  0.2574396209
## 109  1.055945888  0.3722184019
## 110  2.515983086  2.0757233714
## 111  0.229873693  2.8929923531
## 112  0.045815414  2.9222822422
## 113  0.162203333  0.9090086613
## 114 -0.226640482 -0.3926394033
## 115 -0.024882309 -0.5896170425
## 116  0.085468307 -0.8010545700
## 117 -0.404767376 -0.4685130923
## 118 -0.366078469 -1.0728324989
## 119 -0.947457846  0.2418896414
## 120  0.030404857 -0.6700525065
## 121 -0.041197784 -0.6242683151
## 122 -0.679407371  0.6928045513
## 123  0.170757964 -0.1268546052
## 124 -0.118989257 -0.4952658556
## 125  0.200491427 -0.4696803943
## 126 -0.642807732  0.0487903289
## 127  0.131498420 -0.0003670475
## 128 -0.569769365 -0.3099875829
## 129 -0.800139510 -0.0135953058
## 130 -0.647821035 -0.1394985260
## 131  0.220350791 -0.0168146211
## 132 -0.633112032 -0.0588898519
## 133  0.196671115 -0.7904610243
## 134 -0.704660813 -1.0490788767
## 135  0.337385821 -0.4409698160
## 136 -0.869730035  0.0017255183
## 137  0.076638408  0.3073310593
## 138 -0.035912893  0.1758038021
## 139  0.133856591  0.5710687112
## 140 -0.014680290  0.3715267033
## 141 -0.168263014 -0.3963739948
## 142 -0.146021901  0.1054610972
## 143 -0.734550929  0.8616055130
## 144 -0.320573624  0.0249409962
## 145 -0.411146384  0.8726507557
## 146 -1.136558021  0.6444032929
## 147  1.004609683 -0.5411627453
## 148  0.231790699 -0.2841190918
## 149 -0.128499100  0.0246081760
## 150 -0.215418670  0.6338651851
## 151 -0.799408890  0.1943106492
## 152  0.761448000 -2.1616607524
## 153  1.487670826 -0.4091474684
## 154  0.335464973 -0.3204913267
## 155 -0.080311333 -0.0217817150
## 156  0.380473139  0.2176109047
## 157  0.320096242 -0.2993219587
## 158  0.852251385 -1.7344854315
## 159 -0.232545956 -0.8441318718
## 160 -0.636441839 -0.6604230935
## 161 -0.275946206 -0.6051893686
## 162  0.346143165 -0.1971245490
## 163 -0.772872117 -1.3677824317
## 164 -3.953222992 -3.1714941005
## 165 -0.498993313  0.8742848282
## 166 -0.692437850  1.7553237405
## 167 -0.703658985  2.6644321840
## 168  0.444670009  2.4899477535
## 169 -0.006957136  2.4344324079
## 170  0.143954941  1.4870650170
## 171 -0.091215219  0.6406712593
## 172 -7.968509793 -0.3370566392
## 173 -7.835909582 -0.1534423802
## 174  0.100285810  0.8617700975
## 175 -2.675809147  1.5272629380
## 176 -0.129111882  2.3871908688
## 177  0.716862071 -0.5153373914
## 178  1.083700159 -0.1442776521
## 179  0.922457793 -0.7510510167
## 180  0.887172243 -0.2595128489
## 181  2.385509867  1.1553102688
## 182  1.156330196 -0.4469317765
## 183  0.668896632  0.7288686390
## 184  2.294413470  0.7245987513
## 185  5.152987119  0.1203132842
## 186 -1.084877203 -0.7453128733
## 187 -1.945355157 -2.7501608771
## 188 -0.056510568 -0.8176646031
## 189 -1.325819398 -2.7068738764
## 190 -0.117649609 -3.9897173618
## 191  0.914265854  0.1587232903
## 192  0.857760710  0.6246401796
## 193  0.376896511  1.3910676423
## 194  0.761289596 -0.0184659248
## 195  0.887287957  0.3150229164
## 196  0.446897236  1.2330706153
## 197  0.340308386  1.1382016940
## 198  1.037547595  0.4618497913
## 199  0.587613421  0.7189302870
## 200  0.937606974  0.2001445075
## 201  1.506023223  0.3475290593
## 202 -0.998639968  3.7684765297
## 203  1.391542484  0.7857141463
## 204  1.077706943 -0.2158149569
## 205  1.243219483  0.3131145705
## 206  1.205518125 -0.3884328049
## 207  1.275970503 -0.1626314233
## 208 -0.808972009 -0.8922192914
## 209  0.406679659  0.5797531831
## 210 -0.090233797  0.3757303197
## 211  1.114887999 -0.2877797172
## 212  0.928172257  0.1706138251
## 213  1.231812566  0.5240557739
## 214  0.888760893  0.4135215127

9 Visualizazing PCA: Biplot

PCA is not only useful for dimensionality reduction but is good for visualizing high-dimensional data. Visualization can use a biplot showing:

  • Individual factor map, which is the overall distribution of data using 2 PCs. The goal is to find out similar observations and outliers.
  • Variables factor map, which is a plot that shows the correlation between variables and their contribution to the PC.
# Using 200 sample
glass_clean_200 <- head(glass_clean, 200)

# conduct PCA
glass_clean_200_pca <- prcomp(glass_clean_200, scale = T)
  
# make biplot
biplot(x = glass_clean_200_pca,
       cex = 0.4,
       scale = F)

Insight: Variable Contribution

  • Two variables that contribute highly to PC1: Si & Mg
  • Three variables that contribute highly to PC2: Ba, Al,& K
  • Low contributing variables on PC1 and PC2: Ca, Ri, Na, Fe

10 Visualizazing PCA: FactoMineR

head(glass)
##        RI    Na   Mg   Al    Si    K   Ca Ba   Fe Type
## 1 1.52101 13.64 4.49 1.10 71.78 0.06 8.75  0 0.00    1
## 2 1.51761 13.89 3.60 1.36 72.73 0.48 7.83  0 0.00    1
## 3 1.51618 13.53 3.55 1.54 72.99 0.39 7.78  0 0.00    1
## 4 1.51766 13.21 3.69 1.29 72.61 0.57 8.22  0 0.00    1
## 5 1.51742 13.27 3.62 1.24 73.08 0.55 8.07  0 0.00    1
## 6 1.51596 12.79 3.61 1.62 72.97 0.64 8.07  0 0.26    1
# Change Type as a Factor
glass_clean2 <- glass %>%
  
  # change Type -> factor
  mutate_at(vars(Type), as.factor)

head(glass_clean2)
##        RI    Na   Mg   Al    Si    K   Ca Ba   Fe Type
## 1 1.52101 13.64 4.49 1.10 71.78 0.06 8.75  0 0.00    1
## 2 1.51761 13.89 3.60 1.36 72.73 0.48 7.83  0 0.00    1
## 3 1.51618 13.53 3.55 1.54 72.99 0.39 7.78  0 0.00    1
## 4 1.51766 13.21 3.69 1.29 72.61 0.57 8.22  0 0.00    1
## 5 1.51742 13.27 3.62 1.24 73.08 0.55 8.07  0 0.00    1
## 6 1.51596 12.79 3.61 1.62 72.97 0.64 8.07  0 0.26    1
# colomn numerik name (quantitative)
quanti <- glass_clean2 %>% 
  select_if(is.numeric) %>% 
  colnames()

# numerical index colomn
quantivar <- which(colnames(glass_clean) %in% quanti)

# categorical colomn name (qualitative)
quali <- glass_clean2 %>% 
  select_if(is.factor) %>% 
  colnames()

# categorical colomn index
qualivar <- which(colnames(glass_clean2) %in% quali)

# PCA with FactoMineR
glass_pca <- PCA(X = glass_clean2, # origin data
                scale.unit = T, # scaling
                quali.sup = qualivar, # index colomn qualitative
                graph = F,
                ncp = 9) # 9 colomn numerical in glass_clean
glass_pca
## **Results for the Principal Component Analysis (PCA)**
## The analysis was performed on 214 individuals, described by 10 variables
## *The results are available in the following objects:
## 
##    name                description                                          
## 1  "$eig"              "eigenvalues"                                        
## 2  "$var"              "results for the variables"                          
## 3  "$var$coord"        "coord. for the variables"                           
## 4  "$var$cor"          "correlations variables - dimensions"                
## 5  "$var$cos2"         "cos2 for the variables"                             
## 6  "$var$contrib"      "contributions of the variables"                     
## 7  "$ind"              "results for the individuals"                        
## 8  "$ind$coord"        "coord. for the individuals"                         
## 9  "$ind$cos2"         "cos2 for the individuals"                           
## 10 "$ind$contrib"      "contributions of the individuals"                   
## 11 "$quali.sup"        "results for the supplementary categorical variables"
## 12 "$quali.sup$coord"  "coord. for the supplementary categories"            
## 13 "$quali.sup$v.test" "v-test of the supplementary categories"             
## 14 "$call"             "summary statistics"                                 
## 15 "$call$centre"      "mean of the variables"                              
## 16 "$call$ecart.type"  "standard error of the variables"                    
## 17 "$call$row.w"       "weights for the individuals"                        
## 18 "$call$col.w"       "weights for the variables"
# summary(prcomp_pca)
glass_pca$eig
##         eigenvalue percentage of variance cumulative percentage of variance
## comp 1 2.511163726            27.90181918                          27.90182
## comp 2 2.050072185            22.77857983                          50.68040
## comp 3 1.404843994            15.60937771                          66.28978
## comp 4 1.157862446            12.86513829                          79.15492
## comp 5 0.914002247            10.15558052                          89.31050
## comp 6 0.527635193             5.86261325                          95.17311
## comp 7 0.368958443             4.09953826                          99.27265
## comp 8 0.063852948             0.70947720                          99.98212
## comp 9 0.001608818             0.01787575                         100.00000
# check value in every PC (the projection in new axis)
# equivalent with pca$x
head(glass_pca$ind$coord)
##        Dim.1      Dim.2      Dim.3      Dim.4      Dim.5      Dim.6       Dim.7
## 1 -1.1511396 -0.5294876 -0.3720957 -1.7289010 -0.2519358 -0.3402101 -0.39560005
## 2  0.5741372 -0.7597878 -0.5567082 -0.7602323 -0.2570707  0.1159602 -0.02415793
## 3  0.9401597 -0.9298360 -0.5549074 -0.2062543 -0.2375059 -0.1266303 -0.36751757
## 4  0.1420833 -0.9616774 -0.1171247 -0.4157240 -0.4762989 -0.2858047 -0.05249672
## 5  0.3510923 -1.0912492 -0.4850787 -0.0691023 -0.4320899 -0.2980325  0.15856951
## 6  0.2902666 -1.3240076  0.8686786  0.9277974  1.8146606  0.1412217 -0.26428610
##          Dim.8        Dim.9
## 1  0.197160077 -0.016346486
## 2  0.284213558  0.010789795
## 3  0.095940674 -0.021640187
## 4  0.002959337 -0.092035490
## 5  0.191315577 -0.002314543
## 6 -0.032939386  0.001773360
#equivalent with eigen vector or pca$rotation
glass_pca$var$coord
##         Dim.1      Dim.2        Dim.3       Dim.4        Dim.5       Dim.6
## RI -0.8639224  0.4090433  0.103012029 -0.15858786 -0.070309370 -0.08374327
## Na  0.4090426  0.3870892 -0.456230271 -0.52859617  0.146926564  0.40540824
## Mg -0.1757092 -0.8498611  0.009977480 -0.40758870  0.118079002 -0.22386168
## Al  0.6793596  0.4226860  0.390231965  0.14796189  0.013488577  0.01369767
## Si  0.3626290 -0.2220718 -0.543689765  0.70215679  0.008126406 -0.06254027
## K   0.3475869 -0.2204556  0.785323363  0.04146568 -0.293540727  0.17697090
## Ca -0.7801403  0.4945173 -0.001167165  0.29746401 -0.179914002  0.10799121
## Ba  0.3967607  0.6940001  0.087774195 -0.14330214  0.240284262 -0.47739392
## Fe -0.2944966 -0.0888276  0.337148189  0.24801867  0.834870685  0.17654374
##          Dim.7        Dim.8         Dim.9
## RI  0.04972776  0.190078495 -0.0010321101
## Na  0.09025042  0.032266963  0.0125118227
## Mg -0.12515598  0.019429596  0.0231544752
## Al -0.42472932  0.069348894  0.0077102330
## Si  0.13124305  0.096003274  0.0119557378
## K   0.30621317  0.027748469  0.0104490197
## Ca -0.06021631 -0.100749247  0.0232366952
## Ba  0.21367958 -0.036623159  0.0079509473
## Fe  0.04477979  0.004111646  0.0005883923
plot.PCA(
  x = glass_pca,
  choix = "ind",
  invisible = "quali",
  select = "contrib 10"
)

Variables Factor Map

# variables factor map
plot.PCA(
  x = glass_pca,
  choix = "var"
)

Interpretation:

The shown percentage on axis Dim 1 (27.90%) and Dim 2 (22.78%) shows how much the axis summarzie the information. As a collective, the above biplot explained 50.68% of original data.

  • PC1 summarizes at most four variables which is Ca, Ri, Ba, and Al which has the most contributions among other variables.
  • PC2 summarizes at most one variables which is Mg which has the most contributions among other variables.

11 Reduce Dimension Factominer

# PCA summary
summary(glass_pca) # showing the overall PCA
## 
## Call:
## PCA(X = glass_clean2, scale.unit = T, ncp = 9, quali.sup = qualivar,  
##      graph = F) 
## 
## 
## Eigenvalues
##                        Dim.1   Dim.2   Dim.3   Dim.4   Dim.5   Dim.6   Dim.7
## Variance               2.511   2.050   1.405   1.158   0.914   0.528   0.369
## % of var.             27.902  22.779  15.609  12.865  10.156   5.863   4.100
## Cumulative % of var.  27.902  50.680  66.290  79.155  89.310  95.173  99.273
##                        Dim.8   Dim.9
## Variance               0.064   0.002
## % of var.              0.709   0.018
## Cumulative % of var.  99.982 100.000
## 
## Individuals (the 10 first)
##            Dist    Dim.1    ctr   cos2    Dim.2    ctr   cos2    Dim.3    ctr
## 1      |  2.260 | -1.151  0.247  0.259 | -0.529  0.064  0.055 | -0.372  0.046
## 2      |  1.398 |  0.574  0.061  0.169 | -0.760  0.132  0.295 | -0.557  0.103
## 3      |  1.522 |  0.940  0.164  0.382 | -0.930  0.197  0.373 | -0.555  0.102
## 4      |  1.205 |  0.142  0.004  0.014 | -0.962  0.211  0.637 | -0.117  0.005
## 5      |  1.375 |  0.351  0.023  0.065 | -1.091  0.271  0.630 | -0.485  0.078
## 6      |  2.615 |  0.290  0.016  0.012 | -1.324  0.400  0.256 |  0.869  0.251
## 7      |  1.417 |  0.253  0.012  0.032 | -1.116  0.284  0.621 | -0.541  0.097
## 8      |  1.591 |  0.120  0.003  0.006 | -1.222  0.340  0.590 | -0.625  0.130
## 9      |  1.524 |  0.021  0.000  0.000 | -0.322  0.024  0.045 | -0.109  0.004
## 10     |  1.240 |  0.002  0.000  0.000 | -1.066  0.259  0.739 |  0.121  0.005
##          cos2  
## 1       0.027 |
## 2       0.158 |
## 3       0.133 |
## 4       0.009 |
## 5       0.124 |
## 6       0.110 |
## 7       0.146 |
## 8       0.154 |
## 9       0.005 |
## 10      0.009 |
## 
## Variables
##           Dim.1    ctr   cos2    Dim.2    ctr   cos2    Dim.3    ctr   cos2  
## RI     | -0.864 29.722  0.746 |  0.409  8.161  0.167 |  0.103  0.755  0.011 |
## Na     |  0.409  6.663  0.167 |  0.387  7.309  0.150 | -0.456 14.816  0.208 |
## Mg     | -0.176  1.229  0.031 | -0.850 35.231  0.722 |  0.010  0.007  0.000 |
## Al     |  0.679 18.379  0.462 |  0.423  8.715  0.179 |  0.390 10.840  0.152 |
## Si     |  0.363  5.237  0.131 | -0.222  2.406  0.049 | -0.544 21.041  0.296 |
## K      |  0.348  4.811  0.121 | -0.220  2.371  0.049 |  0.785 43.900  0.617 |
## Ca     | -0.780 24.237  0.609 |  0.495 11.929  0.245 | -0.001  0.000  0.000 |
## Ba     |  0.397  6.269  0.157 |  0.694 23.494  0.482 |  0.088  0.548  0.008 |
## Fe     | -0.294  3.454  0.087 | -0.089  0.385  0.008 |  0.337  8.091  0.114 |
## 
## Supplementary categories
##            Dist    Dim.1   cos2 v.test    Dim.2   cos2 v.test    Dim.3   cos2
## Type_1 |  0.930 | -0.477  0.264 -3.066 | -0.726  0.609 -5.156 | -0.148  0.025
## Type_2 |  0.569 | -0.350  0.378 -2.392 | -0.330  0.337 -2.498 |  0.228  0.161
## Type_3 |  0.929 | -0.321  0.120 -0.870 | -0.661  0.506 -1.979 | -0.152  0.027
## Type_5 |  2.598 |  0.207  0.006  0.486 |  1.118  0.185  2.899 |  1.840  0.502
## Type_6 |  2.235 |  0.474  0.045  0.915 |  0.816  0.133  1.744 | -1.700  0.579
## Type_7 |  3.073 |  2.018  0.431  7.358 |  2.250  0.536  9.079 | -0.449  0.021
##        v.test  
## Type_1 -1.272 |
## Type_2  2.087 |
## Type_3 -0.550 |
## Type_5  5.763 |
## Type_6 -4.387 |
## Type_7 -2.189 |
glass_pca$eig 
##         eigenvalue percentage of variance cumulative percentage of variance
## comp 1 2.511163726            27.90181918                          27.90182
## comp 2 2.050072185            22.77857983                          50.68040
## comp 3 1.404843994            15.60937771                          66.28978
## comp 4 1.157862446            12.86513829                          79.15492
## comp 5 0.914002247            10.15558052                          89.31050
## comp 6 0.527635193             5.86261325                          95.17311
## comp 7 0.368958443             4.09953826                          99.27265
## comp 8 0.063852948             0.70947720                          99.98212
## comp 9 0.001608818             0.01787575                         100.00000
# showing cummulative proportion variance/eigen value

PC1 to PC2 contain 50.68% informasi.

12 K-Means Clustering

set.seed(100)

# k-means with 3 cluster
glass_km <- kmeans(x = glass_clean2,
                    centers = 3)
glass_km$iter
## [1] 2
glass_km$size
## [1]  44 152  18
glass_km$centers
##         RI       Na        Mg       Al       Si         K        Ca        Ba
## 1 1.517077 14.29795 0.7613636 2.029091 72.83386 0.5877273  8.640455 0.7409091
## 2 1.518095 13.24296 3.5178289 1.288355 72.62428 0.4950658  8.620395 0.0112500
## 3 1.523800 12.62444 0.3488889 1.338889 72.42889 0.2922222 12.572778 0.1750000
##           Fe     Type
## 1 0.02045455 6.522727
## 2 0.06447368 1.651316
## 3 0.08333333 3.166667
glass_km$cluster
##   [1] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
##  [38] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
##  [75] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3
## [112] 3 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
## [149] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 3 3 3 1 3 3 1 1 3 1 3 1 1 1 1 1 1 1 1 1
## [186] 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

12.1 K-Optimum Determination

fviz_nbclust(x = glass_clean2,
             FUNcluster = kmeans, # fungsi clustering
             method = "wss") # within sum of square

Interpretation: In here we get the optimum K-optimum of 3 claster.

For the next step we will use the value in K-cluster.

set.seed(100)

# berdasarkan elbow method
glass_km_opt <- kmeans(x = glass_clean2,
                        centers = 3)

glass_km_opt$cluster
##   [1] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
##  [38] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
##  [75] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3
## [112] 3 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
## [149] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 3 3 3 1 3 3 1 1 3 1 3 1 1 1 1 1 1 1 1 1
## [186] 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
# Make new colomn contain claster
glass_clean$kelompok <- as.factor(glass_km_opt$cluster)

# Profiling for cluster
glass_centroid <- glass_clean %>% 
  group_by(kelompok) %>% 
  summarise_all(mean)

# Equivalent with whisky_km_opt$centers

glass_centroid
## # A tibble: 3 × 10
##   kelompok    RI    Na    Mg    Al    Si     K    Ca     Ba     Fe
##   <fct>    <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>  <dbl>  <dbl>
## 1 1         1.52  14.3 0.761  2.03  72.8 0.588  8.64 0.741  0.0205
## 2 2         1.52  13.2 3.52   1.29  72.6 0.495  8.62 0.0112 0.0645
## 3 3         1.52  12.6 0.349  1.34  72.4 0.292 12.6  0.175  0.0833

12.2 Clustering

# Profiling
# install.packages("ggiraphExtra")
library(ggiraphExtra)
## Warning: package 'ggiraphExtra' was built under R version 4.2.2
ggRadar(data=glass_clean, 
        aes(colour=kelompok), 
        interactive=TRUE)

Interpretation:

  • The cluster 1 contain glass material that contain the highest concentration of Na, Ba, Al and K.
  • The cluster 2 contain glass material that contain the highest concentration of Mg.
  • The cluster 3 contain glass material that contain the highest concentration of Ri, Ca, and Fe.
  • Special note, the Si component has the same contribution/concentration across the 3 cluster.

13 Conclusion

  • Using PCA Analysis we got the percentage on axis Dim 1 (27.90%) and Dim 2 (22.78%) shows how much the axis summarize the information. As a collective, it explained 50.68% of original data, with the description:
    • PC1 summarizes at most four variables which is Ca, Ri, Ba, and Al which has the most contributions among other variables.
    • PC2 summarizes at most one variables which is Mg which has the most contributions among other
  • Using the optimum K-optimum cluster then we may get 3 cluster, in which:
    • The cluster 1 contain glass material that contain the highest concentration of Na, Ba, Al and K.
    • The cluster 2 contain glass material that contain the highest concentration of Mg.
    • The cluster 3 contain glass material that contain the highest concentration of Ri, Ca, and Fe.
    • Special note, the Si component has the same contribution/concentration across the 3 cluster.
  • Business Insight: From the clustering we can select those material that has the value of importance greater than 0.5 from each cluster so that we can optimize and focus the production analysis in the future, such as
    • Cluster 1: Na (0.5) & Al (0.5)
    • Cluster 2: Mg (0.8)
    • Cluster 3: Ri (0.6) & Ca (0.7)
    • Special note: Si (0.5 in all 3 cluster)

Therefore by focusing into the six materials listed above then it will optimize the current workflow process of the glass business.

14 Acknowledgements

Data Source: https://archive.ics.uci.edu/ml/datasets/Glass+Identification

Creator: B. German Central Research Establishment Home Office Forensic Science Service Aldermaston, Reading, Berkshire RG7 4PN

Donor: Vina Spiehler, Ph.D., DABFT Diagnostic Products Corporation (213) 776-0180 (ext 3014)