legis=read.csv("123.csv" , stringsAsFactors = FALSE)
head(legis)
## id amend harmon extend lay_down establish expand com_prov
## 1 2005/0214(COD) 0 0 0 0 0 0 0
## 2 2006/0084(COD) 0 0 0 0 0 0 0
## 3 2006/0167(COD) 0 0 0 0 0 0 0
## 4 2007/0229(COD) 0 0 0 0 0 0 0
## 5 2007/0286(COD) 0 0 0 0 0 0 0
## 6 2008/0009(COD) 0 0 0 0 0 0 0
## member
## 1 NONE
## 2 NONE
## 3 NONE
## 4 NONE
## 5 NONE
## 6 NONE
names(legis)[names(legis) == "ï..procedure_ref1id"] <- "id"
legis_table <- table(legis$id, legis$member)
legis_table <- legis_table[,colSums(legis_table) > 1]
CA_legis=CA(legis_table)
CA_legis$col
## $coord
## Dim 1 Dim 2 Dim 3 Dim 4
## com_prov 0.7211548 7.731987e-01 1.769154e+01 2.960563e+00
## establish 0.7211548 -3.781780e-01 -2.641957e-01 1.735698e+00
## extend 0.7211548 -3.046382e-01 -2.707529e-01 -2.966657e+00
## lay_down 0.7211548 3.126331e-01 1.319246e+00 -1.014428e+00
## NONE -1.3866649 1.856115e-14 -1.747287e-15 2.397944e-15
## amend 0.7211548 -1.912247e-01 -1.141510e-01 -4.771735e-01
## harmon 0.7211548 6.518065e+00 -5.942797e-01 5.096445e-01
## Dim 5
## com_prov 5.269865e+00
## establish -1.471198e-01
## extend 5.381034e+00
## lay_down -2.771346e+00
## NONE 7.538484e-15
## amend 2.492578e-01
## harmon 4.410863e-01
##
## $contrib
## Dim 1 Dim 2 Dim 3 Dim 4 Dim 5
## com_prov 0.1098340 1.483507e-01 8.599776e+01 2.786374e+00 9.482421e+00
## establish 7.6883832 2.484265e+00 1.342472e+00 6.704050e+01 5.173218e-01
## extend 0.2745851 5.757264e-02 5.035494e-02 6.994640e+00 2.471677e+01
## lay_down 2.5261830 5.578341e-01 1.099855e+01 7.524220e+00 6.031558e+01
## NONE 65.7866948 1.384944e-26 1.358936e-28 2.961310e-28 3.143426e-27
## amend 22.6258134 1.869229e+00 7.375348e-01 1.491113e+01 4.370037e+00
## harmon 0.9885064 9.488275e+01 8.733334e-01 7.431353e-01 5.978742e-01
##
## $cos2
## Dim 1 Dim 2 Dim 3 Dim 4
## com_prov 0.001468589 1.688207e-03 8.838424e-01 2.475096e-02
## establish 0.129730886 3.567623e-02 1.741157e-02 7.515101e-01
## extend 0.004617047 8.239030e-04 6.508092e-04 7.813434e-02
## lay_down 0.041111641 7.726408e-03 1.375814e-01 8.134872e-02
## NONE 1.000000000 1.791706e-28 1.587762e-30 2.990440e-30
## amend 0.510069790 3.586415e-02 1.278004e-02 2.233188e-01
## harmon 0.011869040 9.696074e-01 8.060101e-03 5.927796e-03
## Dim 5
## com_prov 7.842281e-02
## establish 5.399194e-03
## extend 2.570626e-01
## lay_down 6.071406e-01
## NONE 2.955459e-29
## amend 6.093549e-02
## harmon 4.440232e-03
##
## $inertia
## [1] 0.7478881 0.5926409 0.5947202 0.6144690 0.6578669 0.4435827 0.8328445
#plot(CA_legis)
#par(pty="s")
#plot(CA_legis, asp=1:1, selectCol = 'contrib 5', fig.width = 25 )
summary(CA_legis)
##
## Call:
## CA(X = legis_table)
##
## The chi square of independence between the two variables is equal to 4246.36 (p-value = 1 ).
##
## Eigenvalues
## Dim.1 Dim.2 Dim.3 Dim.4 Dim.5 Dim.6
## Variance 1.000 0.851 0.769 0.664 0.619 0.581
## % of var. 22.301 18.980 17.142 14.816 13.794 12.966
## Cumulative % of var. 22.301 41.282 58.424 73.239 87.034 100.000
##
## Rows (the 10 first)
## Iner*1000 Dim.1 ctr cos2 Dim.2
## 2005/0214(COD) | 2.030 | -1.387 0.203 1.000 | 0.000
## 2006/0084(COD) | 2.030 | -1.387 0.203 1.000 | 0.000
## 2006/0167(COD) | 2.030 | -1.387 0.203 1.000 | 0.000
## 2007/0112(COD) | 99.102 | 0.721 0.110 0.011 | -0.269
## 2007/0152(COD) | 198.944 | 0.721 0.055 0.003 | -0.330
## 2007/0229(COD) | 2.030 | -1.387 0.203 1.000 | 0.000
## 2007/0286(COD) | 2.030 | -1.387 0.203 1.000 | 0.000
## 2008/0009(COD) | 2.030 | -1.387 0.203 1.000 | 0.000
## 2008/0028(COD) | 1.371 | 0.721 0.055 0.400 | -0.207
## 2008/0062(COD) | 2.030 | -1.387 0.203 1.000 | 0.000
## ctr cos2 Dim.3 ctr cos2
## 2005/0214(COD) 0.000 0.000 | 0.000 0.000 0.000 |
## 2006/0084(COD) 0.000 0.000 | 0.000 0.000 0.000 |
## 2006/0167(COD) 0.000 0.000 | 0.000 0.000 0.000 |
## 2007/0112(COD) 0.018 0.002 | -0.220 0.013 0.001 |
## 2007/0152(COD) 0.014 0.001 | -0.309 0.013 0.001 |
## 2007/0229(COD) 0.000 0.000 | 0.000 0.000 0.000 |
## 2007/0286(COD) 0.000 0.000 | 0.000 0.000 0.000 |
## 2008/0009(COD) 0.000 0.000 | 0.000 0.000 0.000 |
## 2008/0028(COD) 0.005 0.033 | -0.130 0.002 0.013 |
## 2008/0062(COD) 0.000 0.000 | 0.000 0.000 0.000 |
##
## Columns
## Iner*1000 Dim.1 ctr cos2 Dim.2
## com_prov | 747.888 | 0.721 0.110 0.001 | 0.773
## establish | 592.641 | 0.721 7.688 0.130 | -0.378
## extend | 594.720 | 0.721 0.275 0.005 | -0.305
## lay_down | 614.469 | 0.721 2.526 0.041 | 0.313
## NONE | 657.867 | -1.387 65.787 1.000 | 0.000
## amend | 443.583 | 0.721 22.626 0.510 | -0.191
## harmon | 832.844 | 0.721 0.989 0.012 | 6.518
## ctr cos2 Dim.3 ctr cos2
## com_prov 0.148 0.002 | 17.692 85.998 0.884 |
## establish 2.484 0.036 | -0.264 1.342 0.017 |
## extend 0.058 0.001 | -0.271 0.050 0.001 |
## lay_down 0.558 0.008 | 1.319 10.999 0.138 |
## NONE 0.000 0.000 | 0.000 0.000 0.000 |
## amend 1.869 0.036 | -0.114 0.738 0.013 |
## harmon 94.883 0.970 | -0.594 0.873 0.008 |
#Graphs below summarize the results. We essentialluy want to pick up the cases that are further away from the zero. THose procedures that are concetrated around Zero would be the ‘usual’ ones, whilst the further away the procedure is from the overlap of the dimensions the
plot(CA_legis, asp=1:1, selectCol = 'contrib 5', fig.width = 25 )
#chefcking 20 Procedures and 2 columns that contribute the most to the the 2 dimentions
plot(CA_legis, asp=0.5, selectRow = 'contrib 20' , selectCol = 'contrib 2' )
#chefcking 20 Procedures and 4 columns that contribute the most to the the 2 dimentions
plot(CA_legis, asp=0.5, selectRow = 'contrib 20' , selectCol = 'contrib 4' )