nba <- read.csv("C:/Users/Mariam/Downloads/ppg2008.csv", row.names=1)

colnames(nba)
##  [1] "G"    "MIN"  "PTS"  "FGM"  "FGA"  "FGP"  "FTM"  "FTA"  "FTP"  "X3PM"
## [11] "X3PA" "X3PP" "ORB"  "DRB"  "TRB"  "AST"  "STL"  "BLK"  "TO"   "PF"
str(nba)
## 'data.frame':    50 obs. of  20 variables:
##  $ G   : int  79 81 82 81 67 74 51 50 78 66 ...
##  $ MIN : num  38.6 37.7 36.2 37.7 36.2 39 38.2 36.6 38.5 34.5 ...
##  $ PTS : num  30.2 28.4 26.8 25.9 25.8 25.3 24.6 23.1 22.8 22.8 ...
##  $ FGM : num  10.8 9.7 9.8 9.6 8.5 8.9 6.7 9.7 8.1 8.1 ...
##  $ FGA : num  22 19.9 20.9 20 19.1 18.8 15.9 19.5 16.1 18.3 ...
##  $ FGP : num  0.491 0.489 0.467 0.479 0.447 0.476 0.42 0.497 0.503 0.443 ...
##  $ FTM : num  7.5 7.3 5.9 6 6 6.1 9 3.7 5.8 5.6 ...
##  $ FTA : num  9.8 9.4 6.9 6.7 6.9 7.1 10.3 5 6.7 7.1 ...
##  $ FTP : num  0.765 0.78 0.856 0.89 0.878 0.863 0.867 0.738 0.868 0.793 ...
##  $ X3PM: num  1.1 1.6 1.4 0.8 2.7 1.3 2.3 0 0.8 1 ...
##  $ X3PA: num  3.5 4.7 4.1 2.1 6.7 3.1 5.4 0.1 2.3 2.6 ...
##  $ X3PP: num  0.317 0.344 0.351 0.359 0.404 0.422 0.415 0 0.364 0.371 ...
##  $ ORB : num  1.1 1.3 1.1 1.1 0.7 1 0.6 3.4 0.9 1.6 ...
##  $ DRB : num  3.9 6.3 4.1 7.3 4.4 5.5 3 7.5 4.7 5.2 ...
##  $ TRB : num  5 7.6 5.2 8.4 5.1 6.5 3.6 11 5.5 6.8 ...
##  $ AST : num  7.5 7.2 4.9 2.4 2.7 2.8 2.7 1.6 11 3.4 ...
##  $ STL : num  2.2 1.7 1.5 0.8 1 1.3 1.2 0.8 2.8 1.1 ...
##  $ BLK : num  1.3 1.1 0.5 0.8 1.4 0.7 0.2 1.7 0.1 0.4 ...
##  $ TO  : num  3.4 3 2.6 1.9 2.5 3 2.9 1.8 3 3 ...
##  $ PF  : num  2.3 1.7 2.3 2.2 3.1 1.8 2.3 2.8 2.7 3 ...
library(factoextra)
## Loading required package: ggplot2
## Welcome! Want to learn more? See two factoextra-related books at https://goo.gl/ve3WBa
library(FactoMineR)

## ACP :
x= scale(nba[,2:20],center=TRUE, scale=TRUE)
res.acp = PCA(x, graph = FALSE)

# Ebouli des valeurs propres
fviz_eig(res.acp)

#L'ébloui des valeurs propres montre que les deux premiers axes expliquent une part importante de la variance (environ 40%). On peut donc choisir de retenir deux axes pour l'analyse.

