3. Speeches trajectory
Previous syntax
load("C:/RData/SpanishDisc.RData")
library(Xplortext)
Or
load(url("http://www.xplortext.org/Rdata/SpanishDisc.RData"))
swu <- c("consiguiente", "ello", "hacia", "punto", "Señorías", "si", "Sus", "vista", "A", "B", "C", "D", "E", "F", "a", "b", "c", "d")
To build a new TextDataObject with a minimum of 10 frequency of words and at least in 2 documents.
TD <- TextData(SpanishDisc, var.text=c(1), context.quanti="year", Fmin=10, Dmin=2, idiom="es", lower=FALSE, remov.number=TRUE, stop.word.tm=TRUE, stop.word.user=swu, graph=FALSE)
CA from speeches x words table
To obtain a Correspondence Analysis from speeches x words table using default parameters:
resCA <- LexCA(TD, graph=TRUE)
The summary of the Correspondence Analysis results for 11 documents, the first 10 words and 5 dimensions:
summary(resCA, ndoc=11)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 |
Correspondence analysis summary Eigenvalues Variance % of var. Cumulative % of var. dim 1 0.128 18.276 18.276 dim 2 0.098 13.989 32.265 dim 3 0.076 10.798 43.063 dim 4 0.069 9.761 52.824 dim 5 0.064 9.142 61.967 Cramer's V 0.265 Inertia 0.702 DOCUMENTS Coordinates Dim 1 Dim 2 Dim 3 Dim 4 Dim 5 Su79 -0.067 0.567 0.017 -0.005 -0.224 CS81 0.101 0.332 0.006 -0.096 0.263 Gz82 0.072 0.420 0.365 0.229 0.021 Gz86 0.734 -0.196 -0.031 -0.368 -0.271 Gz89 0.601 -0.218 -0.095 0.573 0.307 Gz93 -0.040 -0.094 -0.193 0.083 0.283 Az96 -0.302 0.045 -0.401 -0.167 0.119 Az00 -0.322 -0.254 -0.232 -0.083 0.055 Zp04 -0.269 -0.112 -0.232 0.152 -0.350 Zp08 -0.330 -0.427 0.301 0.299 -0.374 Rj11 -0.242 -0.249 0.542 -0.332 0.297 Contributions (by column total=100) Only the first 10 elements are shown Dim 1 Dim 2 Dim 3 Dim 4 Dim 5 Su79 0.418 39.145 0.045 0.004 9.332 CS81 0.643 9.031 0.004 1.084 8.704 Gz82 0.335 15.072 14.782 6.431 0.059 Gz86 47.115 4.377 0.143 22.132 12.810 Gz89 21.220 3.656 0.898 36.102 11.070 Gz93 0.100 0.734 4.030 0.833 10.238 Az96 7.720 0.228 23.097 4.444 2.399 Az00 6.999 5.689 6.150 0.870 0.402 Zp04 4.278 0.971 5.368 2.567 14.470 Zp08 6.973 15.269 9.853 10.754 17.884 Rj11 4.199 5.828 35.631 14.779 12.632 Square cosinus (by row total=1) Only the first 10 elements are shown Dim 1 Dim 2 Dim 3 Dim 4 Dim 5 Su79 0.008 0.565 0.000 0.000 0.088 CS81 0.015 0.159 0.000 0.013 0.100 Gz82 0.007 0.242 0.183 0.072 0.001 Gz86 0.676 0.048 0.001 0.170 0.092 Gz89 0.367 0.048 0.009 0.333 0.096 Gz93 0.003 0.014 0.061 0.011 0.130 Az96 0.180 0.004 0.319 0.055 0.028 Az00 0.158 0.099 0.082 0.011 0.005 Zp04 0.094 0.016 0.070 0.030 0.159 Zp08 0.133 0.223 0.111 0.110 0.171 Rj11 0.082 0.087 0.410 0.154 0.123 Inertia Su79 0.068 CS81 0.056 Gz82 0.061 Gz86 0.090 Gz89 0.074 Gz93 0.050 Az96 0.055 Az00 0.057 Zp04 0.058 Zp08 0.067 Rj11 0.066 WORDS Coordinates Only the first 10 elements are shown Dim 1 Dim 2 Dim 3 Dim 4 Dim 5 abierto -0.647 -0.346 -0.573 -0.180 0.261 abordar -0.490 -0.266 0.468 -0.081 0.148 abordaremos -0.421 -0.689 0.369 -0.652 0.400 acabo -0.181 -0.419 -0.093 -0.224 0.516 acceso 0.007 0.115 0.016 0.015 -0.319 acción -0.081 0.336 -0.163 0.064 0.041 acciones -0.030 0.369 -0.013 -0.275 -0.109 acontecimientos 0.312 -0.195 -0.367 0.941 0.214 Acta 1.751 -0.636 -0.251 0.274 0.065 actitud 0.295 0.541 0.272 0.052 -0.256 Contributions (by-column total=100) Only the first 10 elements are shown Dim 1 Dim 2 Dim 3 Dim 4 Dim 5 abierto 0.192 0.072 0.256 0.028 0.062 abordar 0.157 0.060 0.242 0.008 0.029 abordaremos 0.043 0.150 0.056 0.193 0.077 acabo 0.011 0.078 0.005 0.032 0.180 acceso 0.000 0.013 0.000 0.000 0.152 acción 0.017 0.392 0.120 0.021 0.009 acciones 0.000 0.065 0.000 0.051 0.009 acontecimientos 0.026 0.013 0.061 0.441 0.024 Acta 1.188 0.204 0.041 0.054 0.003 actitud 0.025 0.111 0.036 0.001 0.038 Square cosinus (by-row total=1) Only the first 10 elements are shown Dim 1 Dim 2 Dim 3 Dim 4 Dim 5 abierto 0.242 0.069 0.190 0.019 0.039 abordar 0.308 0.091 0.281 0.008 0.028 abordaremos 0.084 0.224 0.064 0.201 0.076 acabo 0.027 0.142 0.007 0.041 0.215 acceso 0.000 0.035 0.001 0.001 0.268 acción 0.021 0.369 0.087 0.014 0.005 acciones 0.002 0.256 0.000 0.142 0.022 acontecimientos 0.059 0.023 0.082 0.541 0.028 Acta 0.805 0.106 0.017 0.020 0.001 actitud 0.104 0.350 0.088 0.003 0.078 Inertia abierto 0.001 abordar 0.001 abordaremos 0.001 acabo 0.001 acceso 0.000 acción 0.001 acciones 0.000 acontecimientos 0.001 Acta 0.002 actitud 0.000 SUPPLEMENTARY QUANTITATIVE VARIABLES Coordinates Equal to the correlations of the variable with the axes Dim.1 Dim.2 Dim.3 Dim.4 Dim.5 year -0.557 -0.778 0.164 -0.055 0.011 Square cosinus Dim.1 Dim.2 Dim.3 Dim.4 Dim.5 year 0.31 0.605 0.027 0.003 |
ellipseLexCA funtion draws confidence ellipses around all the documents (speeches) for axes 1-2:
ellipseLexCA(resCA, selWord=NULL, selDoc="ALL", col.doc="black",cex=1, title="Confidence ellipses around speeches. Plan(1,2)")
lines(resCA$row$coord[1:11,1],resCA$row$coord[1:11,2],lwd=2,col="blue")
And for axes 1-3:
ellipseLexCA(resCA, selWord=NULL, selDoc="ALL", axes=c(1,3), col.doc="black",cex=1, title="Confidence ellipses around speeches. Plan(1,3)") lines(resCA$row$coord[1:11,1],resCA$row$coord[1:11,3],lwd=2,col="blue")
Three-dimensional representation of documents:
library(scatterplot3d)
coord <- resCA$row$coord
s <- c(1:(nrow(coord)-1))
gr3D <- scatterplot3d(coord[,1],coord[,2],coord[,3], color="red", type="h", main="Investiture speeches from the Spanish democracy",
xlab="dim1", ylab="dim2", zlab="dim3", pch=20, cex.axis=.6, angle=65)
gr3D.coords <- gr3D$xyz.convert(coord[,1],coord[,2],coord[,3])
text(gr3D.coords$x, gr3D.coords$y,labels=rownames(coord), cex=.9, pos=2)
segments(gr3D.coords$x[s], gr3D.coords$y[s], gr3D.coords$x[s+1], gr3D.coords$y[s+1],col= 'blue', lwd= 2)
Representation of words
Using plot.LexCA function, the words with a contribution over 6 times the average word contribution on any of the two axes are plotted (meta 6) for axes 1-2 and 1-3:
plot(resCA, selDoc=NULL, selWord="meta 6", cex=0.8, axes=c(1,2), title="Representation of metakeys. Plan (1,2)")
plot(resCA, selDoc=NULL, selWord="meta 6", cex=0.8, axes=c(1,3), title="Representation of metakeys. Plan (1,3)")
It is possible to do a joint representation
plot(resCA, selDoc="ALL", selWord=c("españoles","persona", "Comunidad"), cex=0.8, axes=c(1,2), title="Conjoint representation of speeches and three words. Plan (1,2)")
It is possible to do a joint representation of some documents and words confidence ellipses:
ellipseLexCA(resCA, selDoc="ALL", selWord=c("español", "española" ,"españoles","españolas", "persona", "Comunidad"), cex=0.8, axes=c(1,2), title="Conjoint representation of speeches and some words. Plan (1,2)")
To show CA results for the words whose contribution is over 3 times the average word contribution:
summary(resCA, metaWords=TRUE)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 |
Correspondence analysis summary Eigenvalues Variance % of var. Cumulative % of var. dim 1 0.128 18.276 18.276 dim 2 0.098 13.989 32.265 dim 3 0.076 10.798 43.063 dim 4 0.069 9.761 52.824 dim 5 0.064 9.142 61.967 Cramer's V 0.265 Inertia 0.702 DOCUMENTS Coordinates Only the first 10 elements are shown Dim 1 Dim 2 Dim 3 Dim 4 Dim 5 Su79 -0.067 0.567 0.017 -0.005 -0.224 CS81 0.101 0.332 0.006 -0.096 0.263 Gz82 0.072 0.420 0.365 0.229 0.021 Gz86 0.734 -0.196 -0.031 -0.368 -0.271 Gz89 0.601 -0.218 -0.095 0.573 0.307 Gz93 -0.040 -0.094 -0.193 0.083 0.283 Az96 -0.302 0.045 -0.401 -0.167 0.119 Az00 -0.322 -0.254 -0.232 -0.083 0.055 Zp04 -0.269 -0.112 -0.232 0.152 -0.350 Zp08 -0.330 -0.427 0.301 0.299 -0.374 Contributions (by column total=100) Only the first 10 elements are shown Dim 1 Dim 2 Dim 3 Dim 4 Dim 5 Su79 0.418 39.145 0.045 0.004 9.332 CS81 0.643 9.031 0.004 1.084 8.704 Gz82 0.335 15.072 14.782 6.431 0.059 Gz86 47.115 4.377 0.143 22.132 12.810 Gz89 21.220 3.656 0.898 36.102 11.070 Gz93 0.100 0.734 4.030 0.833 10.238 Az96 7.720 0.228 23.097 4.444 2.399 Az00 6.999 5.689 6.150 0.870 0.402 Zp04 4.278 0.971 5.368 2.567 14.470 Zp08 6.973 15.269 9.853 10.754 17.884 Square cosinus (by row total=1) Only the first 10 elements are shown Dim 1 Dim 2 Dim 3 Dim 4 Dim 5 Su79 0.008 0.565 0.000 0.000 0.088 CS81 0.015 0.159 0.000 0.013 0.100 Gz82 0.007 0.242 0.183 0.072 0.001 Gz86 0.676 0.048 0.001 0.170 0.092 Gz89 0.367 0.048 0.009 0.333 0.096 Gz93 0.003 0.014 0.061 0.011 0.130 Az96 0.180 0.004 0.319 0.055 0.028 Az00 0.158 0.099 0.082 0.011 0.005 Zp04 0.094 0.016 0.070 0.030 0.159 Zp08 0.133 0.223 0.111 0.110 0.171 Inertia Su79 0.068 CS81 0.056 Gz82 0.061 Gz86 0.090 Gz89 0.074 Gz93 0.050 Az96 0.055 Az00 0.057 Zp04 0.058 Zp08 0.067 WORDS Coordinates Only the first 10 elements are shown Dim 1 Dim 2 Dim 3 Dim 4 Dim 5 abierto -0.647 -0.346 -0.573 -0.180 0.261 abordar -0.490 -0.266 0.468 -0.081 0.148 abordaremos -0.421 -0.689 0.369 -0.652 0.400 acabo -0.181 -0.419 -0.093 -0.224 0.516 acceso 0.007 0.115 0.016 0.015 -0.319 acción -0.081 0.336 -0.163 0.064 0.041 acciones -0.030 0.369 -0.013 -0.275 -0.109 acontecimientos 0.312 -0.195 -0.367 0.941 0.214 Acta 1.751 -0.636 -0.251 0.274 0.065 actitud 0.295 0.541 0.272 0.052 -0.256 Contributions (by-column total=100) Only the first 10 elements are shown Dim 1 Dim 2 Dim 3 Dim 4 Dim 5 abierto 0.192 0.072 0.256 0.028 0.062 abordar 0.157 0.060 0.242 0.008 0.029 abordaremos 0.043 0.150 0.056 0.193 0.077 acabo 0.011 0.078 0.005 0.032 0.180 acceso 0.000 0.013 0.000 0.000 0.152 acción 0.017 0.392 0.120 0.021 0.009 acciones 0.000 0.065 0.000 0.051 0.009 acontecimientos 0.026 0.013 0.061 0.441 0.024 Acta 1.188 0.204 0.041 0.054 0.003 actitud 0.025 0.111 0.036 0.001 0.038 Square cosinus (by-row total=1) Only the first 10 elements are shown Dim 1 Dim 2 Dim 3 Dim 4 Dim 5 abierto 0.242 0.069 0.190 0.019 0.039 abordar 0.308 0.091 0.281 0.008 0.028 abordaremos 0.084 0.224 0.064 0.201 0.076 acabo 0.027 0.142 0.007 0.041 0.215 acceso 0.000 0.035 0.001 0.001 0.268 acción 0.021 0.369 0.087 0.014 0.005 acciones 0.002 0.256 0.000 0.142 0.022 acontecimientos 0.059 0.023 0.082 0.541 0.028 Acta 0.805 0.106 0.017 0.020 0.001 actitud 0.104 0.350 0.088 0.003 0.078 Inertia abierto 0.001 abordar 0.001 abordaremos 0.001 acabo 0.001 acceso 0.000 acción 0.001 acciones 0.000 acontecimientos 0.001 Acta 0.002 actitud 0.000 Words whose contribution is over 3 times the average word contribution Dimension 1 + esfuerzo Comunidad Comunitaria Única Acta ESTE querría integración países proceso intentar posibilidad política decía juicio inflación esperamos interior creo Económica hecho cooperación negociación cuanto relación Europeas técnicas decir presión tema supone clima adaptación Instituciones propia importantes crecimiento sostenido saneamiento naturalmente coordinación propio realización evolución actuación comienzo importante referencia haciendo pueda propios mayoría consumo mismo instrumento recuperación mantener situación respecto avance PSOE conseguir ir desigualdades Tratado cierto desafío elementos pretendemos Dimension 1 - españoles reforma confianza compromiso reformas modelo España laboral derechos ámbito país pasada Ley alcanzar innovación familias euros mejor Dimension 2 + libertad pueblo Constitución UCD realidad orden autonómico libre ciudadana programa persona Proyecto Derecho Pública real régimen crisis paro pueblos palabras problemas histórica artículo hombre expansión propósitos encuentra libertades siguientes reales acción ejercicio valores soluciones aspectos organización dignidad mediante perspectiva estatal humanos transición eficacia campo Estado grupos preciso edad nacionales Dimension 2 - idea legislatura país pasada seguiremos euros debemos Administraciones últimos Unión necesitamos innovación mujeres competitividad políticas cohesión años apoyo promoveremos empleo España laboral Europea conocimiento ciudadanos crecimiento diálogo acuerdo compromiso reforma seguir pensiones cooperación año Dimension 3 + país euros euro sector millones cifra idea pondremos paro hombres deuda primera Ley cambio entidades humano España laboral Presupuestos ninguna verdad ámbito capaces menos previsiones mujeres internacionalización empleos encuentra vamos dignidad Públicas sino déficit crecimiento español financiero Pública leyes competitividad tarea empresas mientras incluso promoción sabemos seguiremos crédito tipo capital bien Dimension 3 - Comunidades pacto presida Estado Autónomas PP sociedad impulsará Gobierno Cámara finalidad obtengo cumplimiento convergencia suficientes proyección Senado cuestión etapa políticas plena acuerdos poderes particular señoras experiencia señores impulso social desarrollo consecuencia debe político presencia Derecho autonomía Parlamentarios avanzar Dimension 4 + ESTE posición Instituciones idea problemas responsables país toma áreas razones construcción mujeres realización horizonte cambios infraestructuras proyecto Código ritmo días tráfico superior seguiremos respecto investigación Penal pido aumentar ciudades acontecimientos vivienda cuadro juego aumento países años casos ocasión crecimiento políticas ambiente acuerdo efecto ejercer fronteras plazo hombres seguir intervención Dimension 4 - intentar integración sociedad recuperación saneamiento deuda Europea déficit esperamos mayor paso euro Nación empresas Estado entidades internacionalización líneas existe elementos natural van desafío poderes sabemos aquellos quiere momento proceso españoles adecuado mejores año evolución Dimension 5 + ESTE sector Presupuestos interlocutores caída Públicas industrial competitividad internacionalización cifra Partidos Unión beneficios costes deseo pretendo laboral empresas investidura tasa cuadro euro reformas déficit empleos cambios sistemas energético Instituciones proyecto problemas dificultades cada creación paro colaboración debe Cámara acuerdos empresa ritmo Administraciones lugar aumentar superior europeo Dimension 5 - idea terrorismo Plan inmigración integración igualdad seguiremos mujeres país investigación haremos Constitución ciudadanos lucha ETA cultura mujer social derechos decisión atención esperamos deberá identidad información legalidad pueda cohesión elementos PSOE propuesta mano sociedad elemento nadie hacerlo tasas libertades modernización Estatuto víctimas pasada pido intentar pueblo respuesta hombres SUPPLEMENTARY QUANTITATIVE VARIABLES Coordinates Equal to the correlations of the variable with the axes Dim.1 Dim.2 Dim.3 Dim.4 Dim.5 year -0.557 -0.778 0.164 -0.055 0.011 Square cosinus Dim.1 Dim.2 Dim.3 Dim.4 Dim.5 year 0.31 0.605 0.027 0.003 0 |