## CAH :
dist = dist(x, method = "euclidean")
dist
##                    Dwyane Wade  LeBron James  Kobe Bryant  Dirk Nowitzki 
## LeBron James           3.038738                                          
## Kobe Bryant            4.196006      3.435945                            
## Dirk Nowitzki          6.487238      4.857181     3.633008               
## Danny Granger          6.370495      5.280483     3.686476       4.667908
## Kevin Durant           5.095430      3.571702     2.687207       3.097109
## Kevin Martin           6.975913      5.845129     5.232534       6.377575
## Al Jefferson           8.648137      7.591491     6.902098       5.297983
## Chris Paul             5.957688      5.765061     5.505492       7.339501
## Carmelo Anthony        6.281186      5.134330     3.524376       4.203614
## Chris Bosh             7.285436      5.657605     5.407999       3.679900
## Brandon Roy            6.650430      5.135738     3.603440       4.125961
## Antawn Jamison         7.760902      6.140175     4.847563       4.010636
## Tony Parker            7.299117      6.405595     4.764888       5.719796
## Amare Stoudemire       7.866682      6.675830     5.987171       4.937564
## Joe Johnson            7.170465      5.919992     4.087582       5.242862
## Devin Harris           6.483014      5.706886     4.956390       6.630182
## Michael Redd           8.450338      6.962033     5.075349       5.839658
## David West             8.252178      6.872318     5.543837       3.564428
## Zachary Randolph       8.410916      6.864707     5.669161       4.767121
## Caron Butler           6.618387      5.490489     4.150047       5.054886
## Vince Carter           7.661547      6.307864     4.355544       4.975130
## Stephen Jackson        6.721125      5.839475     4.993188       6.618140
## Ben Gordon             8.133711      6.785708     4.677693       5.523714
## Dwight Howard         10.979736      9.876768    10.865927       9.747346
## Paul Pierce            7.544939      6.016967     4.781068       5.046635
## Al Harrington          8.794301      7.415416     5.433733       5.929851
## Jamal Crawford         8.828590      7.283380     5.743874       6.550879
## Yao Ming              10.854293      9.576099     8.956371       7.728647
## Richard Jefferson      8.682139      7.367211     5.518071       5.573121
## Jason Terry            9.516265      8.277868     6.014669       7.017503
## Deron Williams         7.809343      6.829268     5.907901       7.337123
## Tim Duncan             9.621903      7.973412     7.853207       6.450053
## Monta Ellis            7.850876      7.195825     4.995308       5.744063
## Rudy Gay               8.139229      7.028034     5.282058       5.500016
## Pau Gasol              9.788407      8.086518     7.587709       6.083314
## Andre Iguodala         7.507926      6.116756     5.682097       6.247114
## Corey Maggette         9.875752      8.763444     7.378918       7.296411
## O.J. Mayo              8.850818      7.711137     5.613925       6.357115
## John Salmons           8.964826      7.555490     5.827407       6.066028
## Richard Hamilton       9.449459      8.291322     5.959103       6.313375
## Ray Allen             10.507949      8.962863     7.006284       7.244746
## LaMarcus Aldridge      9.414411      8.184945     6.717928       5.708298
## Josh Howard            9.521335      8.188238     6.218358       6.266027
## Maurice Williams      10.141015      8.823296     6.663869       7.227355
## Shaquille O'neal      11.409508     10.314955     9.899701       9.255677
## Rashard Lewis         10.107554      8.416203     6.842791       7.037489
## Chauncey Billups       9.713401      8.233808     6.849861       7.682397
## Allen Iverson          8.518349      7.442852     6.200897       7.066794
## Nate Robinson         10.243984      8.993653     6.953705       7.831983
##                    Danny Granger  Kevin Durant  Kevin Martin  Al Jefferson 
## LeBron James                                                               
## Kobe Bryant                                                                
## Dirk Nowitzki                                                              
## Danny Granger                                                              
## Kevin Durant             4.134284                                          
## Kevin Martin             4.700111      4.684157                            
## Al Jefferson             7.610742      6.780824      9.813783              
## Chris Paul               7.370751      5.873439      7.139564      9.306005
## Carmelo Anthony          4.110963      3.597143      5.079915      6.055263
## Chris Bosh               6.061848      4.334998      6.556863      4.294295
## Brandon Roy              5.024780      3.384039      5.122338      6.823281
## Antawn Jamison           5.190313      4.605747      6.739105      4.931679
## Tony Parker              6.739446      5.072257      7.229826      7.402855
## Amare Stoudemire         6.140258      4.888633      6.698171      5.782789
## Joe Johnson              4.486547      4.009753      5.415468      7.632936
## Devin Harris             5.770903      4.904968      3.869622      8.980788
## Michael Redd             5.301255      5.048336      5.741440      8.227146
## David West               5.925930      4.573911      7.075672      4.378026
## Zachary Randolph         6.362309      5.319333      7.828772      4.124784
## Caron Butler             4.988066      3.414373      4.934254      6.871820
## Vince Carter             3.713574      4.490488      5.287637      7.008243
## Stephen Jackson          5.148791      4.487989      4.998713      8.532363
## Ben Gordon               4.247452      4.447639      5.086710      8.023840
## Dwight Howard           10.655385     10.037447     11.422869      7.051783
## Paul Pierce              4.358101      3.883603      4.074442      7.468137
## Al Harrington            4.431946      5.547935      6.403556      7.123038
## Jamal Crawford           5.468156      5.243768      4.981463      9.222678
## Yao Ming                 8.395023      7.918837      9.685611      8.613076
## Richard Jefferson        4.738156      5.255324      5.009956      7.478263
## Jason Terry              5.804021      6.410540      7.062629      8.916840
## Deron Williams           6.727089      5.764784      6.226776      9.274241
## Tim Duncan               8.137870      7.238549      9.268617      3.994712
## Monta Ellis              6.036672      5.018770      6.968747      6.847531
## Rudy Gay                 5.119153      4.728137      6.298987      6.205098
## Pau Gasol                8.041410      6.483518      8.755409      5.870809
## Andre Iguodala           6.395016      4.698658      5.791503      7.468401
## Corey Maggette           6.779661      7.244765      6.409527      8.228899
## O.J. Mayo                5.262685      5.160231      6.034056      8.246671
## John Salmons             5.550997      5.204366      5.927132      7.850520
## Richard Hamilton         5.941979      6.101374      6.764977      7.827431
## Ray Allen                6.222141      6.655111      6.942915      9.335461
## LaMarcus Aldridge        7.098605      6.239775      8.294208      4.570091
## Josh Howard              5.934086      6.263091      7.151468      6.917512
## Maurice Williams         5.898262      6.586947      6.983558      9.044402
## Shaquille O'neal         9.873263      9.652147     10.816335      6.916982
## Rashard Lewis            5.506564      6.439094      6.801557      8.384440
## Chauncey Billups         6.341861      6.550091      5.376426     10.068164
## Allen Iverson            7.114703      5.671231      5.889105      8.649237
## Nate Robinson            6.534350      7.417273      7.297624      8.826272
##                    Chris Paul  Carmelo Anthony  Chris Bosh  Brandon Roy 
## LeBron James                                                            
## Kobe Bryant                                                             
## Dirk Nowitzki                                                           
## Danny Granger                                                           
## Kevin Durant                                                            
## Kevin Martin                                                            
## Al Jefferson                                                            
## Chris Paul                                                              
## Carmelo Anthony       6.088121                                          
## Chris Bosh            7.193766         3.979053                         
## Brandon Roy           5.832463         3.980239    4.701091             
## Antawn Jamison        7.151475         3.979804    3.942134     4.050715
## Tony Parker           6.430350         4.895137    6.331529     3.306811
## Amare Stoudemire      6.993505         4.046548    2.953131     5.139692
## Joe Johnson           5.927169         4.231778    6.066136     3.116776
## Devin Harris          4.645931         4.235076    6.117259     4.291156
## Michael Redd          7.492923         5.393877    6.797176     2.958531
## David West            7.479781         4.243350    2.617403     4.466839
## Zachary Randolph      7.692658         3.644677    3.662913     4.911962
## Caron Butler          4.676263         3.055642    4.384097     3.506471
## Vince Carter          6.308502         3.359540    5.431410     3.359336
## Stephen Jackson       5.263473         4.203719    6.322435     5.029691
## Ben Gordon            6.810692         4.258331    6.252842     3.156015
## Dwight Howard        11.380347         8.988335    6.825415    10.444791
## Paul Pierce           5.961535         2.998050    4.639101     3.527337
## Al Harrington         7.509385         4.036690    6.189752     4.897919
## Jamal Crawford        7.423852         5.629094    7.147138     3.791086
## Yao Ming              9.957625         7.072457    6.841588     8.226788
## Richard Jefferson     7.165705         3.579506    5.341508     3.931552
## Jason Terry           7.737351         6.116687    7.951594     4.478378
## Deron Williams        5.196479         5.449198    7.111780     4.526669
## Tim Duncan            9.212420         5.955403    4.216995     6.604044
## Monta Ellis           5.689988         3.849260    5.790674     4.176960
## Rudy Gay              6.737108         3.456129    4.973922     4.041251
## Pau Gasol             8.312484         6.096146    4.290098     5.440371
## Andre Iguodala        5.317771         4.659158    5.205740     3.658876
## Corey Maggette        8.096635         4.728106    5.949442     6.348057
## O.J. Mayo             6.774680         4.705741    6.657504     4.312500
## John Salmons          6.690242         4.755994    5.990211     3.490571
## Richard Hamilton      7.536388         4.683136    6.558403     4.003017
## Ray Allen             8.221395         6.624040    7.760298     4.958342
## LaMarcus Aldridge     7.938013         5.192228    4.292215     4.780729
## Josh Howard           7.865955         4.522507    6.057424     4.515656
## Maurice Williams      7.619631         5.747453    7.622695     5.059262
## Shaquille O'neal     10.483280         7.787638    7.114507     8.635837
## Rashard Lewis         8.130354         5.691321    7.081438     5.257890
## Chauncey Billups      6.954077         6.024026    7.585681     4.800849
## Allen Iverson         6.271802         5.207516    6.502494     3.910341
## Nate Robinson         7.796175         5.510454    7.643024     5.508054
##                    Antawn Jamison  Tony Parker  Amare Stoudemire  Joe Johnson 
## LeBron James                                                                  
## Kobe Bryant                                                                   
## Dirk Nowitzki                                                                 
## Danny Granger                                                                 
## Kevin Durant                                                                  
## Kevin Martin                                                                  
## Al Jefferson                                                                  
## Chris Paul                                                                    
## Carmelo Anthony                                                               
## Chris Bosh                                                                    
## Brandon Roy                                                                   
## Antawn Jamison                                                                
## Tony Parker               6.085793                                            
## Amare Stoudemire          5.002033     6.162750                               
## Joe Johnson               4.380603     4.542984          6.334251             
## Devin Harris              6.509918     5.218793          5.917447     4.705192
## Michael Redd              4.792350     4.701387          7.053561     3.175010
## David West                3.829875     5.796941          3.517470     5.161498
## Zachary Randolph          2.787398     5.736062          4.347125     5.439181
## Caron Butler              4.290267     4.982193          4.415288     3.191375
## Vince Carter              3.616543     4.955823          5.399698     2.222161
## Stephen Jackson           5.991323     6.016623          6.276992     3.324106
## Ben Gordon                4.781873     4.521274          5.920425     2.257403
## Dwight Howard             9.021922    11.187366          7.065004    11.456922
## Paul Pierce               4.374193     5.135062          4.192914     3.332208
## Al Harrington             3.658944     6.206585          6.066829     3.773872
## Jamal Crawford            5.933682     5.433121          7.350550     2.910756
## Yao Ming                  7.856969     8.863443          4.911936     9.024588
## Richard Jefferson         4.230100     5.438980          4.882392     3.879755
## Jason Terry               5.875096     5.304166          7.672038     4.101036
## Deron Williams            7.199319     4.213007          6.605278     4.134815
## Tim Duncan                5.778319     6.882923          5.095454     7.730296
## Monta Ellis               4.968080     3.983161          5.316659     3.912247
## Rudy Gay                  3.633821     5.021633          4.568123     3.425619
## Pau Gasol                 5.139982     6.371278          3.702838     6.933387
## Andre Iguodala            4.725983     4.944006          5.264158     3.727334
## Corey Maggette            6.490064     7.036976          4.937281     7.039598
## O.J. Mayo                 5.208324     5.221795          6.166791     2.576501
## John Salmons              4.556101     4.861652          5.407835     3.144011
## Richard Hamilton          5.371776     4.174618          6.001682     3.892213
## Ray Allen                 6.108861     6.325814          7.262103     4.463567
## LaMarcus Aldridge         3.820659     5.795617          4.490438     5.650981
## Josh Howard               4.552081     5.159809          5.650780     4.896821
## Maurice Williams          5.949410     5.785164          6.807324     4.026535
## Shaquille O'neal          7.889931     8.377264          6.296785     9.788041
## Rashard Lewis             4.983933     6.771345          6.839126     4.057803
## Chauncey Billups          6.849785     6.163077          7.206056     4.543655
## Allen Iverson             6.208160     4.428674          6.489622     4.322815
## Nate Robinson             6.133385     6.006263          7.086145     5.373473
##                    Devin Harris  Michael Redd  David West  Zachary Randolph 
## LeBron James                                                                
## Kobe Bryant                                                                 
## Dirk Nowitzki                                                               
## Danny Granger                                                               
## Kevin Durant                                                                
## Kevin Martin                                                                
## Al Jefferson                                                                
## Chris Paul                                                                  
## Carmelo Anthony                                                             
## Chris Bosh                                                                  
## Brandon Roy                                                                 
## Antawn Jamison                                                              
## Tony Parker                                                                 
## Amare Stoudemire                                                            
## Joe Johnson                                                                 
## Devin Harris                                                                
## Michael Redd            5.571564                                            
## David West              6.464474      6.126314                              
## Zachary Randolph        6.910898      6.036715    3.677750                  
## Caron Butler            3.502129      4.818735    4.168467          4.582131
## Vince Carter            4.625306      3.416149    4.607972          4.634203
## Stephen Jackson         3.785599      5.717355    6.099344          6.324679
## Ben Gordon              4.741626      2.371047    5.305063          5.577621
## Dwight Howard          10.618974     12.015420    8.491563          8.047155
## Paul Pierce             3.449312      4.354454    4.390646          4.875962
## Al Harrington           6.053651      4.061366    5.499479          4.402752
## Jamal Crawford          4.886794      2.575559    6.356022          6.919603
## Yao Ming                9.284421      9.547446    6.889768          6.824529
## Richard Jefferson       4.508954      4.044263    4.662670          4.882986
## Jason Terry             6.310758      2.516577    6.938943          6.728992
## Deron Williams          3.625825      5.581915    6.645413          7.169299
## Tim Duncan              7.916497      7.979773    4.840887          4.381594
## Monta Ellis             4.799683      4.866542    4.701055          4.735501
## Rudy Gay                5.159532      4.258638    4.086622          3.734967
## Pau Gasol               7.749382      7.020857    4.358713          4.293495
## Andre Iguodala          3.932519      4.609502    5.242376          5.231274
## Corey Maggette          5.280638      7.060553    6.044871          6.076593
## O.J. Mayo               5.160584      3.673404    5.361981          5.696057
## John Salmons            4.934219      3.050453    4.986356          5.260712
## Richard Hamilton        5.415018      3.782312    5.234343          5.376223
## Ray Allen               6.687889      3.435731    6.555283          6.988855
## LaMarcus Aldridge       7.019723      5.721190    3.299351          3.390720
## Josh Howard             5.907087      4.057446    5.297197          4.481466
## Maurice Williams        6.141258      3.997170    6.336138          6.399576
## Shaquille O'neal        9.221589      9.572978    7.697646          6.614206
## Rashard Lewis           6.502499      3.867565    6.174516          5.809689
## Chauncey Billups        4.359878      4.298286    7.001462          7.514860
## Allen Iverson           3.570443      4.338444    6.086351          6.374252
## Nate Robinson           5.831858      4.654699    6.982984          6.149645
##                    Caron Butler  Vince Carter  Stephen Jackson  Ben Gordon 
## LeBron James                                                               
## Kobe Bryant                                                                
## Dirk Nowitzki                                                              
## Danny Granger                                                              
## Kevin Durant                                                               
## Kevin Martin                                                               
## Al Jefferson                                                               
## Chris Paul                                                                 
## Carmelo Anthony                                                            
## Chris Bosh                                                                 
## Brandon Roy                                                                
## Antawn Jamison                                                             
## Tony Parker                                                                
## Amare Stoudemire                                                           
## Joe Johnson                                                                
## Devin Harris                                                               
## Michael Redd                                                               
## David West                                                                 
## Zachary Randolph                                                           
## Caron Butler                                                               
## Vince Carter            3.333304                                           
## Stephen Jackson         2.688739      4.010468                             
## Ben Gordon              3.646091      2.118844         4.254073            
## Dwight Howard           9.635564     10.476935        10.779910   11.453251
## Paul Pierce             2.534340      2.539151         3.495989    2.861915
## Al Harrington           4.281718      2.411540         5.062077    3.187576
## Jamal Crawford          4.483382      3.568929         4.559441    2.345594
## Yao Ming                7.871320      7.926527         9.040733    8.282246
## Richard Jefferson       3.890765      2.244527         4.983246    2.904541
## Jason Terry             5.520091      3.811141         6.311472    2.788581
## Deron Williams          4.205144      4.735855         3.889096    4.390994
## Tim Duncan              6.658149      6.833548         8.143258    7.652485
## Monta Ellis             3.254212      3.649510         4.675847    3.885141
## Rudy Gay                3.005675      2.623579         4.259239    3.165584
## Pau Gasol               5.938561      6.266959         7.843405    6.604258
## Andre Iguodala          2.951631      4.015477         3.888517    4.236619
## Corey Maggette          5.609918      5.398098         6.897688    5.971786
## O.J. Mayo               3.398845      2.706580         3.823734    1.905825
## John Salmons            3.630394      2.599914         4.772478    2.064099
## Richard Hamilton        4.664288      3.032659         5.666976    2.745166
## Ray Allen               5.515387      4.131816         6.381019    2.912286
## LaMarcus Aldridge       4.893526      4.801150         6.922177    5.460184
## Josh Howard             4.907711      3.439462         6.315962    3.722849
## Maurice Williams        4.996702      3.344085         5.601050    2.564661
## Shaquille O'neal        8.601201      8.528485        10.069507    9.153405
## Rashard Lewis           4.986343      3.136706         5.466748    3.081748
## Chauncey Billups        4.862857      4.157058         5.147777    3.513637
## Allen Iverson           3.915807      4.580730         4.718109    4.166472
## Nate Robinson           5.482750      4.090332         6.372200    4.084913
##                    Dwight Howard  Paul Pierce  Al Harrington  Jamal Crawford 
## LeBron James                                                                 
## Kobe Bryant                                                                  
## Dirk Nowitzki                                                                
## Danny Granger                                                                
## Kevin Durant                                                                 
## Kevin Martin                                                                 
## Al Jefferson                                                                 
## Chris Paul                                                                   
## Carmelo Anthony                                                              
## Chris Bosh                                                                   
## Brandon Roy                                                                  
## Antawn Jamison                                                               
## Tony Parker                                                                  
## Amare Stoudemire                                                             
## Joe Johnson                                                                  
## Devin Harris                                                                 
## Michael Redd                                                                 
## David West                                                                   
## Zachary Randolph                                                             
## Caron Butler                                                                 
## Vince Carter                                                                 
## Stephen Jackson                                                              
## Ben Gordon                                                                   
## Dwight Howard                                                                
## Paul Pierce              9.636971                                            
## Al Harrington           10.503613     3.735663                               
## Jamal Crawford          12.420262     3.854421       4.717449                
## Yao Ming                 9.188604     7.276089       8.190311        9.764916
## Richard Jefferson       10.169753     2.214834       3.162181        4.125523
## Jason Terry             12.741956     5.160540       3.938646        3.633596
## Deron Williams          11.534596     4.279882       6.398996        4.541918
## Tim Duncan               5.624657     6.542408       7.105343        8.513037
## Monta Ellis             10.627539     3.978768       4.274565        5.211137
## Rudy Gay                 9.402274     2.981089       2.773478        4.612469
## Pau Gasol                7.712590     5.796744       6.782162        7.699429
## Andre Iguodala           9.422276     3.231138       5.030216        4.456195
## Corey Maggette           9.157022     4.369871       5.634072        7.058690
## O.J. Mayo               11.644764     3.229506       3.276673        3.082384
## John Salmons            10.800652     2.814290       3.405793        3.179845
## Richard Hamilton        11.493029     3.910080       3.960584        4.024837
## Ray Allen               12.591073     4.788130       4.370499        3.484803
## LaMarcus Aldridge        8.439162     5.229192       5.076459        6.582806
## Josh Howard             10.171663     4.230874       3.145708        5.022726
## Maurice Williams        12.264891     4.209911       3.577489        3.878532
## Shaquille O'neal         6.010717     8.107302       8.321307       10.480374
## Rashard Lewis           11.229135     4.114025       2.609541        3.813909
## Chauncey Billups        12.298019     3.939010       5.261580        2.947317
## Allen Iverson           11.193887     4.027349       5.698454        3.799475
## Nate Robinson           11.616694     4.900970       3.776503        5.042350
##                    Yao Ming  Richard Jefferson  Jason Terry  Deron Williams 
## LeBron James                                                                
## Kobe Bryant                                                                 
## Dirk Nowitzki                                                               
## Danny Granger                                                               
## Kevin Durant                                                                
## Kevin Martin                                                                
## Al Jefferson                                                                
## Chris Paul                                                                  
## Carmelo Anthony                                                             
## Chris Bosh                                                                  
## Brandon Roy                                                                 
## Antawn Jamison                                                              
## Tony Parker                                                                 
## Amare Stoudemire                                                            
## Joe Johnson                                                                 
## Devin Harris                                                                
## Michael Redd                                                                
## David West                                                                  
## Zachary Randolph                                                            
## Caron Butler                                                                
## Vince Carter                                                                
## Stephen Jackson                                                             
## Ben Gordon                                                                  
## Dwight Howard                                                               
## Paul Pierce                                                                 
## Al Harrington                                                               
## Jamal Crawford                                                              
## Yao Ming                                                                    
## Richard Jefferson   7.567783                                                
## Jason Terry         9.621062           4.554125                             
## Deron Williams      9.198856           5.338765     5.789004                
## Tim Duncan          7.841225           6.696657     8.619862        8.034451
## Monta Ellis         8.091141           4.010071     4.747091        4.752525
## Rudy Gay            7.292816           2.873520     4.632153        5.315777
## Pau Gasol           5.364269           6.040600     7.671890        7.349657
## Andre Iguodala      8.554681           4.278623     5.717292        4.168254
## Corey Maggette      7.674224           3.748130     7.079983        6.797717
## O.J. Mayo           8.441072           3.404207     3.516109        4.455875
## John Salmons        7.836571           2.603243     3.292522        4.564991
## Richard Hamilton    8.102962           2.855432     3.397445        4.689122
## Ray Allen           9.039771           4.416789     2.571770        5.897355
## LaMarcus Aldridge   7.237969           4.700304     6.110081        6.999267
## Josh Howard         7.688036           3.024472     3.667175        6.156373
## Maurice Williams    8.436166           3.712192     2.740768        5.136232
## Shaquille O'neal    8.563895           7.817614     9.682945        9.500610
## Rashard Lewis       8.526844           3.721468     3.456714        6.113149
## Chauncey Billups    9.332124           4.027074     4.152639        4.216544
## Allen Iverson       9.455524           4.328337     5.126102        3.901804
## Nate Robinson       8.915788           3.904380     3.385578        5.838850
##                    Tim Duncan  Monta Ellis  Rudy Gay  Pau Gasol 
## LeBron James                                                    
## Kobe Bryant                                                     
## Dirk Nowitzki                                                   
## Danny Granger                                                   
## Kevin Durant                                                    
## Kevin Martin                                                    
## Al Jefferson                                                    
## Chris Paul                                                      
## Carmelo Anthony                                                 
## Chris Bosh                                                      
## Brandon Roy                                                     
## Antawn Jamison                                                  
## Tony Parker                                                     
## Amare Stoudemire                                                
## Joe Johnson                                                     
## Devin Harris                                                    
## Michael Redd                                                    
## David West                                                      
## Zachary Randolph                                                
## Caron Butler                                                    
## Vince Carter                                                    
## Stephen Jackson                                                 
## Ben Gordon                                                      
## Dwight Howard                                                   
## Paul Pierce                                                     
## Al Harrington                                                   
## Jamal Crawford                                                  
## Yao Ming                                                        
## Richard Jefferson                                               
## Jason Terry                                                     
## Deron Williams                                                  
## Tim Duncan                                                      
## Monta Ellis           6.758544                                  
## Rudy Gay              5.926663     2.696703                     
## Pau Gasol             4.703674     6.330845  5.379390           
## Andre Iguodala        6.371504     4.145292  3.404370   5.615196
## Corey Maggette        6.573105     5.644905  5.268130   6.870169
## O.J. Mayo             7.920999     3.335414  2.755239   6.870937
## John Salmons          7.051182     3.552253  2.583390   5.590709
## Richard Hamilton      7.101248     3.405859  3.465681   6.273202
## Ray Allen             8.716208     5.521233  4.846322   7.101171
## LaMarcus Aldridge     4.484150     4.401378  3.509486   3.703907
## Josh Howard           6.031456     3.634804  2.997187   5.797090
## Maurice Williams      8.382848     4.482965  4.050975   7.044563
## Shaquille O'neal      4.623724     8.178991  7.393833   6.216043
## Rashard Lewis         7.655079     5.234368  3.661465   6.820246
## Chauncey Billups      8.688567     5.434033  5.215180   7.718548
## Allen Iverson         7.368531     3.788513  4.196850   6.949150
## Nate Robinson         7.739997     4.638596  4.513926   7.403689
##                    Andre Iguodala  Corey Maggette  O.J. Mayo  John Salmons 
## LeBron James                                                               
## Kobe Bryant                                                                
## Dirk Nowitzki                                                              
## Danny Granger                                                              
## Kevin Durant                                                               
## Kevin Martin                                                               
## Al Jefferson                                                               
## Chris Paul                                                                 
## Carmelo Anthony                                                            
## Chris Bosh                                                                 
## Brandon Roy                                                                
## Antawn Jamison                                                             
## Tony Parker                                                                
## Amare Stoudemire                                                           
## Joe Johnson                                                                
## Devin Harris                                                               
## Michael Redd                                                               
## David West                                                                 
## Zachary Randolph                                                           
## Caron Butler                                                               
## Vince Carter                                                               
## Stephen Jackson                                                            
## Ben Gordon                                                                 
## Dwight Howard                                                              
## Paul Pierce                                                                
## Al Harrington                                                              
## Jamal Crawford                                                             
## Yao Ming                                                                   
## Richard Jefferson                                                          
## Jason Terry                                                                
## Deron Williams                                                             
## Tim Duncan                                                                 
## Monta Ellis                                                                
## Rudy Gay                                                                   
## Pau Gasol                                                                  
## Andre Iguodala                                                             
## Corey Maggette            6.245282                                         
## O.J. Mayo                 4.176268        6.217303                         
## John Salmons              3.340201        5.489450   2.130395              
## Richard Hamilton          5.043044        5.147133   3.029600      2.686836
## Ray Allen                 5.729966        6.926262   3.250277      2.822235
## LaMarcus Aldridge         4.961907        6.045665   5.383402      4.442691
## Josh Howard               4.984433        4.623224   4.034443      3.119540
## Maurice Williams          5.465258        6.105725   2.382785      2.508665
## Shaquille O'neal          8.019151        6.529069   9.412213      8.260644
## Rashard Lewis             4.998688        6.377110   3.027258      2.767346
## Chauncey Billups          4.844880        5.837469   3.856331      3.391537
## Allen Iverson             3.081390        5.994235   4.137014      3.610668
## Nate Robinson             5.845021        4.915234   4.264552      3.862991
##                    Richard Hamilton  Ray Allen  LaMarcus Aldridge  Josh Howard 
## LeBron James                                                                   
## Kobe Bryant                                                                    
## Dirk Nowitzki                                                                  
## Danny Granger                                                                  
## Kevin Durant                                                                   
## Kevin Martin                                                                   
## Al Jefferson                                                                   
## Chris Paul                                                                     
## Carmelo Anthony                                                                
## Chris Bosh                                                                     
## Brandon Roy                                                                    
## Antawn Jamison                                                                 
## Tony Parker                                                                    
## Amare Stoudemire                                                               
## Joe Johnson                                                                    
## Devin Harris                                                                   
## Michael Redd                                                                   
## David West                                                                     
## Zachary Randolph                                                               
## Caron Butler                                                                   
## Vince Carter                                                                   
## Stephen Jackson                                                                
## Ben Gordon                                                                     
## Dwight Howard                                                                  
## Paul Pierce                                                                    
## Al Harrington                                                                  
## Jamal Crawford                                                                 
## Yao Ming                                                                       
## Richard Jefferson                                                              
## Jason Terry                                                                    
## Deron Williams                                                                 
## Tim Duncan                                                                     
## Monta Ellis                                                                    
## Rudy Gay                                                                       
## Pau Gasol                                                                      
## Andre Iguodala                                                                 
## Corey Maggette                                                                 
## O.J. Mayo                                                                      
## John Salmons                                                                   
## Richard Hamilton                                                               
## Ray Allen                   3.746654                                           
## LaMarcus Aldridge           4.698800   6.106457                                
## Josh Howard                 2.735058   4.416235           3.877072             
## Maurice Williams            2.711036   2.054787           5.876846     3.756723
## Shaquille O'neal            8.258278   9.828283           6.343887     6.949495
## Rashard Lewis               4.026395   2.817863           5.529917     3.673281
## Chauncey Billups            4.036687   3.622482           6.869038     4.872425
## Allen Iverson               4.133545   5.539133           5.638618     4.602298
## Nate Robinson               3.173877   4.144739           5.782720     2.657768
##                    Maurice Williams  Shaquille O'neal  Rashard Lewis 
## LeBron James                                                         
## Kobe Bryant                                                          
## Dirk Nowitzki                                                        
## Danny Granger                                                        
## Kevin Durant                                                         
## Kevin Martin                                                         
## Al Jefferson                                                         
## Chris Paul                                                           
## Carmelo Anthony                                                      
## Chris Bosh                                                           
## Brandon Roy                                                          
## Antawn Jamison                                                       
## Tony Parker                                                          
## Amare Stoudemire                                                     
## Joe Johnson                                                          
## Devin Harris                                                         
## Michael Redd                                                         
## David West                                                           
## Zachary Randolph                                                     
## Caron Butler                                                         
## Vince Carter                                                         
## Stephen Jackson                                                      
## Ben Gordon                                                           
## Dwight Howard                                                        
## Paul Pierce                                                          
## Al Harrington                                                        
## Jamal Crawford                                                       
## Yao Ming                                                             
## Richard Jefferson                                                    
## Jason Terry                                                          
## Deron Williams                                                       
## Tim Duncan                                                           
## Monta Ellis                                                          
## Rudy Gay                                                             
## Pau Gasol                                                            
## Andre Iguodala                                                       
## Corey Maggette                                                       
## O.J. Mayo                                                            
## John Salmons                                                         
## Richard Hamilton                                                     
## Ray Allen                                                            
## LaMarcus Aldridge                                                    
## Josh Howard                                                          
## Maurice Williams                                                     
## Shaquille O'neal            9.266111                                 
## Rashard Lewis               2.637360          8.981260               
## Chauncey Billups            3.562133         10.006716       4.070709
## Allen Iverson               5.232525          8.980469       5.518978
## Nate Robinson               3.210075          8.212665       3.778351
##                    Chauncey Billups  Allen Iverson 
## LeBron James                                       
## Kobe Bryant                                        
## Dirk Nowitzki                                      
## Danny Granger                                      
## Kevin Durant                                       
## Kevin Martin                                       
## Al Jefferson                                       
## Chris Paul                                         
## Carmelo Anthony                                    
## Chris Bosh                                         
## Brandon Roy                                        
## Antawn Jamison                                     
## Tony Parker                                        
## Amare Stoudemire                                   
## Joe Johnson                                        
## Devin Harris                                       
## Michael Redd                                       
## David West                                         
## Zachary Randolph                                   
## Caron Butler                                       
## Vince Carter                                       
## Stephen Jackson                                    
## Ben Gordon                                         
## Dwight Howard                                      
## Paul Pierce                                        
## Al Harrington                                      
## Jamal Crawford                                     
## Yao Ming                                           
## Richard Jefferson                                  
## Jason Terry                                        
## Deron Williams                                     
## Tim Duncan                                         
## Monta Ellis                                        
## Rudy Gay                                           
## Pau Gasol                                          
## Andre Iguodala                                     
## Corey Maggette                                     
## O.J. Mayo                                          
## John Salmons                                       
## Richard Hamilton                                   
## Ray Allen                                          
## LaMarcus Aldridge                                  
## Josh Howard                                        
## Maurice Williams                                   
## Shaquille O'neal                                   
## Rashard Lewis                                      
## Chauncey Billups                                   
## Allen Iverson               3.852069               
## Nate Robinson               3.959627       5.032923
hc = hclust(dist, method = "ward.D")
hc
## 
## Call:
## hclust(d = dist, method = "ward.D")
## 
## Cluster method   : ward.D 
## Distance         : euclidean 
## Number of objects: 50
plot=plot(hc, hang=-1)

#Le dendrogramme montre une séparation entre 4 groupes de joueurs.

coupe = cutree(hc, k = 4)
coupe
##       Dwyane Wade       LeBron James        Kobe Bryant      Dirk Nowitzki  
##                  1                  1                  1                  1 
##     Danny Granger       Kevin Durant       Kevin Martin       Al Jefferson  
##                  1                  1                  1                  2 
##        Chris Paul    Carmelo Anthony         Chris Bosh        Brandon Roy  
##                  3                  4                  2                  3 
##    Antawn Jamison        Tony Parker   Amare Stoudemire        Joe Johnson  
##                  2                  3                  2                  4 
##      Devin Harris       Michael Redd         David West   Zachary Randolph  
##                  3                  4                  2                  2 
##      Caron Butler       Vince Carter    Stephen Jackson         Ben Gordon  
##                  3                  4                  3                  4 
##     Dwight Howard        Paul Pierce      Al Harrington     Jamal Crawford  
##                  2                  4                  4                  4 
##          Yao Ming  Richard Jefferson        Jason Terry     Deron Williams  
##                  2                  4                  4                  3 
##        Tim Duncan        Monta Ellis           Rudy Gay          Pau Gasol  
##                  2                  4                  4                  2 
##    Andre Iguodala     Corey Maggette          O.J. Mayo       John Salmons  
##                  3                  4                  4                  4 
##  Richard Hamilton          Ray Allen  LaMarcus Aldridge        Josh Howard  
##                  4                  4                  2                  4 
##  Maurice Williams   Shaquille O'neal      Rashard Lewis   Chauncey Billups  
##                  4                  2                  4                  4 
##     Allen Iverson      Nate Robinson  
##                  3                  4
# ACP avec variable qualitative

nba$class = as.factor(coupe)

#ACP en considérant les classes comme qualitative supplémentaire
acp2 = PCA(x, quali.sup = ncol(x), graph = FALSE)

## Représentation les individus par groupes
# En utilisant l'habillage
fviz_pca_ind(acp2, habillage = nba$class)

# En utilisant la méthode HCPC
res = HCPC(acp2, nb.clust = 4)

# On ajoute l'ellipse de confiance

fviz_pca_ind(acp2, habillage = nba$class, palette = "jco", geom = "point",
             addEllipses = TRUE, ellipse.type = "confidence", 
             legend.title = "Classes")

L’analyse montre que les deux premiers axes de l’ACP permettent de distinguer 4 groupes de joueurs :

Groupe 1: joueurs avec des scores élevés sur les variables PTS, FGM, FGP, 3PM et 3P%. Ce groupe correspond aux joueurs les plus prolifiques. Groupe 2: joueurs avec des scores élevés sur les variables AST, STL et TO. Ce groupe correspond aux meneurs de jeu et aux joueurs créatifs. Groupe 3: joueurs avec des scores élevés sur les variables TRB, DRB et ORB. Ce groupe correspond aux rebondeurs. Groupe 4: joueurs avec des scores élevés sur les variables PF et BLK. Ce groupe correspond aux joueurs intérieurs et aux défenseurs. L’analyse CAH confirme cette segmentation en quatre groupes.