Since the beginning of year 2020, the worldwide spread virus Covid-19 has resulted in economic fluctuation especially within the stock market. The stock market has experienced an increasing volatility. Covid-19 has impacted the global economy in an unprecedented way. In the United States, volatility levels in the middle of March 2020 rival or surpass those last seen in October 1987 and December 2008 and, before that, in late 1929 and the early 1930s (Scott Baker, Nicholas Bloom, Steven Davis, Kyle Kost, Marco Sammon, The Review of Asset Pricing Studies, Volume 10, Issue 4, December 2020, Pages 742-758).
President Trump has utilized the social media platform Twitter at a high frequency as the primary way for his public communication throughout the world. Some of the tweets published by Trump has mentioned description of his statements towards some specific industries or companies in different sectors. In a influential public role, the President of the United States holds a unique position with broad powers to influence policy relevant to companies such as government contracts, trade tariffs, and government bailouts (Ewalt, 2016 and Gibbs, 2017).
Based on the motivations and continuing impacts expected, our project is to utilize sentiment analysis method to study the impact on president’s tweets published during the pandemic period on the stock market price dataset. Prior study has shown that incorporation of the sentiment information from social media can help to improve the stock prediction(Nguyen and Shirai, 2015). Sentiment analysis has been applied to social media and online reviews area in order to detect and predict reactions on social media reviews. Nemes and Kiss has analyzed the sentiments and manifestations that inside the tweets by different users by utilizing Natural Language Processing and with Sentiment Classification using Recurrent Neural Network (L. Nemes and A. Kiss, 2020) Yin and Li found that different aspects of COVID-19 have been constantly discussed and show comparable sentiment polarities. Some topics like ``stay safe home" are dominated with positive sentiment (Hui Yin, Jianxin Li, 2020).
Our research question is: Has the president tweets during the pandemic caused any impact on financial market? Our goal is to analyze the topics from President’s twitter and then find out if the market reacted to twitter themes we extracted. Based on the stock index correlation with the themes we extracted, we can study the impact of tweets data on the stock market price. Our next step is which type of tweets might influence the specific industries or companies’ stock price.
The data consists of two datasets. We collected the president’s tweets data from Twitter published between 1-1-2020 to 30-09-2020. Regarding the stock market data, we collected the Wilshire index which represents all U.S. headquartered companies that are traded on US stock market.
We used PCA to identify themes that contained within the tweets. There are 5 themes we found. Then we used topic modeling to top ten tweet topics. Our analysis has shown the correlation between president’s tweets with the stock index.
PCA ANALYSIS(Principal component analysis) - is the process of computing the principal components and using them to perform a change of basis on the data, sometimes using only the first few principal components and ignoring the rest.
Topic modeling - is an unsupervised machine learning technique that’s capable of scanning a set of documents, detecting word and phrase patterns within them, and automatically clustering word groups and similar expressions that best characterize a set of documents.
#Import r packages
library(readr)
library(dplyr)
library(ggplot2)
library(tidyr)
library(tm)
library(topicmodels)
library(tidyverse)
library(tidytext)
library(slam)
library(lubridate)
library(lsa)
library(LSAfun, quietly = T)
library(psych)
library(GPArotation)
library(paran)
library(qdapRegex)
library(ggpubr)
library(corrplot)
#Import and Format datasets
wilshire <- read_csv("WILL5000PRFC.csv")
willshire <- wilshire
pandemic_stock_index <-
wilshire %>% filter(DATE > '2020-01-01' & DATE < '2020-10-01')
pandemic_stock_index <-
pandemic_stock_index[order(pandemic_stock_index$DATE), ]
pandemic_stock_index <- na.omit(pandemic_stock_index)
plot(WILL5000PRFC ~ DATE,
pandemic_stock_index,
xaxt = "n",
type = "l")
axis(1,
pandemic_stock_index$DATE,
format(pandemic_stock_index$DATE, "%b %d"),
cex.axis = .7)
A plot on the willshire share index is made to show how the stock prices have fluctuated between jan’2020 to sep’2020. As we can see the stock prices have reached their lowest during march’2020 at the peak of the pandemic and has increased thereafter.
willshire$DATE <- ymd(willshire$DATE)
willshire$WILL5000PRFC <-
as.numeric(as.character(willshire$WILL5000PRFC), na.rm = TRUE)
willshirejantosep <-
subset(willshire, DATE > "2020-01-01" & DATE < "2020-10-01")
willshirets <-
ts(
willshirejantosep,
start = c(2020, 1),
end = c(2020, 10),
freq = 12
)
plot(willshirets)
A time-series plot is made on the stock market price to see how the stock market price has increased or decreased over time. It could be seen that there were dips in stock prices during the first 3 months of 2020 as soon as the pandemic started and the stock prices started increasing thereafter.
tweets <- read_csv("tweets_11-06-2020.csv")
trump_tweets <-
tweets %>% filter(
date > as.POSIXct('2020-01-01 00:00:00', tz = "GMT") &
date < as.POSIXct('2020-10-01 00:00:00', tz = "GMT")
)
trump_tweets <- trump_tweets[order(as.Date(trump_tweets$date)), ]
trump_tweets = subset(trump_tweets,
select = -c(id, isRetweet, isDeleted, device, favorites, retweets))
trump_tweets$date <- as.Date(trump_tweets$date)
trump_tweets$date <- as.factor(trump_tweets$date)
dates = levels(trump_tweets$date)
resultString = rep.int("", length(dates))
for (i in 1:length(dates))
{
for (j in 1:length(trump_tweets$text))
{
if (trump_tweets$date[j] == dates[i])
{
resultString[i] = paste0(resultString[i], trump_tweets$text[j])
}
}
}
result = data.frame(date = dates, text = resultString)
trump_tweets <- result
trump_tweets_subset <- trump_tweets %>% slice_head(n = 3000)
trump_tweets_subset_spring <-
tweets %>% filter(
date > as.POSIXct('2020-01-01 00:00:00', tz = "GMT") &
date < as.POSIXct('2020-05-31 00:00:00', tz = "GMT")
)
trump_tweets_subset_summer <-
tweets %>% filter(
date > as.POSIXct('2020-06-01 00:00:00', tz = "GMT") &
date < as.POSIXct('2020-10-01 00:00:00', tz = "GMT")
)
names(trump_tweets)[names(trump_tweets) == "date"] <- "DATE"
trump_tweets$DATE <- as.Date(trump_tweets$DATE)
The data set on tweets contains multiple entries on each day for every single tweet made by President Trump. Hence as the tweets made on a single day are combined together. The tweets between the time period 01/01/2020 to 10/01/2020 are considered for the project
tweets_index <-
merge(x = willshirejantosep,
y = trump_tweets,
by = "DATE")
tweets_index <- tweets_index %>% drop_na(WILL5000PRFC)
tweets_index$text <- gsub("[^\x01-\x7F]", "", tweets_index$text)
tweets_index$text <- rm_url(tweets_index$text)
tweets_index$text <- rm_twitter_url(tweets_index$text)
write.csv(tweets_index, "tweets_index.csv", row.names = FALSE)
Since the tweets and stock price index are sorted by date, both the tweets and stock price index are combined together by date.
pca_data <- read.csv("PCA_Analysis_Tweets.csv")
names(pca_data)[names(pca_data) == "ï..Filename"] <- "DATE"
Using Meaning Extractor Software(MEH), the tweets data set is given as input to get a count on the tokens. This data set will be used for doing PCA Analysis.
paran(pca_data[,5:ncol(pca_data)], iterations = 100, centile = 95)
##
## Using eigendecomposition of correlation matrix.
## Computing: 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
##
##
## Results of Horn's Parallel Analysis for component retention
## 100 iterations, using the 95 centile estimate
##
## --------------------------------------------------
## Component Adjusted Unadjusted Estimated
## Eigenvalue Eigenvalue Bias
## --------------------------------------------------
## 1 34.900786 44.347026 9.446239
## 2 9.327022 18.489189 9.162167
## 3 8.524859 17.488269 8.963410
## 4 6.665918 15.456872 8.790953
## 5 5.472154 14.140964 8.668810
## 6 4.809794 13.367849 8.558055
## 7 4.356543 12.788638 8.432094
## 8 3.887288 12.223081 8.335793
## 9 3.529891 11.751694 8.221802
## 10 3.166051 11.319787 8.153735
## 11 3.077800 11.104575 8.026775
## 12 2.913080 10.840313 7.927232
## 13 2.552343 10.385111 7.832768
## 14 2.452496 10.195589 7.743092
## 15 2.376106 10.037739 7.661632
## 16 2.332720 9.931892 7.599171
## 17 2.088436 9.595528 7.507091
## 18 2.064378 9.486343 7.421964
## 19 1.982658 9.337831 7.355173
## 20 1.909567 9.213020 7.303452
## 21 1.858088 9.067587 7.209498
## 22 1.875021 9.001486 7.126465
## 23 1.747985 8.802617 7.054631
## 24 1.666602 8.655775 6.989172
## 25 1.523687 8.449255 6.925567
## 26 1.493443 8.356739 6.863295
## 27 1.490638 8.281381 6.790743
## 28 1.393164 8.117773 6.724608
## 29 1.340084 8.017576 6.677492
## 30 1.372000 7.983279 6.611279
## 31 1.313846 7.864069 6.550222
## 32 1.301966 7.790374 6.488407
## 33 1.282839 7.730119 6.447279
## 34 1.234238 7.601428 6.367189
## 35 1.234400 7.553715 6.319314
## 36 1.179502 7.449272 6.269769
## 37 1.187638 7.386493 6.198854
## 38 1.112562 7.260267 6.147704
## 39 1.145332 7.231609 6.086276
## --------------------------------------------------
##
## Adjusted eigenvalues > 1 indicate dimensions to retain.
## (39 components retained)
components = principal(pca_data[,5:ncol(pca_data)], nfactors = 5, rotate = 'oblimin')
## The determinant of the smoothed correlation was zero.
## This means the objective function is not defined.
## Chi square is based upon observed residuals.
## The determinant of the smoothed correlation was zero.
## This means the objective function is not defined for the null model either.
## The Chi square is thus based upon observed correlations.
plot(components$values[1:20], type="b")
From the PCA analysis,there are 39 components which has eigen values >1. Also the elbow plot shows a bend around 20. hence it becomes neceassary to look for the best themes from the PCA.
dim(components$loadings)
## [1] 923 5
components$loadings
##
## Loadings:
## TC1 TC2 TC5 TC4 TC3
## city 0.494
## state 0.177 0.215 0.229
## question 0.238 0.394
## federal 0.178 0.253
## government 0.231
## consider -0.105 0.112 0.159
## involve 0.187 -0.138 0.123
## order 0.439
## poorly 0.113
## democrat 0.136 0.288
## great 0.102 0.230
## situation -0.120 0.203
## party 0.153 0.241 -0.109
## nation 0.200 0.194
## local 0.281 0.176
## problem 0.200 0.115
## congress 0.251 0.384
## amp 0.189 0.128 0.105
## president 0.125 0.193 0.143 0.113
## time 0.120 0.120 0.153
## energy 0.137 0.255
## total 0.475
## partisan -0.225 0.474 0.153 -0.110 -0.105
## impeachment -0.319 0.574 -0.272
## hoax 0.259 0.335 -0.176
## important 0.153 0.167 0.303
## matter 0.194 0.254 0.345 -0.184
## republican 0.121 0.213 0.264
## house 0.303 0.145
## vote 0.191 0.158 0.111 0.297
## dem 0.364 0.150 -0.154
## witch -0.171 0.314 0.261 -0.201
## hunt -0.171 0.314 0.261 -0.201
## start -0.110 0.149 0.191
## win 0.187 0.211 0.150 0.174
## election 0.173 0.151 0.255 0.116
## end 0.134 0.100
## quickly
## read 0.241 0.237 0.225 -0.190
## transcript -0.179 0.273 -0.188
## see 0.184 0.177 0.110
## strong 0.394 0.170
## statement 0.235
## game 0.143 0.216
## reason 0.159
## send 0.293
## article 0.484 -0.151
## senate 0.504
## weak 0.269 0.189 -0.116
## pathetic 0.108 0.104 0.154
## X.lindseygrahamsc 0.416 -0.103
## scam 0.327 0.121
## continue 0.155 0.120 0.176
## spend 0.163 0.226
## political 0.324 0.169
## history 0.205 0.240 -0.117
## sad 0.228 0.196 -0.122
## rt 0.232 0.164
## thank 0.207 0.198 0.124
## X.realdonaldtrump 0.137 0.132 0.137
## deliver 0.173
## X2020 0.294 0.143
## tire 0.142 0.115
## job 0.174 0.305 0.200
## X.cnn 0.130 0.227
## rating 0.183 0.113
## watch 0.251 0.257
## change 0.189 0.122 0.113
## love 0.458
## hampshire -0.186
## fine 0.243 0.135
## military 0.105 0.140 0.433
## year 0.283 0.268 0.143 -0.162
## investigation 0.153 0.487
## play 0.281 0.285
## base 0.312
## X.foxnew 0.297 0.181 -0.200
## hurt 0.397 0.190
## country 0.167 0.221
## badly 0.218 0.172
## bring 0.294 0.130
## york 0.219 -0.167 0.170 0.173
## post 0.122
## trump 0.184 0.266 0.130
## campaign 0.125 0.469 -0.160
## raise 0.390 0.125 0.125
## day 0.118 0.246 0.244
## shot 0.291 0.131
## set 0.146 0.337 -0.114
## process 0.404
## lead 0.301 0.126
## X.danscavino 0.239 0.117 0.106 -0.105
## list 0.237 0.131 0.121
## show 0.132 0.272 0.119
## result 0.315
## promise 0.314
## X.maga 0.106 0.385 -0.214
## happen 0.212 0.221 0.122
## presidential
## candidate 0.101 0.120 0.103
## long 0.173 0.186 0.109
## jail 0.169 0.281 -0.107
## crime 0.372 -0.110
## big 0.173 0.154 0.236
## people 0.145 0.174 0.128
## small -0.126 0.231 0.284
## group 0.395 0.101
## politician 0.192 -0.138
## official 0.114 0.161 0.117 0.171
## illegally 0.229 -0.183
## spy 0.107 0.318 -0.120
## ukraine -0.194 0.488 0.120
## X.gopchairwoman 0.110 0.157
## advance 0.102 0.154
## fall 0.337
## obama 0.176 0.191 0.366
## X.teamtrump 0.322
## look 0.108 0.203 0.214 0.150
## fantastic 0.121 0.133
## american 0.231 0.112 0.209
## speaker -0.106 0.332 0.112
## pelosi 0.289
## call 0.229
## historic 0.350 0.185 -0.191
## tax 0.101 0.445
## cut 0.315
## business 0.233 0.385
## worker 0.169 0.262 0.227
## under 0.183 0.262 0.139
## unemployment 0.221 -0.110
## plan 0.294 0.146
## attack 0.151 0.329 0.168
## gun 0.235 0.156
## reporter 0.182
## led 0.232 0.138 0.109
## troop 0.314 0.135 0.145
## combat 0.134 0.307
## god 0.113
## single 0.187
## high 0.186 0.129
## commit 0.132 0.275 -0.116
## protester 0.600
## kill 0.341 0.175 0.107
## urge 0.257 0.145
## force -0.112 0.394
## tonight 0.123 0.296 -0.147 0.197 0.104
## family 0.154 0.114 0.227
## news -0.113 0.254 0.128 0.262
## closely -0.109 0.190 0.101
## X.whitehouse -0.103 0.290
## action 0.147 0.171 -0.158 0.255
## protect 0.133 0.447 0.166
## citizen 0.146 0.130 0.169
## hospital 0.122 -0.173 0.359
## young 0.127 -0.133 0.121
## man 0.197 0.233
## chance 0.159 -0.115
## amaze 0.204 0.281 0.238
## told 0.150 0.347 -0.140
## accept 0.132 0.210 0.129
## head 0.185
## forget 0.210 0.151 0.127 0.137
## person 0.108 0.241 0.174 -0.145
## washington 0.311
## street 0.275 -0.117
## freedom 0.148 0.126 0.114
## general 0.264 0.265 0.101
## book 0.116 0.129 0.151
## control 0.258 0.213
## happy 0.209
## usa 0.101 0.149
## paid
## dollar
## top 0.113
## iran 0.310 0.125
## choice 0.279 0.121
## gain 0.153 0.165 -0.165
## admit 0.126 0.138 0.320
## hate 0.110 0.106
## leader 0.100 0.236 0.206
## senior
## nothing 0.149 0.159 0.114 0.120
## email -0.134 0.469 0.112
## white 0.137 0.116 0.151
## figure 0.153
## aid -0.185 0.213 0.115
## number 0.116
## joe 0.338 -0.136 0.233 0.200 0.101
## biden 0.409 0.137
## approve 0.104 0.122 -0.140
## middle 0.141 0.181 0.151
## east 0.156 0.173
## policy 0.144 0.307
## X.foxandfriend
## caught 0.343
## death 0.119 0.104 -0.109 0.154
## large 0.147 0.136
## week 0.292 0.200 0.147
## senator 0.295 -0.100 0.335
## said 0.236 0.113
## trial 0.492
## brought 0.206 0.255
## place 0.126 0.233
## thought 0.190 0.234
## staff -0.118
## push 0.282 0.114
## stop 0.283 0.115
## money 0.100 0.104 0.132
## legal 0.380
## decision 0.132 0.242
## war 0.121 0.124
## lost -0.140 0.161
## hand 0.171 0.203
## produce 0.194 -0.163
## corrupt 0.112 0.216 -0.110
## schiff -0.276 0.498 0.154 -0.107 -0.178
## joke 0.102 0.106 -0.108
## X.senatemajldr 0.535 0.253
## authority 0.103 0.122
## security 0.206 -0.119 0.205 0.104
## give 0.103 0.174 0.144 0.211
## answer 0.208 0.216 0.105
## media 0.135 0.375 0.102
## fact 0.252 0.222
## X.scavino45 -0.160 0.232 -0.163
## unite 0.163 0.145
## allow 0.207
## X.potus 0.342 0.241
## X.ivankatrump 0.219
## blue 0.157 0.139 -0.124
## boom -0.113 0.108
## talk 0.278 0.153
## point 0.104 0.186
## X.mike_pence 0.126
## join 0.124 0.321 0.129
## night 0.205 0.109
## report 0.111 0.121 0.343
## launch 0.138 0.165 0.122
## vice
## rest
## easy 0.198
## leadership 0.176 0.121
## national 0.252 0.121
## law 0.404 0.119 0.213
## enforcement 0.348 0.174
## market 0.125 0.155
## wrong 0.223 0.161
## ohio 0.299
## rally 0.295 0.197 -0.227
## tremendous 0.592
## crowd 0.218
## X95 0.103
## approval 0.157 0.161
## rate -0.101 0.323
## smart 0.176 -0.109
## fully 0.262
## agree 0.270 0.118
## black 0.412 0.148
## support 0.114 0.293 0.182
## low 0.167 0.172
## record 0.248 0.195 -0.102
## court 0.247 0.144
## lower 0.172 -0.156 0.148 0.108
## build 0.100 0.151
## southern
## border 0.482 0.198
## wall 0.156
## entire 0.302
## ready 0.158 0.211 -0.127
## hope 0.261 0.112
## crazy -0.167
## nancy 0.188
## power 0.111 0.266 0.124 0.124 0.110
## resolution 0.302 -0.166
## remember 0.204 0.152 0.202
## fraud 0.231
## clear 0.137 0.280 0.125
## november 0.251 0.242 -0.231
## liberal 0.405 0.127 0.228 -0.124
## absolutely 0.185 0.122
## right 0.199 0.269 0.166
## stock 0.122 -0.127
## team 0.230 0.117 0.144
## meeting -0.128
## discuss 0.152 0.156
## trade 0.278 0.121 -0.126
## price 0.148
## interview 0.162
## X.gopleader -0.153 0.309
## interest 0.211
## prevent 0.146 0.373
## oppose
## speak
## sit -0.105 0.299
## majority 0.379
## late 0.135 0.161
## short 0.147 0.174
## blame 0.285 -0.115
## sign 0.111 0.230
## demand 0.330
## executive -0.155 0.108
## word 0.227 -0.151
## attempt 0.291
## work 0.137 0.105 0.242 0.206
## follow 0.177 0.152
## significant -0.126 0.264 0.330
## X.tomfitton 0.128 0.315 -0.212 0.133
## carry 0.141 -0.155
## mess 0.201 0.207 -0.102
## clean 0.270 -0.102 0.159
## terrible 0.142 0.109 -0.136
## X2016 0.168 0.261 0.155
## secretary 0.208 0.170
## john 0.139 0.216 0.248
## coup 0.293
## update 0.168 0.231 0.100
## X.loudobb 0.146 0.350 -0.108
## corruption -0.257 0.444 0.191
## document 0.140 0.459
## expose 0.212 -0.103
## department 0.181 -0.124
## X.jim_jordan 0.106 0.108 0.193
## best 0.178 0.130 0.203
## X.senategop 0.497 -0.135 0.160
## finally 0.197 0.141 0.123
## safe 0.182
## turn 0.124 0.174 0.162
## evidence 0.383 0.214
## mike -0.108 0.109 0.416
## appreciate 0.189
## honor 0.101 0.140 0.180
## intelligence 0.182
## community 0.170 0.227
## response -0.124 0.552
## information 0.154 0.101 -0.180 0.169
## medicare 0.141 0.164
## pay 0.123 0.192 0.106
## advocate 0.160 0.383 0.145
## land 0.341 0.210
## water 0.353 0.163
## glad 0.376 -0.120 0.137
## meet 0.150 -0.107 0.160
## today 0.137 0.113 0.128 0.285
## georgia 0.253
## learn 0.140 0.229 0.154 0.245
## deserve -0.110
## live -0.133 0.361
## open 0.253
## dream 0.164 0.270
## X.kag2020 -0.205 0.242 0.224
## rebuild 0.139 0.172 0.103
## america 0.215 0.101 0.190 0.132
## officer 0.362 0.159 0.114
## hit 0.115 0.119
## add 0.145 0.222 -0.135 0.124
## agreement 0.372 0.113
## receive 0.120 0.199 0.218
## full 0.372 0.113
## X.ingrahamangle 0.121 0.102
## enjoy 0.139 -0.191
## successful 0.270 -0.104 0.164 0.135
## fund 0.129 0.189
## address 0.179 0.111
## ensure 0.115 0.322
## event 0.240 0.115
## prove 0.186 0.122 0.108
## morning 0.259
## adam -0.271 0.399 0.125
## broke 0.135 0.130
## economy 0.237 0.164 0.116
## met -0.148 0.212 0.139
## robert 0.188 0.264
## phase 0.196 -0.147 0.411
## china 0.139 0.170 0.115
## representative
## early 0.128 0.219 0.264
## develop 0.134 0.159
## murder 0.206 0.133 0.187
## innocent 0.189 0.107
## arm 0.342 0.208 0.177
## mexico 0.185 0.130
## administration 0.134 0.156 0.143 0.110
## americas 0.322 0.265
## enemy 0.153 0.186 0.281
## defend 0.354 0.124
## defeat -0.109 0.298
## radical 0.374 -0.175
## increase 0.235 0.100 0.218
## production -0.128 0.192
## company -0.156 0.263 0.150
## colorado 0.171 -0.183 0.243 0.177
## fight 0.107 0.427 0.100
## horrible 0.152
## chief 0.124 0.160
## delay 0.108 0.208
## abuse 0.396 0.235
## month 0.208 0.166 0.248
## threat 0.151
## wisconsin -0.108 0.172 0.182
## donald 0.124
## announce 0.125 0.166 0.170
## issue 0.125 0.193 -0.126 0.246
## refuse 0.284 -0.176
## phone 0.133
## drug 0.262 -0.135 -0.110
## violent 0.497 -0.112 0.132
## criminal 0.213
## step 0.202 0.290
## chuck -0.146 0.190 0.157
## schumer -0.131 0.233 0.157
## fair 0.139 -0.132
## true 0.142 0.288
## unfair 0.218
## basement 0.247 -0.144
## hear 0.193 0.268 0.106
## tomorrow 0.136
## better 0.142 0.108 0.176
## break. 0.419
## poll 0.246 0.151
## drop 0.201 0.122
## primary 0.130 0.152 0.170 -0.142
## race 0.185 0.137 0.272 -0.127
## concern 0.137 0.185 -0.158
## fairness 0.300 0.129
## witness 0.486 0.104 -0.151
## lawyer 0.103 0.320 0.105 -0.181
## bloomberg -0.125 0.139 0.282 -0.173
## false 0.160 0.114
## save 0.128 0.190 0.269
## healthcare 0.114
## individual 0.107 0.151
## rep 0.154
## angry 0.124 0.166 0.112
## protest 0.400
## lie 0.239 0.122 0.295
## real 0.123 0.188
## sander 0.267 -0.110
## elizabeth 0.163 0.225 -0.118
## warren 0.109 0.140 0.166
## dead -0.114 -0.173
## potential
## voter 0.215 0.213 0.143
## leave 0.133 0.156
## fast 0.107 -0.138 0.156
## bernie -0.137 0.191 0.117 0.248 -0.145
## fake -0.141 0.272 0.152
## partner 0.109 0.210
## hard 0.277 0.248 0.203
## determine 0.104 0.346
## future -0.123 0.213 0.251
## terrorist 0.320 0.125 0.161
## past 0.247 0.104
## wonderful 0.181 0.103
## guy 0.152 0.193
## left 0.396 -0.119 0.181 -0.102
## flag 0.163
## progress 0.194 0.176
## name 0.151 0.104
## protestor 0.495 -0.115 0.118
## attorney 0.404 0.140
## barr -0.105 -0.109 0.178 0.162 -0.113
## close 0.133 0.254
## stand 0.178 0.302
## potus 0.173
## care 0.159 0.354
## hardworking 0.137 0.236
## socialist 0.337 -0.145
## agenda 0.435
## brilliant -0.102 -0.110 0.192
## move 0.134 0.104 0.181
## massive 0.220 0.107 -0.123 0.108
## patriot 0.158
## thert 0.294 0.356 -0.132 0.190
## deal 0.119 0.177 0.134
## claim 0.102 0.285 0.144 0.171
## reach
## simple 0.135 0.195 0.122 0.238
## case 0.156 0.398
## spent 0.296
## justice 0.216 0.111
## opportunity 0.183 0.319
## safety 0.162 -0.159 0.105 0.203
## idea 0.208 0.120 0.160 -0.107
## light 0.233 0.294
## trt 0.293 0.201 0.173
## vet -0.146 0.671
## minister
## X.dailycaller 0.210 0.124 0.103
## held 0.109 0.125
## daily 0.262 0.184
## abolish 0.278
## private 0.215 0.255 -0.141 0.181
## health 0.184 0.353
## ban 0.273 0.211
## X.trumpwarroom 0.196
## key 0.114 0.162 0.132
## air 0.153 0.196
## sen 0.109 0.443 0.208
## hrt 0.362 0.234 0.204 -0.138
## blow 0.254
## russian 0.320 0.146
## X.sentedcruz 0.617 -0.107
## seeing -0.150 0.164 0.177
## clinton 0.138 0.272
## provide 0.108 0.390
## respect 0.140 0.107 -0.132
## debate 0.209
## judge 0.172 0.318 0.120
## supreme 0.188
## major 0.119 0.101 0.101 0.104
## bless 0.121
## beat 0.298
## impeach -0.182 0.498 -0.100
## correct 0.238 0.131 0.128
## X.marshablackburn 0.455 0.102 -0.121
## trust 0.226 0.117
## farmer 0.108 0.434
## tough 0.128 -0.136 0.317
## term 0.122
## opponent 0.163 0.106
## expect 0.180 0.202
## russia 0.431
## serious 0.173 -0.103
## create 0.103 0.172 0.118
## reject 0.132 0.146 -0.131
## minute 0.276
## politics -0.118 0.135 0.124
## disgrace 0.160
## michigan -0.119 0.180
## strongly 0.327
## X.mzhemingway 0.372 0.219 0.203
## comey 0.397
## leak -0.138 0.344
## pray 0.144 0.212
## public 0.131 0.147 0.104
## school 0.317
## press 0.417
## begin 0.102 0.154 0.141
## florida 0.109 0.142 0.188
## pass 0.132 0.178 0.301
## football 0.210 0.140 0.132
## X.kayleighmcenany
## thrt 0.358 0.155
## incredible 0.487
## shut
## rig 0.145 0.176 0.133
## iowa 0.436 0.142
## sleep 0.174 0.115 0.243 0.111
## X2nd
## amendment 0.592
## virginia 0.338
## so.called 0.214 0.152 -0.170
## careful
## champion 0.114 0.269 -0.112
## excite 0.169 0.204
## ad 0.181
## project 0.199 0.167 0.158
## regulation 0.117 0.155
## hispanic
## mean 0.131 0.130 0.138
## additional 0.176
## X.seanhannity 0.189
## special 0.160 -0.132 0.142 0.131
## life 0.149 0.121 0.311
## together 0.309
## video 0.173 0.289 -0.161
## available 0.135
## chinese -0.150 0.191 0.244
## foreign 0.248 0.181
## swamp -0.187 0.137 0.282 -0.112
## texas
## roger 0.161 0.265 -0.135
## represent 0.123 0.171
## illegal 0.322
## immigration -0.177 -0.121 0.236 0.160
## X.2a 0.544
## complete 0.578
## endorsement 0.658
## supporter 0.345
## huge 0.159 0.159 0.219
## thanks 0.108 0.159 0.192
## X.richardgrenell 0.154 0.140
## spoke 0.346
## economic -0.151 0.196 0.201
## find 0.107 0.129
## compare 0.166
## manager -0.165 0.355 0.179
## tuesday 0.153
## story 0.186 0.135 0.198
## info 0.216 0.231
## irt 0.351 0.290 -0.123 0.319
## charge 0.197 0.208 0.107
## review 0.181 0.205
## explain 0.177
## hunter 0.107 0.201 0.115
## X.greggjarrett -0.118 0.433 -0.162 0.207
## whistleblower -0.181 0.277 0.250
## sure 0.143 0.135
## copy
## cnn 0.134 0.142
## conversation 0.141 0.197
## X.dbongino 0.103 0.161 0.317 -0.138
## destroy 0.280 0.147 0.193 -0.115
## target 0.126 0.263 0.117
## challenge 0.183 -0.137 0.263
## write 0.274 0.160
## grow 0.197
## X.senjohnbarrasso 0.614 -0.128 0.233
## office 0.193 0.164 0.175
## cost 0.134 0.197 0.108
## friend 0.111
## text 0.194 0.137
## message 0.101
## fbi 0.551
## dossier 0.108 0.247 -0.107
## source 0.229 0.195
## page 0.105 0.346 0.175 -0.124
## treat 0.151 0.199
## saturday 0.167
## elect 0.147 0.256 0.112
## throw 0.172 0.182
## jim 0.227 0.299
## truth 0.311 0.161 0.177
## yesterday 0.208 0.140
## coronavirus -0.252 -0.116 0.101 0.527
## greatly 0.104
## effort -0.195 0.173 0.183
## bolton 0.135
## jame 0.335
## release -0.136 0.308
## schedule 0.107
## complain -0.235 0.182 0.177
## failing
## deep -0.180 0.152 0.144
## ny -0.101 0.244 0.230
## virus -0.123 0.196 -0.105 0.286
## extraordinary 0.162 0.165
## prt 0.169 0.280
## affect -0.157 0.397
## visit 0.318 0.216
## outbreak 0.164 -0.179 0.376
## X2a 0.232 0.157
## rule 0.157 0.229 0.152 0.215
## protection -0.185 0.325
## chairman -0.109 0.498 -0.202 0.122 0.174
## infrastructure 0.106 0.166 0.244
## owner 0.145
## congressman -0.140 0.456
## X.breitbartnew
## mention
## admin 0.184 0.126
## finish -0.119 0.133 0.111
## probe 0.112 0.110 0.187 0.108
## friday 0.260 0.158
## chris 0.296
## msdnc 0.246 0.177
## fox 0.199 0.119
## die 0.131
## social 0.180 0.254
## politically 0.202 0.101
## standard 0.248 0.191
## focus 0.223 0.177
## peace 0.150 0.110 0.107 0.117
## israel 0.159
## homeland 0.163 0.163 -0.223 0.156
## johnson 0.250
## vaccine 0.129 0.183
## jersey -0.116
## serve 0.188 0.442
## phony 0.189 0.233 0.178 0.236 -0.175
## incompetent 0.242 0.112
## disaster 0.131 0.118
## stay 0.108 0.105 -0.122 0.210
## bill 0.103 0.323
## recovery 0.235 0.102
## ly 0.141 0.267 0.113
## fraudulent
## dangerous
## hold 0.206 0.134
## highly 0.202
## sick 0.135 0.145 0.158
## X.donaldjtrumpjr 0.186 0.225
## earth 0.248
## double 0.109 0.258
## listen 0.216 0.282 0.101
## north 0.216 0.128 0.187
## carolina 0.188 0.111 0.221 -0.111
## tort 0.112 0.280 0.307
## return
## eastern
## honest 0.126
## buy 0.179
## decade 0.162
## handle 0.178 0.140 0.333
## understand
## celebrate 0.122 0.253 -0.117
## X.thehill 0.116 0.168
## view 0.191 0.176 0.222
## inrt 0.289 0.238
## cover 0.310
## conservative 0.166 0.208 0.211
## worse 0.210 0.212
## gop 0.251 0.229 -0.146
## loser 0.220
## nomination -0.115 0.251 0.201 -0.122
## opening 0.116 0.161 -0.100
## face 0.140 0.172
## speech 0.194 0.205
## imagine 0.251 0.209 0.111
## fail 0.214 0.103
## comment -0.164 0.105 0.345 0.158
## industry 0.145 0.220
## terrific 0.156 -0.112 0.460
## X3rd 0.281 0.188 -0.162
## surge 0.197 0.262 -0.128
## hillary 0.310 0.109
## wait 0.278
## collusion 0.136 0.543
## muel -0.168 0.156 0.380 0.128
## wrt 0.257 0.259 0.385
## central 0.183 0.137
## manufacturing 0.117
## side 0.181 0.103
## damage 0.358 0.187
## congressional 0.149
## silent 0.364 0.159 -0.161
## lose 0.106 0.105
## prime
## alabama 0.315
## nice 0.117
## alone 0.179 0.223
## development 0.101 0.153
## california 0.344 0.168
## defense 0.198 0.147 0.231
## mark 0.152
## secure 0.285
## birthday
## car 0.107 0.123 0.150
## building 0.199 0.124
## expand 0.314
## remark 0.116
## block
## positive
## form -0.144 0.161
## X.coronavirus 0.153 0.430
## task -0.213 -0.185 0.430
## request 0.149
## child 0.173 0.114
## victory 0.206 -0.153
## drain -0.177 0.265
## quick 0.154
## mistake 0.237 -0.134
## fire 0.249 0.124 0.203
## level 0.201
## super 0.170 0.228 -0.112
## prison 0.245 0.131 -0.113
## veteran 0.181 -0.107 0.397
## congratulation
## free 0.126 0.173 0.179
## woman 0.380
## restore 0.187
## data -0.138 0.142
## dnc 0.130
## south 0.174
## hero 0.183 0.267
## rip 0.240
## trend 0.350 0.203 -0.176
## system 0.151
## failure 0.131 -0.147 0.153 0.123
## X.nytime -0.135 0.143 0.134
## barack 0.134 0.216 0.129 -0.131
## arizona 0.139 0.178
## safely 0.166 0.244
## traffic -0.111 0.101 0.242
## train
## X.saracarterdc 0.364
## chaos 0.288
## X.erictrump 0.144 0.214
## pack 0.104 0.145
## winner 0.101 0.147
## success 0.161 0.150 -0.143
## reveal 0.348
## X1.2 0.107
## professional 0.233 0.216
## longer 0.241 0.151 -0.169 0.169
## governor 0.229 -0.238 0.107
## cuomo 0.180 -0.112 0.146 0.152
## scandal 0.312 -0.115
## andraw 0.168
## count 0.113
## st 0.307 -0.109 0.197
## director 0.243 0.299
## puppet 0.197
## surprise
## west 0.149 0.243
## operation -0.181 0.180
## warrior 0.144
## fisa 0.388
## twitter 0.334 0.289 -0.157
## brave 0.315
## food 0.107 0.105 0.249
## straight 0.229 0.297 0.173
## member 0.113 0.192 0.113
## ballot 0.115 -0.162 0.280 0.110
## bore 0.107
## cold -0.120 0.323 -0.111
## beautiful 0.257 0.108 0.152
## ship -0.105 0.205
## X.flotus 0.132 -0.109 0.187
## service 0.243 0.123 0.143
## student 0.128 0.177
## fighter -0.181 0.557
## tom -0.187 0.233 0.271
## india -0.120 0.237
## destruction 0.294 -0.107 0.142
## worst 0.308
## shortly 0.260 0.171
## supply -0.173 0.408
## built -0.121
## prepare 0.151
## crook -0.106 0.306 0.106
## arrive 0.198 0.102 0.126
## field 0.209 -0.156
## doj -0.101 0.444 0.133
## violence 0.421 -0.151 -0.158 0.100
## treatment -0.111 0.364
## nevada 0.228 0.151
## enthusiasm 0.314
## convention 0.145 -0.109
## ridiculous 0.195 0.200
## mayor 0.462 0.197
## spread -0.251 -0.107 0.219 0.384
## accord 0.119 0.209
## medical 0.270
## patient -0.111 0.107
## michael 0.388
## flynn -0.178 0.480 0.115
## ort 0.198 0.100 0.232
## mile -0.117 0.175
## extreme 0.259 -0.160
## difference 0.148
## sanctuary 0.170
## pennsylvania 0.105 0.196 0.157
## dr -0.146 0.230
## doctor 0.105 -0.105 0.311
## travel -0.172 0.122 0.259
## X.cdcgov -0.108 0.436
## arrest 0.351 -0.103
## impact 0.190
## X9.00
## inform 0.164
## minnesota 0.111 0.220
## area -0.175 0.125 0.135 0.117
## conference -0.141 -0.173 0.324
## swine
## flu 0.122
## communist -0.155 0.253 0.242
## david 0.119 0.267 0.126
## test -0.222 0.191 0.372
## tennessee -0.138 0.208
## pandemic -0.111 0.149 0.489
## faucus
## X.covid19 -0.140 0.567
## nyc 0.276 -0.102
## risk 0.102 0.248
## maga 0.187
## cure 0.155 0.297
## reduce 0.179 0.306 0.140
## crisis 0.401
## slow 0.296
## nurse 0.154 0.388
## prevail -0.116 0.289
## oval -0.117 0.146 -0.103 0.190
## confirm 0.155 0.140
## covid 0.115 -0.162 0.132 0.349
## easily
## oklahoma -0.149 0.227
## participate 0.299 -0.120 0.255
## biden.s 0.263 0.129
## plant -0.130 0.188 0.105
## emergency -0.186 0.374
## paycheck -0.150 0.444
## program -0.138 0.398
## player 0.235
## employee 0.253 0.113 0.212
## study 0.107 -0.105 0.139
## resource 0.168 0.292
## seattle 0.261
## distance 0.188 -0.134 0.274
## critical 0.117 -0.117 0.287 -0.180 0.347
## voice 0.298 0.140 0.134
## police 0.651 -0.121 -0.111
## ventilator -0.289 -0.241 0.162 0.313
## X5.30 -0.134 -0.120 0.162
## X.thebradfordfile 0.288 0.259
## navy 0.108 -0.108 0.367 0.236
## X.chuckgrassley 0.102
## endorse 0.185 0.204
## psycho -0.165 -0.189 0.378
## mask -0.130 0.178
## center 0.258
## lamestream -0.234 0.234
## mail.in 0.138 -0.154 0.175
## declassify 0.115 0.468 0.221
## guard 0.338 -0.173 0.114 0.101
## X.joebiden 0.273 0.109
## X96 -0.167 0.173
## mob 0.423
## portland 0.390 -0.195
## absentee 0.111
## monument 0.439 -0.102
## antifa 0.463 -0.136
## minneapolis 0.346 -0.128 0.148
## anarchist 0.664 -0.105
## agitator 0.473 -0.105
## church 0.365 -0.155 0.168
## rioter 0.500
## peaceful 0.612
## burn 0.482 -0.122
## thug 0.438 -0.111 -0.114
## looter 0.447 -0.114 -0.228
## statue 0.390
## defund 0.271 -0.138 -0.151
##
## TC1 TC2 TC5 TC4 TC3
## SS loadings 23.545 23.145 19.907 19.001 18.981
## Proportion Var 0.026 0.025 0.022 0.021 0.021
## Cumulative Var 0.026 0.051 0.072 0.093 0.113
loadings5 = as.data.frame(components$loadings[1:923, 1:5])
theme1_loadings5 = subset(loadings5[order(loadings5$TC1, decreasing = T),], TC1 >= 0.15, select = c(TC1))
theme2_loadings5 = subset(loadings5[order(loadings5$TC2, decreasing = T),], TC2 >= 0.15, select = c(TC2))
theme3_loadings5 = subset(loadings5[order(loadings5$TC3, decreasing = T),], TC3 >= 0.15, select = c(TC3))
theme4_loadings5 = subset(loadings5[order(loadings5$TC4, decreasing = T),], TC4 >= 0.15, select = c(TC4))
theme5_loadings5 = subset(loadings5[order(loadings5$TC5, decreasing = T),], TC5 >= 0.15, select = c(TC5))
print(theme1_loadings5)
## TC1
## anarchist 0.6638672
## police 0.6511708
## peaceful 0.6117521
## protester 0.5998266
## rioter 0.4998983
## violent 0.4971795
## protestor 0.4954145
## city 0.4941912
## burn 0.4823503
## agitator 0.4729674
## antifa 0.4625706
## mayor 0.4615375
## looter 0.4468648
## order 0.4391768
## monument 0.4389484
## thug 0.4382296
## mob 0.4226555
## violence 0.4212080
## black 0.4119240
## biden 0.4090240
## liberal 0.4047845
## law 0.4038209
## protest 0.3995261
## hurt 0.3967933
## left 0.3959992
## group 0.3950958
## statue 0.3901931
## raise 0.3899849
## portland 0.3896927
## woman 0.3800026
## majority 0.3786825
## glad 0.3757408
## radical 0.3735338
## X.mzhemingway 0.3721846
## church 0.3646761
## silent 0.3642987
## hrt 0.3618690
## officer 0.3618298
## damage 0.3578197
## irt 0.3510382
## arrest 0.3509483
## trend 0.3499956
## historic 0.3498998
## enforcement 0.3476044
## minneapolis 0.3463035
## arm 0.3422827
## land 0.3411224
## kill 0.3405034
## guard 0.3380027
## joe 0.3375496
## fall 0.3371242
## twitter 0.3335551
## X.teamtrump 0.3218568
## terrorist 0.3197262
## school 0.3169886
## enthusiasm 0.3137511
## troop 0.3137286
## base 0.3123738
## washington 0.3105556
## st 0.3068329
## lead 0.3006635
## participate 0.2994526
## voice 0.2981189
## X.foxnew 0.2971173
## bring 0.2941061
## thert 0.2935330
## destruction 0.2935141
## send 0.2925347
## shot 0.2910707
## X.thebradfordfile 0.2880119
## chaos 0.2877038
## refuse 0.2838061
## year 0.2831284
## stop 0.2826070
## X3rd 0.2808827
## local 0.2806871
## play 0.2806025
## destroy 0.2799176
## choice 0.2787797
## abolish 0.2782086
## nyc 0.2756288
## street 0.2754817
## write 0.2741055
## ban 0.2727723
## X.joebiden 0.2727186
## defund 0.2713544
## weak 0.2690568
## biden.s 0.2625103
## drug 0.2615467
## seattle 0.2611747
## shortly 0.2599002
## extreme 0.2589973
## control 0.2583702
## wrt 0.2569129
## beautiful 0.2568904
## employee 0.2531219
## national 0.2520747
## november 0.2512448
## imagine 0.2510998
## watch 0.2507057
## fire 0.2489450
## record 0.2475848
## basement 0.2472013
## prison 0.2452268
## fine 0.2434405
## service 0.2428401
## longer 0.2409712
## read 0.2406486
## rip 0.2402953
## lie 0.2394425
## question 0.2381896
## mistake 0.2371746
## increase 0.2354960
## player 0.2350699
## gun 0.2345772
## led 0.2323461
## team 0.2303610
## straight 0.2294427
## source 0.2290597
## call 0.2290246
## governor 0.2288283
## sad 0.2284144
## nevada 0.2283331
## jim 0.2273135
## word 0.2266148
## massive 0.2200190
## york 0.2187403
## badly 0.2178938
## north 0.2163771
## listen 0.2155610
## voter 0.2151568
## america 0.2146307
## so.called 0.2135837
## criminal 0.2130248
## happen 0.2115403
## forget 0.2104891
## football 0.2096678
## happy 0.2087895
## idea 0.2084349
## yesterday 0.2084337
## secretary 0.2077712
## answer 0.2077201
## month 0.2075177
## hold 0.2062979
## victory 0.2059732
## murder 0.2057602
## night 0.2053848
## remember 0.2040008
## mess 0.2010517
## nation 0.2004719
## problem 0.1996344
## project 0.1988997
## right 0.1987983
## ort 0.1982523
## arrive 0.1977114
## defense 0.1976348
## man 0.1972419
## finally 0.1966095
## surge 0.1965416
## X.trumpwarroom 0.1956469
## ridiculous 0.1945760
## text 0.1943213
## matter 0.1940753
## speech 0.1936251
## hear 0.1930304
## vote 0.1910881
## view 0.1909877
## thought 0.1898201
## phony 0.1889910
## robert 0.1884206
## carolina 0.1883662
## distance 0.1876813
## win 0.1874099
## involve 0.1870034
## restore 0.1869568
## story 0.1864366
## X.donaldjtrumpjr 0.1856419
## race 0.1850186
## endorse 0.1848121
## opportunity 0.1829615
## under 0.1828937
## rating 0.1827546
## challenge 0.1826256
## veteran 0.1814507
## wonderful 0.1814096
## department 0.1813633
## ad 0.1808135
## cuomo 0.1796438
## expect 0.1796124
## reduce 0.1788675
## federal 0.1781370
## stand 0.1778823
## leadership 0.1759405
## obama 0.1759355
## sleep 0.1742686
## child 0.1733060
## election 0.1731823
## big 0.1728362
## serious 0.1727037
## throw 0.1718866
## lower 0.1718319
## jail 0.1690495
## prt 0.1689266
## update 0.1677189
## resource 0.1675410
## dream 0.1643291
## inform 0.1641096
## homeland 0.1631630
## spend 0.1630565
## flag 0.1625446
## safety 0.1621888
## success 0.1608995
## special 0.1599208
## advocate 0.1596608
## israel 0.1589992
## ready 0.1584395
## blue 0.1569029
## rule 0.1566643
## cure 0.1554646
## family 0.1544528
## information 0.1544421
## nurse 0.1536237
## X.richardgrenell 0.1536153
## investigation 0.1533168
## important 0.1529468
## gain 0.1528390
## air 0.1525651
## name 0.1513642
## attack 0.1508573
## prepare 0.1507715
## treat 0.1505835
## peace 0.1502272
## told 0.1501528
## meet 0.1500162
print(theme2_loadings5)
## TC2
## X.sentedcruz 0.6165043
## X.senjohnbarrasso 0.6143922
## impeachment 0.5740680
## X.senatemajldr 0.5354780
## senate 0.5037341
## impeach 0.4984366
## schiff 0.4978518
## chairman 0.4975979
## X.senategop 0.4973258
## trial 0.4921904
## ukraine 0.4884535
## witness 0.4861340
## article 0.4839219
## partisan 0.4737873
## X.marshablackburn 0.4547089
## corruption 0.4440431
## sen 0.4426296
## iowa 0.4364921
## X.lindseygrahamsc 0.4158812
## process 0.4039619
## adam 0.3990796
## abuse 0.3955141
## question 0.3942537
## evidence 0.3834347
## legal 0.3804129
## full 0.3722750
## agreement 0.3720111
## dem 0.3639961
## thrt 0.3578568
## thert 0.3555261
## manager 0.3554749
## water 0.3528811
## determine 0.3464449
## page 0.3459796
## X.potus 0.3415665
## socialist 0.3366118
## speaker 0.3319289
## demand 0.3303520
## attack 0.3287627
## political 0.3243554
## americas 0.3216177
## join 0.3214789
## opportunity 0.3188101
## visit 0.3175938
## result 0.3151519
## witch 0.3142493
## hunt 0.3142493
## promise 0.3136124
## truth 0.3108721
## iran 0.3103399
## X.gopleader 0.3094337
## policy 0.3066011
## house 0.3029219
## entire 0.3023411
## resolution 0.3015770
## fairness 0.3003549
## ohio 0.2993412
## sit 0.2985053
## defeat 0.2982275
## spent 0.2960632
## tonight 0.2955216
## senator 0.2951595
## rally 0.2946252
## plan 0.2940449
## X2020 0.2938160
## trt 0.2933445
## week 0.2923914
## irt 0.2895562
## pelosi 0.2894413
## inrt 0.2892301
## democrat 0.2878613
## play 0.2847997
## claim 0.2847824
## listen 0.2819567
## push 0.2817403
## tort 0.2796954
## trade 0.2782586
## wait 0.2780350
## talk 0.2778706
## whistleblower 0.2771189
## commit 0.2751625
## transcript 0.2732169
## successful 0.2704863
## dream 0.2703668
## clean 0.2701941
## agree 0.2699599
## right 0.2685189
## hear 0.2683121
## year 0.2678223
## sander 0.2674015
## power 0.2657224
## significant 0.2640143
## daily 0.2621297
## under 0.2617876
## surge 0.2616280
## hope 0.2611494
## friday 0.2596233
## wrt 0.2591379
## hoax 0.2586550
## watch 0.2573419
## urge 0.2568530
## elect 0.2560640
## blow 0.2544515
## matter 0.2542948
## celebrate 0.2528970
## fact 0.2516182
## gop 0.2510753
## congress 0.2509022
## nomination 0.2505875
## standard 0.2484810
## foreign 0.2479445
## earth 0.2475834
## past 0.2465442
## court 0.2465266
## poll 0.2458661
## X.kag2020 0.2419656
## incompetent 0.2416508
## person 0.2409293
## event 0.2402463
## X.danscavino 0.2392826
## correct 0.2380204
## list 0.2372812
## economy 0.2368782
## read 0.2366419
## said 0.2361743
## leader 0.2356696
## statement 0.2350354
## hrt 0.2343408
## schumer 0.2334318
## phony 0.2326772
## X.scavino45 0.2323043
## update 0.2310650
## american 0.2308178
## learn 0.2293256
## rule 0.2293034
## trust 0.2259092
## spend 0.2258555
## focus 0.2231580
## add 0.2222545
## unemployment 0.2207047
## X.ivankatrump 0.2189000
## X.mzhemingway 0.2188411
## unfair 0.2184160
## crowd 0.2177412
## answer 0.2163352
## info 0.2161163
## game 0.2161086
## justice 0.2157125
## private 0.2150382
## voter 0.2134327
## republican 0.2130948
## aid 0.2130799
## future 0.2126602
## control 0.2126411
## met 0.2120094
## interest 0.2113917
## win 0.2111616
## ready 0.2107689
## accept 0.2097986
## imagine 0.2093966
## arm 0.2081178
## mess 0.2072735
## allow 0.2066570
## security 0.2057017
## brought 0.2056040
## history 0.2053507
## speech 0.2051483
## amaze 0.2039261
## look 0.2033582
## politically 0.2015669
## charge 0.1970074
## grow 0.1969719
## cost 0.1966618
## air 0.1962174
## phase 0.1958707
## simple 0.1952570
## record 0.1948938
## progress 0.1942641
## produce 0.1942556
## issue 0.1934882
## politician 0.1922445
## obama 0.1909843
## bernie 0.1908016
## chuck 0.1902356
## X.seanhannity 0.1893769
## innocent 0.1892101
## weak 0.1885152
## change 0.1885070
## nancy 0.1880381
## supreme 0.1878167
## high 0.1862705
## prove 0.1861606
## point 0.1860214
## historic 0.1850828
## mexico 0.1849021
## absolutely 0.1847281
## head 0.1845495
## see 0.1840975
## trump 0.1836479
## central 0.1833628
## complain 0.1817577
## side 0.1810619
## middle 0.1807674
## address 0.1790080
## best 0.1780624
## pass 0.1775840
## follow 0.1774210
## deal 0.1766608
## state 0.1766030
## view 0.1763697
## kill 0.1752125
## short 0.1742851
## give 0.1739373
## video 0.1734343
## deliver 0.1733728
## effort 0.1731901
## long 0.1727942
## rebuild 0.1716328
## judge 0.1715961
## colorado 0.1713195
## hand 0.1710791
## action 0.1706529
## excite 0.1689840
## worker 0.1687774
## X2016 0.1683333
## important 0.1673740
## low 0.1672522
## conservative 0.1664027
## month 0.1660033
## gain 0.1648312
## outbreak 0.1642486
## homeland 0.1632044
## unite 0.1626891
## decade 0.1622579
## interview 0.1618716
## X.dbongino 0.1609412
## opening 0.1606031
## care 0.1586525
## huge 0.1585044
## vote 0.1575439
## muel 0.1564443
## east 0.1563281
## case 0.1562318
## terrific 0.1559107
## continue 0.1552967
## remember 0.1524133
## guy 0.1523748
## discuss 0.1523578
## threat 0.1513183
## election 0.1512781
## forget 0.1506845
print(theme3_loadings5)
## TC3
## X.covid19 0.5665733
## response 0.5522320
## coronavirus 0.5274439
## pandemic 0.4894479
## paycheck 0.4442089
## X.cdcgov 0.4363075
## X.coronavirus 0.4302816
## task 0.4298764
## press 0.4172032
## phase 0.4109203
## supply 0.4079173
## crisis 0.4005199
## program 0.3978751
## affect 0.3966436
## force 0.3936949
## provide 0.3901850
## nurse 0.3881040
## business 0.3849238
## wrt 0.3847320
## spread 0.3843703
## outbreak 0.3760948
## emergency 0.3743275
## prevent 0.3728965
## test 0.3722214
## treatment 0.3638938
## live 0.3613697
## hospital 0.3594379
## care 0.3541239
## health 0.3528744
## covid 0.3491704
## critical 0.3465853
## spoke 0.3462540
## handle 0.3327194
## significant 0.3303057
## protection 0.3249750
## conference 0.3239745
## bill 0.3234668
## ensure 0.3223007
## irt 0.3191471
## expand 0.3136638
## ventilator 0.3130080
## doctor 0.3107403
## together 0.3092505
## tort 0.3074234
## combat 0.3071307
## important 0.3030690
## pass 0.3012471
## director 0.2993381
## cure 0.2972534
## slow 0.2958564
## light 0.2935592
## resource 0.2916628
## X.whitehouse 0.2901955
## step 0.2895642
## prevail 0.2886242
## virus 0.2862774
## today 0.2849470
## small 0.2842194
## enemy 0.2810420
## prt 0.2804700
## distance 0.2744769
## medical 0.2700140
## save 0.2685844
## hero 0.2669459
## americas 0.2647729
## early 0.2640017
## challenge 0.2634862
## news 0.2619085
## travel 0.2589788
## center 0.2576540
## participate 0.2546769
## action 0.2546675
## social 0.2538954
## close 0.2535060
## federal 0.2528804
## X.senatemajldr 0.2527303
## food 0.2486509
## risk 0.2482967
## issue 0.2457944
## learn 0.2445392
## safely 0.2444176
## infrastructure 0.2444055
## chinese 0.2443396
## day 0.2440583
## traffic 0.2423483
## decision 0.2423295
## communist 0.2416284
## X.potus 0.2409691
## inrt 0.2383192
## simple 0.2380199
## amaze 0.2378546
## navy 0.2355892
## X.senjohnbarrasso 0.2334779
## ort 0.2323945
## defense 0.2314690
## government 0.2305161
## dr 0.2303053
## sign 0.2298193
## ny 0.2296023
## family 0.2274791
## worker 0.2270162
## community 0.2269191
## alone 0.2232552
## view 0.2219361
## declassify 0.2212569
## industry 0.2195697
## increase 0.2183406
## receive 0.2176079
## visit 0.2162137
## professional 0.2160477
## rule 0.2147791
## pray 0.2123290
## employee 0.2118685
## worse 0.2115232
## give 0.2109061
## stay 0.2104654
## partner 0.2097588
## american 0.2087973
## delay 0.2083448
## sen 0.2078179
## X.greggjarrett 0.2071772
## work 0.2056720
## ship 0.2051109
## review 0.2047727
## excite 0.2043699
## safety 0.2032852
## hard 0.2030400
## hand 0.2026298
## economic 0.2010423
## job 0.2001104
## treat 0.1988218
## border 0.1978797
## conversation 0.1967364
## nation 0.1938956
## production 0.1919445
## thanks 0.1919261
## brilliant 0.1917063
## standard 0.1905526
## impact 0.1901286
## oval 0.1900563
## thert 0.1895840
## appreciate 0.1892749
## fund 0.1885816
## damage 0.1872284
## daily 0.1838785
## effort 0.1834488
## vaccine 0.1825434
## support 0.1821665
## wisconsin 0.1817489
## safe 0.1816863
## private 0.1811688
## move 0.1808504
## operation 0.1800232
## free 0.1786654
## colorado 0.1774863
## truth 0.1773712
## focus 0.1773400
## arm 0.1771580
## student 0.1770582
## seeing 0.1769560
## better 0.1763047
## local 0.1761190
## continue 0.1759150
## additional 0.1756256
## office 0.1745507
## chairman 0.1739536
## potus 0.1732119
## trt 0.1728801
## face 0.1718740
## official 0.1711732
## claim 0.1709380
## announce 0.1704594
## secretary 0.1700037
## strong 0.1700036
## citizen 0.1690810
## longer 0.1687054
## information 0.1686327
## protect 0.1659109
## extraordinary 0.1654465
## rt 0.1643511
## medicare 0.1641623
## X5.30 0.1617640
## approval 0.1614127
## late 0.1606148
## immigration 0.1600945
## X.senategop 0.1597090
## meet 0.1596411
## develop 0.1591323
## clean 0.1587459
## reason 0.1585856
## sick 0.1578130
## comment 0.1576337
## project 0.1575005
## homeland 0.1564174
## discuss 0.1560652
## advance 0.1538819
## death 0.1535450
## development 0.1531740
## time 0.1531708
## follow 0.1524192
## cuomo 0.1518397
## white 0.1513634
## middle 0.1513107
## individual 0.1508194
## system 0.1506907
## company 0.1504849
## car 0.1501766
print(theme4_loadings5)
## TC4
## vet 0.6713032
## endorsement 0.6575174
## tremendous 0.5918333
## amendment 0.5917749
## complete 0.5780533
## fighter 0.5567108
## X.2a 0.5438529
## incredible 0.4873215
## border 0.4819859
## total 0.4748128
## terrific 0.4603618
## love 0.4580119
## congressman 0.4562220
## protect 0.4474540
## tax 0.4446789
## serve 0.4422043
## agenda 0.4345458
## farmer 0.4341152
## military 0.4333678
## fight 0.4270077
## mike 0.4163596
## veteran 0.3968842
## strong 0.3943396
## X.maga 0.3852084
## congress 0.3837741
## advocate 0.3830524
## crime 0.3718161
## navy 0.3669068
## defend 0.3540877
## supporter 0.3454290
## virginia 0.3375545
## senator 0.3354888
## strongly 0.3266832
## rate 0.3233828
## tough 0.3170621
## brave 0.3152919
## alabama 0.3150956
## cut 0.3146142
## life 0.3111848
## reduce 0.3060983
## job 0.3053264
## stand 0.3016905
## jim 0.2991583
## vote 0.2973313
## chris 0.2957059
## support 0.2932302
## secure 0.2854004
## swamp 0.2823420
## bloomberg 0.2819027
## amaze 0.2805209
## race 0.2724880
## tom 0.2708813
## champion 0.2693164
## david 0.2672120
## drain 0.2652120
## roger 0.2650512
## general 0.2649195
## republican 0.2638322
## company 0.2628921
## worker 0.2621477
## fully 0.2616165
## brought 0.2552979
## energy 0.2551186
## georgia 0.2530624
## future 0.2505549
## johnson 0.2501639
## hard 0.2481074
## month 0.2480044
## john 0.2479983
## bernie 0.2475076
## day 0.2457335
## west 0.2431800
## sleep 0.2430052
## colorado 0.2427549
## work 0.2421287
## november 0.2420507
## party 0.2412472
## hardworking 0.2362016
## phony 0.2360161
## big 0.2359682
## immigration 0.2357288
## business 0.2327157
## professional 0.2325989
## small 0.2309641
## great 0.2304406
## state 0.2291516
## super 0.2283976
## X.cnn 0.2272221
## oklahoma 0.2271838
## elizabeth 0.2253420
## X.kag2020 0.2236252
## country 0.2210873
## carolina 0.2207372
## minnesota 0.2204907
## loser 0.2200675
## huge 0.2193466
## early 0.2189417
## law 0.2132585
## conservative 0.2111584
## land 0.2103518
## debate 0.2094253
## field 0.2089974
## tennessee 0.2076311
## leader 0.2056971
## security 0.2047607
## situation 0.2033213
## fire 0.2032602
## best 0.2027098
## highly 0.2023938
## step 0.2016089
## trt 0.2013605
## nomination 0.2008953
## week 0.2002776
## joe 0.2000899
## receive 0.1988707
## thank 0.1978652
## easy 0.1976501
## tonight 0.1973247
## rally 0.1970230
## mayor 0.1965944
## X.jim_jordan 0.1931298
## pay 0.1920817
## save 0.1902040
## america 0.1900724
## X3rd 0.1882801
## florida 0.1881338
## real 0.1877108
## north 0.1874446
## maga 0.1874284
## probe 0.1871492
## murder 0.1867949
## X.flotus 0.1865949
## enemy 0.1859661
## health 0.1836530
## X.foxnew 0.1813094
## honor 0.1798058
## buy 0.1787961
## msdnc 0.1767355
## smart 0.1761288
## progress 0.1757059
## people 0.1743395
## win 0.1740434
## enforcement 0.1738743
## south 0.1738007
## east 0.1732931
## york 0.1732758
## X96 0.1731286
## straight 0.1725214
## wisconsin 0.1723487
## low 0.1723083
## badly 0.1717382
## represent 0.1712721
## shortly 0.1705038
## china 0.1701912
## sanctuary 0.1698087
## primary 0.1697099
## community 0.1695041
## political 0.1685694
## california 0.1681408
## warren 0.1662949
## announce 0.1656505
## infrastructure 0.1655404
## economy 0.1644727
## successful 0.1640958
## office 0.1638420
## seeing 0.1636081
## water 0.1632116
## barr 0.1622800
## key 0.1621741
## turn 0.1620833
## wrong 0.1614082
## form 0.1612226
## terrorist 0.1611174
## idea 0.1595346
## chance 0.1590155
## patriot 0.1576063
## X.gopchairwoman 0.1573938
## schumer 0.1572188
## approval 0.1572056
## pennsylvania 0.1569688
## X2a 0.1568336
## chuck 0.1567152
## wall 0.1563548
## gun 0.1561827
## leave 0.1558202
## regulation 0.1551800
## X2016 0.1545201
## rep 0.1539068
## begin 0.1538720
## quick 0.1535329
## X.coronavirus 0.1534012
## tuesday 0.1531069
## figure 0.1528257
## failure 0.1526992
## fake 0.1524566
## rule 0.1523806
## beautiful 0.1523035
## mark 0.1518551
## horrible 0.1517024
## book 0.1505420
## build 0.1505138
## poll 0.1505022
## dem 0.1502321
print(theme5_loadings5)
## TC5
## fbi 0.5512100
## collusion 0.5429883
## investigation 0.4870783
## flynn 0.4796643
## email 0.4694960
## campaign 0.4686701
## declassify 0.4679713
## document 0.4592193
## doj 0.4437258
## X.greggjarrett 0.4331005
## russia 0.4306469
## break. 0.4190140
## attorney 0.4044882
## case 0.3980881
## comey 0.3968340
## michael 0.3880913
## fisa 0.3875438
## muel 0.3800278
## psycho 0.3784314
## media 0.3746055
## obama 0.3656816
## X.saracarterdc 0.3641406
## X.loudobb 0.3501046
## reveal 0.3477518
## told 0.3468854
## comment 0.3452855
## matter 0.3446404
## leak 0.3444628
## california 0.3438632
## caught 0.3428359
## report 0.3427612
## set 0.3367005
## jame 0.3350282
## hoax 0.3348925
## scam 0.3274981
## cold 0.3226546
## illegal 0.3215534
## admit 0.3202024
## russian 0.3200454
## lawyer 0.3200157
## judge 0.3182812
## spy 0.3176329
## X.dbongino 0.3167719
## X.tomfitton 0.3149601
## scandal 0.3117249
## hillary 0.3102541
## cover 0.3099613
## worst 0.3082247
## release 0.3079864
## crook 0.3056699
## beat 0.2976782
## straight 0.2967539
## lie 0.2948685
## coup 0.2933001
## attempt 0.2905765
## twitter 0.2894697
## video 0.2885799
## true 0.2881598
## critical 0.2874413
## blame 0.2853766
## jail 0.2808814
## clear 0.2803320
## ballot 0.2796112
## hard 0.2765495
## minute 0.2762069
## clinton 0.2724346
## fake 0.2723631
## show 0.2720173
## ly 0.2668611
## trump 0.2659892
## robert 0.2644645
## general 0.2641129
## target 0.2628781
## witch 0.2613062
## hunt 0.2613062
## X2016 0.2609301
## morning 0.2587404
## X.thebradfordfile 0.2585390
## double 0.2576613
## election 0.2553520
## private 0.2546635
## news 0.2542139
## communist 0.2528224
## open 0.2526638
## whistleblower 0.2497380
## dossier 0.2470173
## msdnc 0.2464743
## ny 0.2436928
## director 0.2430244
## history 0.2397880
## india 0.2369866
## recovery 0.2353470
## abuse 0.2350217
## thought 0.2338928
## lamestream 0.2338056
## tom 0.2333909
## place 0.2328391
## man 0.2328151
## joe 0.2327652
## light 0.2327643
## rt 0.2321897
## X2a 0.2316597
## fraud 0.2313123
## info 0.2308610
## gop 0.2288177
## illegally 0.2285052
## liberal 0.2277485
## X.donaldjtrumpjr 0.2254349
## read 0.2245165
## wrong 0.2225292
## fact 0.2223920
## happen 0.2206692
## spread 0.2189262
## barack 0.2160175
## john 0.2157046
## corrupt 0.2155117
## state 0.2153746
## fail 0.2141236
## X.erictrump 0.2140478
## look 0.2139416
## evidence 0.2137708
## expose 0.2123815
## ban 0.2109276
## X.dailycaller 0.2104904
## worse 0.2104188
## accord 0.2085603
## charge 0.2081424
## conservative 0.2080491
## thank 0.2069071
## endorse 0.2041992
## hrt 0.2035833
## X.mzhemingway 0.2028437
## trend 0.2028007
## expect 0.2024871
## remember 0.2019373
## hunter 0.2013702
## drop 0.2009983
## level 0.2008940
## ridiculous 0.1995590
## fox 0.1993340
## building 0.1989661
## story 0.1976342
## puppet 0.1967776
## st 0.1967481
## pennsylvania 0.1958693
## virus 0.1958490
## sad 0.1955677
## economic 0.1955109
## source 0.1952791
## guy 0.1931741
## office 0.1928626
## destroy 0.1928272
## president 0.1927213
## member 0.1915755
## start 0.1914404
## corruption 0.1912018
## chinese 0.1909112
## test 0.1907633
## hurt 0.1904688
## closely 0.1900695
## amp 0.1886939
## plant 0.1883453
## serve 0.1878630
## single 0.1872995
## long 0.1862141
## concern 0.1847986
## admin 0.1841053
## hero 0.1828092
## intelligence 0.1817028
## throw 0.1815566
## reporter 0.1815402
## left 0.1812738
## review 0.1811896
## foreign 0.1807809
## michigan 0.1804113
## social 0.1801888
## alone 0.1791027
## manager 0.1786871
## handle 0.1782591
## arizona 0.1779817
## barr 0.1775694
## phony 0.1775655
## mask 0.1775279
## complain 0.1771399
## see 0.1767804
## explain 0.1767336
## rig 0.1763203
## mail.in 0.1750852
## mile 0.1750131
## page 0.1745296
## job 0.1740412
## turn 0.1739263
## person 0.1738221
## free 0.1727272
## create 0.1715608
## super 0.1703060
## york 0.1701200
## attack 0.1680797
## andraw 0.1676597
## church 0.1675922
## X.thehill 0.1675432
## country 0.1672137
## saturday 0.1671899
## project 0.1666639
## right 0.1663761
## safely 0.1663317
## angry 0.1659123
## compare 0.1655758
## launch 0.1652404
## opponent 0.1630206
## elizabeth 0.1628349
## extraordinary 0.1618745
## ventilator 0.1616379
## official 0.1613797
## lost 0.1608158
## roger 0.1605943
## truth 0.1605905
## write 0.1604844
## false 0.1598365
## disgrace 0.1598294
## chief 0.1598169
## consider 0.1594311
## silent 0.1594284
## officer 0.1590262
## thanks 0.1588573
## huge 0.1585514
## nothing 0.1585409
## friday 0.1579276
## administration 0.1562820
## fast 0.1555726
## confirm 0.1550349
## market 0.1549386
## thrt 0.1547024
## pathetic 0.1540757
## big 0.1537603
## schiff 0.1535923
## learn 0.1535722
## enemy 0.1530738
## talk 0.1530064
## party 0.1528791
## partisan 0.1528147
## deep 0.1522302
## so.called 0.1521956
## primary 0.1516144
## longer 0.1514363
## nevada 0.1506096
## win 0.1503497
A 5 theme solution is made. Theme 1 talks about Protests and riots related to “Black Lives Matter” protest that started in August 2020. Theme 2 is about impeachment, senate. Theme 3 is about covid 19 pandemic, theme 4 and theme 5 are more about the investigations that white house People were inovlved in and about “Make America Great”.
components_3_theme = principal(pca_data[,5:ncol(pca_data)], nfactors = 3, rotate = 'oblimin')
dim(components_3_theme$loadings)
## [1] 923 3
loadings3 = as.data.frame(components_3_theme$loadings[1:923, 1:3])
theme1_loadings3 = subset(loadings3[order(loadings3$TC1, decreasing = T), ], TC1 >= 0.15, select = c(TC1))
theme2_loadings3 = subset(loadings3[order(loadings3$TC2, decreasing = T), ], TC2 >= 0.15, select = c(TC2))
theme3_loadings3 = subset(loadings3[order(loadings3$TC3, decreasing = T), ], TC3 >= 0.15, select = c(TC3))
print(theme1_loadings3)
## TC1
## police 0.5951028
## peaceful 0.5710970
## anarchist 0.5612035
## mayor 0.5149146
## protester 0.5013599
## law 0.5013380
## joe 0.4856708
## thug 0.4651359
## liberal 0.4618479
## order 0.4600502
## rioter 0.4562856
## black 0.4519964
## left 0.4514106
## biden 0.4494006
## silent 0.4465008
## X.mzhemingway 0.4372709
## city 0.4368367
## hurt 0.4332901
## looter 0.4315993
## raise 0.4297059
## monument 0.4225903
## church 0.4178955
## group 0.4162269
## protestor 0.4002960
## enforcement 0.3989945
## straight 0.3926842
## st 0.3899803
## violent 0.3895345
## X.thebradfordfile 0.3879791
## protest 0.3768352
## burn 0.3760508
## X.foxnew 0.3741148
## agitator 0.3723066
## radical 0.3700638
## destruction 0.3697823
## fire 0.3648812
## fall 0.3641185
## arrest 0.3602137
## mob 0.3590653
## land 0.3586773
## lie 0.3569966
## race 0.3568699
## military 0.3555940
## officer 0.3546205
## vote 0.3534519
## X3rd 0.3527558
## woman 0.3511875
## phony 0.3509657
## york 0.3485758
## november 0.3466141
## antifa 0.3452984
## shortly 0.3439078
## terrorist 0.3432804
## investigation 0.3396131
## kill 0.3389511
## beautiful 0.3376820
## majority 0.3340621
## north 0.3334481
## twitter 0.3334102
## year 0.3328074
## murder 0.3301413
## minneapolis 0.3297964
## happen 0.3287306
## big 0.3284937
## gun 0.3232012
## fighter 0.3231862
## life 0.3228352
## protect 0.3227589
## hrt 0.3223888
## jim 0.3212474
## carolina 0.3194541
## tax 0.3181629
## media 0.3174682
## vet 0.3153240
## X.maga 0.3144179
## bring 0.3128661
## ban 0.3125505
## endorsement 0.3119280
## X.joebiden 0.3110067
## election 0.3098729
## sleep 0.3090832
## nyc 0.3086651
## month 0.3063533
## trend 0.3062902
## write 0.3057993
## destroy 0.3025030
## veteran 0.3020877
## win 0.3010289
## lead 0.3000309
## serve 0.2997777
## service 0.2982267
## voice 0.2977854
## shot 0.2969605
## stand 0.2955552
## thought 0.2937407
## complete 0.2924916
## robert 0.2919763
## base 0.2911504
## choice 0.2893504
## refuse 0.2889552
## washington 0.2883020
## glad 0.2863295
## man 0.2859439
## statue 0.2845219
## governor 0.2841701
## document 0.2838447
## campaign 0.2830220
## fine 0.2830015
## chaos 0.2828438
## advocate 0.2819968
## idea 0.2809334
## ballot 0.2800253
## prison 0.2792776
## stop 0.2792621
## declassify 0.2790213
## abolish 0.2785181
## lawyer 0.2785128
## guard 0.2784721
## endorse 0.2775575
## basement 0.2768744
## barack 0.2762061
## enthusiasm 0.2727562
## amendment 0.2699515
## damage 0.2696767
## crime 0.2689937
## biden.s 0.2687647
## school 0.2684003
## rip 0.2680843
## team 0.2680492
## total 0.2679655
## true 0.2672083
## primary 0.2669106
## obama 0.2665390
## tough 0.2657659
## special 0.2642099
## portland 0.2635446
## jail 0.2632678
## america 0.2630903
## badly 0.2611366
## reduce 0.2603285
## fbi 0.2584113
## nevada 0.2583093
## read 0.2569397
## doj 0.2568794
## source 0.2560545
## imagine 0.2559862
## remember 0.2553372
## X.teamtrump 0.2547010
## place 0.2534049
## X2016 0.2525453
## job 0.2506032
## word 0.2505259
## right 0.2503267
## spy 0.2497036
## send 0.2493360
## pennsylvania 0.2491103
## michael 0.2477041
## text 0.2476189
## arm 0.2472543
## finally 0.2452545
## david 0.2445356
## voter 0.2442567
## fake 0.2433238
## play 0.2418393
## record 0.2411562
## trump 0.2410502
## X.richardgrenell 0.2408122
## X.flotus 0.2406605
## hold 0.2400399
## republican 0.2399596
## local 0.2399237
## under 0.2398625
## florida 0.2396098
## story 0.2389142
## rating 0.2387378
## project 0.2376121
## crook 0.2375673
## warren 0.2365931
## control 0.2363049
## criminal 0.2359255
## look 0.2347827
## X.trumpwarroom 0.2345072
## expect 0.2338509
## ridiculous 0.2333668
## defund 0.2320507
## admit 0.2319682
## country 0.2317536
## X.realdonaldtrump 0.2310483
## sad 0.2302585
## night 0.2295067
## player 0.2289137
## navy 0.2287170
## irt 0.2266891
## watch 0.2264760
## violence 0.2257368
## national 0.2246001
## X.donaldjtrumpjr 0.2244835
## illegal 0.2243296
## energy 0.2229823
## hillary 0.2223878
## wonderful 0.2217533
## great 0.2205915
## probe 0.2194810
## support 0.2180100
## happy 0.2177169
## people 0.2174182
## hard 0.2162507
## victory 0.2153603
## arizona 0.2152573
## elizabeth 0.2136945
## caught 0.2136230
## member 0.2126715
## arrive 0.2125339
## weak 0.2108212
## minnesota 0.2108077
## set 0.2106676
## answer 0.2100456
## speech 0.2099822
## matter 0.2095175
## mess 0.2092464
## football 0.2090339
## told 0.2089716
## historic 0.2077588
## book 0.2077401
## call 0.2071920
## chris 0.2070739
## clear 0.2068040
## pay 0.2064617
## show 0.2056672
## brave 0.2053706
## mistake 0.2051417
## forget 0.2042001
## collusion 0.2038917
## family 0.2038880
## participate 0.2033760
## lamestream 0.2032191
## yesterday 0.2022770
## troop 0.2013100
## problem 0.2012772
## seattle 0.2008905
## fully 0.2008814
## throw 0.2008108
## worst 0.2001320
## secretary 0.1986139
## cuomo 0.1984187
## report 0.1983035
## fight 0.1982077
## real 0.1974979
## champion 0.1966276
## ly 0.1958761
## citizen 0.1945768
## break. 0.1941349
## super 0.1937067
## hear 0.1936307
## respect 0.1933840
## history 0.1931016
## video 0.1926094
## create 0.1919227
## attorney 0.1916816
## X.saracarterdc 0.1915883
## restore 0.1912889
## news 0.1906734
## increase 0.1900486
## wrong 0.1899577
## X.erictrump 0.1898430
## regulation 0.1893947
## move 0.1892611
## single 0.1879786
## free 0.1875768
## cold 0.1870074
## X.2a 0.1866237
## save 0.1862966
## see 0.1860342
## power 0.1854714
## employee 0.1852648
## defend 0.1849598
## view 0.1844050
## charge 0.1842970
## mail.in 0.1833264
## ad 0.1832625
## leadership 0.1824337
## X2a 0.1813269
## department 0.1804337
## longer 0.1804038
## led 0.1802342
## honor 0.1798181
## confirm 0.1797036
## term 0.1792324
## mean 0.1791370
## official 0.1784004
## john 0.1783435
## huge 0.1782200
## nation 0.1782148
## question 0.1781893
## israel 0.1778370
## loser 0.1777464
## tremendous 0.1773007
## buy 0.1772770
## opportunity 0.1766365
## conservative 0.1765100
## terrible 0.1759697
## jame 0.1759639
## god 0.1755614
## accord 0.1753165
## elect 0.1750648
## give 0.1742742
## reporter 0.1728178
## love 0.1718627
## incredible 0.1716529
## page 0.1710652
## rig 0.1709222
## prt 0.1697105
## deal 0.1697005
## carry 0.1692509
## scam 0.1692100
## street 0.1687720
## inform 0.1684743
## candidate 0.1683154
## tom 0.1673248
## pray 0.1673146
## so.called 0.1670941
## broke 0.1667209
## congressman 0.1656620
## sure 0.1655828
## difference 0.1647731
## fund 0.1644335
## amp 0.1637653
## plant 0.1627963
## flynn 0.1627776
## border 0.1625847
## democrat 0.1621776
## corrupt 0.1617253
## thrt 0.1616231
## learn 0.1613203
## friend 0.1610192
## today 0.1609391
## healthcare 0.1607861
## wrt 0.1606088
## highly 0.1596765
## general 0.1596672
## drug 0.1595040
## drop 0.1594684
## california 0.1594185
## mask 0.1592604
## office 0.1591301
## announce 0.1589490
## chance 0.1588331
## peace 0.1582463
## russia 0.1578343
## president 0.1574810
## tire 0.1570138
## secure 0.1567169
## attack 0.1563390
## evidence 0.1560810
## state 0.1558129
## morning 0.1553758
## maga 0.1549755
## day 0.1538330
## X.cnn 0.1538311
## fast 0.1534594
## lost 0.1534210
## fail 0.1526436
## dream 0.1525609
## reject 0.1523152
## horrible 0.1520611
## low 0.1520352
## rule 0.1519677
## minute 0.1517738
## ort 0.1512245
## leave 0.1508790
## opponent 0.1506492
print(theme2_loadings3)
## TC2
## impeachment 0.6417395
## schiff 0.5654651
## corruption 0.5334089
## ukraine 0.5264763
## partisan 0.5210461
## impeach 0.5021365
## X.sentedcruz 0.4990421
## witness 0.4849789
## witch 0.4742660
## hunt 0.4742660
## trial 0.4662868
## adam 0.4662102
## article 0.4516895
## senate 0.4482913
## abuse 0.4412663
## manager 0.4310619
## hoax 0.4291698
## X.senjohnbarrasso 0.4169183
## evidence 0.4143922
## iowa 0.4062484
## X.marshablackburn 0.4032025
## dem 0.3938067
## process 0.3911760
## whistleblower 0.3883367
## page 0.3830013
## X.senatemajldr 0.3827990
## muel 0.3725060
## sen 0.3710121
## X.lindseygrahamsc 0.3703281
## thrt 0.3678798
## chairman 0.3657605
## speaker 0.3609731
## campaign 0.3513889
## X.senategop 0.3431392
## political 0.3415853
## fairness 0.3369965
## collusion 0.3338815
## case 0.3336608
## X2020 0.3324591
## legal 0.3323649
## fact 0.3322267
## X.kag2020 0.3287357
## full 0.3272008
## bernie 0.3247522
## phony 0.3191960
## foreign 0.3191887
## rally 0.3160542
## attack 0.3134906
## determine 0.3107072
## socialist 0.3094179
## spent 0.3075155
## transcript 0.3059844
## X.gopleader 0.3033778
## defeat 0.3033191
## X.danscavino 0.3032518
## history 0.3026269
## agreement 0.3008278
## talk 0.3005153
## pelosi 0.2990206
## resolution 0.2984691
## X.potus 0.2979717
## sander 0.2974924
## conservative 0.2965161
## congress 0.2946830
## friday 0.2945360
## matter 0.2933327
## info 0.2920318
## state 0.2913017
## push 0.2909962
## met 0.2886391
## X2016 0.2842920
## gop 0.2842036
## video 0.2838226
## sit 0.2833073
## john 0.2820894
## chuck 0.2820508
## wait 0.2816547
## truth 0.2807938
## nomination 0.2806848
## visit 0.2806210
## water 0.2802205
## promise 0.2799150
## schumer 0.2796284
## trump 0.2793690
## obama 0.2792845
## future 0.2786519
## question 0.2778049
## court 0.2761719
## comment 0.2737876
## entire 0.2736197
## right 0.2735582
## senator 0.2732671
## fbi 0.2727179
## power 0.2726558
## investigation 0.2721320
## iran 0.2715541
## trt 0.2706959
## poll 0.2703793
## complain 0.2694834
## judge 0.2692656
## look 0.2677447
## under 0.2665831
## ly 0.2661195
## person 0.2649169
## democrat 0.2648449
## brought 0.2635598
## clinton 0.2621840
## read 0.2610011
## agree 0.2598968
## said 0.2587011
## trade 0.2583108
## start 0.2575293
## clear 0.2567122
## win 0.2555276
## swamp 0.2530169
## claim 0.2517085
## plan 0.2496329
## election 0.2486261
## X.loudobb 0.2467650
## year 0.2460790
## huge 0.2451362
## event 0.2449434
## prove 0.2448902
## result 0.2446672
## charge 0.2438998
## private 0.2434753
## ohio 0.2428573
## lawyer 0.2428030
## week 0.2427584
## republican 0.2419740
## admit 0.2419570
## opportunity 0.2416407
## best 0.2415142
## rig 0.2403580
## hope 0.2400084
## earth 0.2364411
## hear 0.2341909
## justice 0.2340065
## scam 0.2334966
## see 0.2328459
## unemployment 0.2314651
## turn 0.2300963
## demand 0.2292674
## guy 0.2289266
## crowd 0.2268098
## nothing 0.2266661
## economy 0.2261491
## X.dbongino 0.2258371
## urge 0.2256877
## vote 0.2254666
## long 0.2248336
## angry 0.2248276
## report 0.2234208
## house 0.2232428
## tort 0.2218708
## correct 0.2206874
## elect 0.2206405
## military 0.2203385
## cover 0.2202431
## list 0.2197745
## interest 0.2193457
## X.mzhemingway 0.2176317
## corrupt 0.2148781
## policy 0.2147108
## freedom 0.2136752
## document 0.2131113
## american 0.2120926
## grow 0.2119298
## fight 0.2115326
## break. 0.2108854
## comey 0.2083437
## deliver 0.2073917
## dream 0.2073040
## lie 0.2072385
## trust 0.2068210
## voter 0.2063636
## fisa 0.2057747
## general 0.2047931
## aid 0.2036922
## mike 0.2034075
## learn 0.2030854
## side 0.2029055
## president 0.2024997
## X.scavino45 0.2022359
## X.jim_jordan 0.2021861
## attempt 0.2019819
## hillary 0.2016856
## americas 0.2015862
## allow 0.2010220
## absolutely 0.2007680
## administration 0.2004901
## statement 0.2002962
## incompetent 0.1998774
## inrt 0.1995513
## consider 0.1988957
## progress 0.1983696
## bloomberg 0.1981361
## nancy 0.1974702
## low 0.1957322
## serve 0.1946585
## leader 0.1942778
## join 0.1937820
## X.thehill 0.1935131
## straight 0.1928939
## terrific 0.1926122
## successful 0.1922973
## significant 0.1918712
## tonight 0.1914620
## intelligence 0.1911490
## russia 0.1907145
## effort 0.1906412
## interview 0.1906052
## chief 0.1905975
## commit 0.1904565
## amaze 0.1903736
## target 0.1898757
## party 0.1896958
## central 0.1896322
## X.ivankatrump 0.1890943
## daily 0.1888762
## work 0.1876468
## double 0.1856716
## mess 0.1855867
## economic 0.1851776
## leak 0.1850998
## supreme 0.1850807
## past 0.1843987
## X.dailycaller 0.1842258
## hunter 0.1841991
## clean 0.1840587
## wrong 0.1838591
## hrt 0.1838513
## release 0.1834579
## cnn 0.1833067
## unite 0.1814505
## fair 0.1786858
## spend 0.1785801
## remember 0.1782903
## attorney 0.1780503
## country 0.1771039
## speech 0.1765570
## russian 0.1763311
## politician 0.1761813
## continue 0.1736075
## finish 0.1730043
## imagine 0.1724774
## give 0.1719640
## innocent 0.1715753
## focus 0.1713868
## book 0.1712589
## launch 0.1710693
## watch 0.1710526
## beat 0.1700939
## story 0.1696084
## thank 0.1688545
## standard 0.1688162
## thert 0.1684060
## X.tomfitton 0.1682712
## play 0.1679621
## deal 0.1671099
## month 0.1654761
## discuss 0.1651021
## blow 0.1650527
## high 0.1637372
## key 0.1636984
## control 0.1630487
## X95 0.1624834
## X.maga 0.1624443
## air 0.1608870
## donald 0.1607871
## follow 0.1606917
## happen 0.1606778
## destroy 0.1605520
## farmer 0.1601334
## point 0.1596745
## unfair 0.1587386
## california 0.1580653
## time 0.1580207
## coup 0.1579137
## company 0.1573129
## job 0.1569502
## money 0.1562242
## reject 0.1553195
## crime 0.1537768
## official 0.1525611
## honor 0.1522476
## pack 0.1513943
## cost 0.1513655
print(theme3_loadings3)
## TC3
## response 0.5367477
## X.covid19 0.5327683
## wrt 0.4712666
## coronavirus 0.4659893
## paycheck 0.4609516
## pandemic 0.4587124
## phase 0.4558031
## irt 0.4297031
## X.cdcgov 0.4278067
## X.coronavirus 0.4142961
## prevent 0.4120023
## affect 0.4119099
## program 0.4112932
## provide 0.4031372
## outbreak 0.4025528
## nurse 0.4002914
## press 0.3976058
## treatment 0.3927744
## emergency 0.3903641
## crisis 0.3824425
## X.senjohnbarrasso 0.3754613
## X.senatemajldr 0.3737710
## care 0.3727720
## supply 0.3721361
## tort 0.3679031
## significant 0.3657742
## force 0.3623996
## task 0.3606412
## business 0.3534380
## important 0.3493054
## spoke 0.3478920
## hospital 0.3474918
## pass 0.3455944
## expand 0.3405548
## protection 0.3398143
## critical 0.3386448
## americas 0.3323840
## ensure 0.3298577
## health 0.3268248
## spread 0.3252512
## live 0.3243099
## handle 0.3224103
## together 0.3222457
## covid 0.3212187
## bill 0.3204152
## resource 0.3198828
## action 0.3165779
## issue 0.3124332
## thert 0.3116815
## challenge 0.3112530
## test 0.3110196
## cure 0.3109469
## inrt 0.3104323
## sen 0.3086543
## today 0.3074061
## doctor 0.3069157
## combat 0.3042857
## conference 0.3016325
## learn 0.3012993
## X.potus 0.2979184
## distance 0.2944987
## participate 0.2928940
## prt 0.2922202
## defense 0.2878296
## simple 0.2859351
## light 0.2842307
## close 0.2817464
## food 0.2802920
## federal 0.2784854
## X.whitehouse 0.2754934
## director 0.2752062
## view 0.2745490
## visit 0.2741797
## slow 0.2702887
## hero 0.2698014
## ort 0.2697831
## rule 0.2695642
## X.senategop 0.2688338
## step 0.2666802
## employee 0.2666075
## prevail 0.2660497
## arm 0.2642552
## save 0.2634016
## increase 0.2633193
## medical 0.2614529
## industry 0.2612275
## chairman 0.2603963
## early 0.2599350
## social 0.2571516
## amaze 0.2564307
## american 0.2532360
## truth 0.2522683
## excite 0.2521937
## virus 0.2505136
## day 0.2486793
## standard 0.2459238
## sign 0.2455809
## decision 0.2440389
## center 0.2429972
## give 0.2421668
## stay 0.2418685
## damage 0.2416736
## claim 0.2416592
## risk 0.2400142
## daily 0.2386166
## government 0.2359908
## worker 0.2358933
## enemy 0.2356049
## hand 0.2345185
## small 0.2337270
## nation 0.2331328
## delay 0.2315716
## worse 0.2313373
## safety 0.2309195
## treat 0.2283894
## private 0.2278488
## focus 0.2263702
## traffic 0.2254043
## clean 0.2248565
## pray 0.2237100
## review 0.2236037
## safely 0.2216278
## family 0.2215357
## news 0.2212577
## local 0.2206106
## appreciate 0.2205154
## community 0.2204010
## troop 0.2193718
## join 0.2193424
## trt 0.2176309
## infrastructure 0.2172854
## ventilator 0.2151048
## travel 0.2143147
## plan 0.2124356
## house 0.2116993
## fund 0.2112695
## information 0.2103712
## homeland 0.2097219
## sick 0.2087558
## work 0.2082125
## thanks 0.2079884
## longer 0.2066145
## alone 0.2057516
## declassify 0.2055290
## brilliant 0.2048101
## middle 0.2046781
## better 0.2044935
## chinese 0.2041857
## operation 0.2026621
## protestor 0.2017858
## professional 0.2005981
## colorado 0.2005427
## dr 0.1990055
## week 0.1983176
## continue 0.1963803
## seeing 0.1958403
## vaccine 0.1956190
## listen 0.1948561
## glad 0.1948231
## ny 0.1940483
## navy 0.1940338
## secretary 0.1938953
## violent 0.1932895
## partner 0.1930957
## meet 0.1920909
## effort 0.1916732
## free 0.1914899
## urge 0.1908783
## announce 0.1906281
## face 0.1894403
## economic 0.1894147
## official 0.1883101
## add 0.1882770
## conversation 0.1881066
## receive 0.1872664
## support 0.1872213
## citizen 0.1870711
## communist 0.1867058
## successful 0.1863662
## additional 0.1861027
## job 0.1860892
## follow 0.1856691
## forget 0.1841601
## correct 0.1839980
## surge 0.1839604
## move 0.1824713
## late 0.1806969
## reason 0.1803904
## potus 0.1802982
## ship 0.1802450
## X.greggjarrett 0.1802336
## violence 0.1802269
## list 0.1793564
## impact 0.1788416
## update 0.1776652
## medicare 0.1771480
## X.tomfitton 0.1761901
## individual 0.1748254
## voice 0.1746821
## advance 0.1734429
## white 0.1732533
## project 0.1731007
## safe 0.1725627
## high 0.1703741
## involve 0.1700236
## death 0.1699651
## mexico 0.1699104
## car 0.1688950
## discuss 0.1680351
## tonight 0.1679117
## student 0.1670444
## led 0.1665595
## office 0.1649178
## oval 0.1649133
## massive 0.1648328
## officer 0.1641278
## cost 0.1639213
## trust 0.1635021
## time 0.1634742
## production 0.1633566
## power 0.1633506
## football 0.1626089
## stop 0.1618586
## america 0.1618484
## young 0.1610273
## develop 0.1608991
## past 0.1602385
## hard 0.1600549
## opportunity 0.1599122
## protect 0.1596612
## rt 0.1584985
## commit 0.1583657
## service 0.1577408
## extraordinary 0.1574500
## economy 0.1569730
## blow 0.1560121
## rebuild 0.1555798
## answer 0.1553650
## address 0.1538267
## change 0.1519387
## event 0.1501058
A 3 theme solution is made to compare which of the two models-5 theme or 3 theme would best suit.
fa.stats(pca_data[,5:ncol(pca_data)], f = components)$rms
## [1] 0.07331245
fa.stats(pca_data[,5:ncol(pca_data)], f = components_3_theme)$rms
## [1] 0.07566455
fa.stats(pca_data[,5:ncol(pca_data)], f = components)$RMSEA
## RMSEA lower upper confidence
## 0.00 0.00 0.00 0.95
fa.stats(pca_data[,5:ncol(pca_data)], f = components_3_theme)$RMSEA
## RMSEA lower upper confidence
## 0.00 0.00 0.00 0.95
fa.stats(pca_data[,5:ncol(pca_data)], f = components)$TLI
## [1] 0.2427993
fa.stats(pca_data[,5:ncol(pca_data)], f = components_3_theme)$TLI
## [1] 0.2139612
5 Themed solutions seems to be a better solution as the Tucker Lewis Index is closer to 1
pca_data$Theme1_loadings5 = apply(pca_data[, row.names(theme1_loadings5)], MARGIN = 1, sum)
pca_data$Theme2_loadings5 = apply(pca_data[, row.names(theme2_loadings5)], MARGIN = 1, sum)
pca_data$Theme3_loadings5 = apply(pca_data[, row.names(theme3_loadings5)], MARGIN = 1, sum)
pca_data$Theme4_loadings5 = apply(pca_data[, row.names(theme4_loadings5)], MARGIN = 1, sum)
pca_data$Theme5_loadings5 = apply(pca_data[, row.names(theme5_loadings5)], MARGIN = 1, sum)
pca_data$Theme1_loadings3 = apply(pca_data[, row.names(theme1_loadings3)], MARGIN = 1, sum)
pca_data$Theme2_loadings3 = apply(pca_data[, row.names(theme2_loadings3)], MARGIN = 1, sum)
pca_data$Theme3_loadings3 = apply(pca_data[, row.names(theme3_loadings3)], MARGIN = 1, sum)
summary(pca_data$Theme1_loadings5)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 6.00 19.00 29.00 34.19 40.50 129.00
summary(pca_data$Theme2_loadings5)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 7.00 22.00 35.00 39.42 48.00 210.00
summary(pca_data$Theme3_loadings5)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 1.0 19.0 30.0 32.3 39.0 151.0
summary(pca_data$Theme4_loadings5)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 4.00 22.00 35.00 39.66 50.00 113.00
summary(pca_data$Theme5_loadings5)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 3.00 24.00 36.00 40.26 50.00 122.00
summary(pca_data$Theme1_loadings3)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 14.00 41.50 60.00 67.11 84.00 202.00
summary(pca_data$Theme2_loadings3)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 5.0 29.0 46.0 50.1 65.0 225.0
summary(pca_data$Theme3_loadings3)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 3.00 20.50 32.00 36.51 46.00 187.00
pca_data$DATE <- as.Date(pca_data$DATE)
tweets_index$DATE <- as.Date(tweets_index$DATE)
tweets_index_themeScore <-
merge(x = pca_data,
y = tweets_index,
by = "DATE")
correlation <- cor.test(tweets_index_themeScore$WILL5000PRFC, tweets_index_themeScore$Theme1_loadings5)
correlation
##
## Pearson's product-moment correlation
##
## data: tweets_index_themeScore$WILL5000PRFC and tweets_index_themeScore$Theme1_loadings5
## t = 4.3585, df = 185, p-value = 2.169e-05
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
## 0.1690660 0.4298283
## sample estimates:
## cor
## 0.3051563
cor.test(tweets_index_themeScore$WILL5000PRFC, tweets_index_themeScore$Theme2_loadings5)
##
## Pearson's product-moment correlation
##
## data: tweets_index_themeScore$WILL5000PRFC and tweets_index_themeScore$Theme2_loadings5
## t = 3.3663, df = 185, p-value = 0.0009264
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
## 0.1002098 0.3709534
## sample estimates:
## cor
## 0.2402484
cor.test(tweets_index_themeScore$WILL5000PRFC, tweets_index_themeScore$Theme3_loadings5)
##
## Pearson's product-moment correlation
##
## data: tweets_index_themeScore$WILL5000PRFC and tweets_index_themeScore$Theme3_loadings5
## t = -5.1586, df = 185, p-value = 6.371e-07
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
## -0.4739923 -0.2224442
## sample estimates:
## cor
## -0.3546183
cor.test(tweets_index_themeScore$WILL5000PRFC, tweets_index_themeScore$Theme4_loadings5)
##
## Pearson's product-moment correlation
##
## data: tweets_index_themeScore$WILL5000PRFC and tweets_index_themeScore$Theme4_loadings5
## t = 2.0144, df = 185, p-value = 0.04542
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
## 0.003072662 0.284023844
## sample estimates:
## cor
## 0.1465013
cor.test(tweets_index_themeScore$WILL5000PRFC, tweets_index_themeScore$Theme5_loadings5)
##
## Pearson's product-moment correlation
##
## data: tweets_index_themeScore$WILL5000PRFC and tweets_index_themeScore$Theme5_loadings5
## t = 1.5244, df = 185, p-value = 0.1291
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
## -0.03263741 0.25086147
## sample estimates:
## cor
## 0.1113775
cor.test(tweets_index_themeScore$WILL5000PRFC, tweets_index_themeScore$Theme1_loadings3)
##
## Pearson's product-moment correlation
##
## data: tweets_index_themeScore$WILL5000PRFC and tweets_index_themeScore$Theme1_loadings3
## t = 3.7478, df = 185, p-value = 0.0002383
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
## 0.1269924 0.3941152
## sample estimates:
## cor
## 0.265645
cor.test(tweets_index_themeScore$WILL5000PRFC, tweets_index_themeScore$Theme2_loadings3)
##
## Pearson's product-moment correlation
##
## data: tweets_index_themeScore$WILL5000PRFC and tweets_index_themeScore$Theme2_loadings3
## t = 3.3133, df = 185, p-value = 0.001109
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
## 0.09645951 0.36768303
## sample estimates:
## cor
## 0.2366768
cor.test(tweets_index_themeScore$WILL5000PRFC, tweets_index_themeScore$Theme3_loadings3)
##
## Pearson's product-moment correlation
##
## data: tweets_index_themeScore$WILL5000PRFC and tweets_index_themeScore$Theme3_loadings3
## t = -3.6686, df = 185, p-value = 0.0003188
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
## -0.3893563 -0.1214576
## sample estimates:
## cor
## -0.2604123
A cor test is made to check the correlation between the pca themes and stock price. There exists a weak positive correlation between Theme1 and stock prices and a weak negative correlation between Theme 3 and stock price. Theme1 is about Black Lives Matter protests and Theme 3 is about COVID. Hence it can be seen that president’s tweets about Black Lives Matter has had a positive impact on stock market price and at the same time, tweets about COVID had had a negative impact on stock market price.
correlation$p.value
## [1] 2.169362e-05
correlation$estimate
## cor
## 0.3051563
ggscatter(tweets_index_themeScore, y ="WILL5000PRFC", x="Theme1_loadings5", add="reg.line",conf.int = TRUE, cor.coef = TRUE, cor.method = "pearson", xlab="Tweets", ylab="Stock market index")
## `geom_smooth()` using formula 'y ~ x'
A correlation plot is made between the PCA themes and stock market price. A p value <0.05 indicates that there exists a correlation between president’s tweets and stock market price.
tweet_corpus = Corpus(VectorSource(tweets_index$text))
tweet_matrix = DocumentTermMatrix(
tweet_corpus,
control = list(
stemming = TRUE,
stopwords = TRUE,
minWordLength = 3,
removeNumbers = TRUE,
removePunctuation = TRUE
)
)
tweet_weight = tapply(tweet_matrix$v / row_sums(tweet_matrix)[tweet_matrix$i],
tweet_matrix$j,
mean) * log2(nDocs(tweet_matrix) / col_sums(tweet_matrix > 0))
tweet_matrix = tweet_matrix[row_sums(tweet_matrix) > 0, ]
K = 10
SEED = 42
LDA_fit = LDA(tweet_matrix, k = K,
control = list(seed = SEED))
LDA_fixed = LDA(tweet_matrix,
k = K,
control = list(estimate.alpha = FALSE, seed = SEED))
LDA_gibbs = LDA(
tweet_matrix,
k = K,
method = "Gibbs",
control = list(
seed = SEED,
burnin = 1000,
thin = 100,
iter = 1000
)
)
CTM_fit = CTM(tweet_matrix,
k = K,
control = list(
seed = SEED,
var = list(tol = 10 ^ -4),
em = list(tol = 10 ^ -3)
))
terms(LDA_fit, K)
## Topic 1 Topic 2 Topic 3 Topic 4
## [1,] "will" "will" "realdonaldtrump" "realdonaldtrump"
## [2,] "realdonaldtrump" "coronavirus" "presid" "presid"
## [3,] "presid" "amp" "amp" "will"
## [4,] "great" "american" "great" "great"
## [5,] "amp" "whitehous" "will" "peopl"
## [6,] "biden" "realdonaldtrump" "peopl" "trump"
## [7,] "joe" "covid" "trump" "democrat"
## [8,] "peopl" "work" "whitehous" "amp"
## [9,] "whitehous" "presid" "american" "just"
## [10,] "american" "today" "support" "biden"
## Topic 5 Topic 6 Topic 7 Topic 8
## [1,] "will" "realdonaldtrump" "will" "will"
## [2,] "amp" "will" "total" "amp"
## [3,] "presid" "presid" "complet" "great"
## [4,] "realdonaldtrump" "biden" "great" "democrat"
## [5,] "trump" "joe" "endors" "presid"
## [6,] "great" "trump" "realdonaldtrump" "peopl"
## [7,] "state" "great" "amp" "now"
## [8,] "nation" "amp" "strong" "realdonaldtrump"
## [9,] "new" "peopl" "amend" "state"
## [10,] "get" "democrat" "second" "thank"
## Topic 9 Topic 10
## [1,] "will" "democrat"
## [2,] "trump" "presid"
## [3,] "presid" "impeach"
## [4,] "amp" "realdonaldtrump"
## [5,] "great" "trump"
## [6,] "realdonaldtrump" "senat"
## [7,] "news" "will"
## [8,] "just" "amp"
## [9,] "biden" "american"
## [10,] "state" "hous"
terms(LDA_fixed, K)
## Topic 1 Topic 2 Topic 3 Topic 4
## [1,] "will" "will" "realdonaldtrump" "realdonaldtrump"
## [2,] "realdonaldtrump" "coronavirus" "presid" "presid"
## [3,] "presid" "whitehous" "amp" "will"
## [4,] "great" "american" "great" "great"
## [5,] "biden" "covid" "peopl" "trump"
## [6,] "joe" "amp" "will" "whitehous"
## [7,] "amp" "work" "whitehous" "peopl"
## [8,] "peopl" "nation" "america" "news"
## [9,] "rate" "today" "support" "fund"
## [10,] "whitehous" "help" "american" "just"
## Topic 5 Topic 6 Topic 7 Topic 8 Topic 9
## [1,] "will" "realdonaldtrump" "total" "will" "will"
## [2,] "amp" "presid" "complet" "amp" "trump"
## [3,] "presid" "will" "will" "great" "presid"
## [4,] "trump" "joe" "endors" "democrat" "amp"
## [5,] "state" "biden" "great" "want" "news"
## [6,] "great" "trump" "strong" "now" "just"
## [7,] "court" "great" "amp" "thank" "great"
## [8,] "new" "amp" "support" "peopl" "now"
## [9,] "vote" "teamtrump" "amend" "state" "biden"
## [10,] "suprem" "peopl" "second" "never" "fake"
## Topic 10
## [1,] "democrat"
## [2,] "impeach"
## [3,] "presid"
## [4,] "realdonaldtrump"
## [5,] "senat"
## [6,] "trump"
## [7,] "hous"
## [8,] "schiff"
## [9,] "american"
## [10,] "will"
terms(LDA_gibbs, K)
## Topic 1 Topic 2 Topic 3 Topic 4 Topic 5 Topic 6
## [1,] "total" "coronavirus" "will" "democrat" "citi" "trump"
## [2,] "great" "will" "peopl" "senat" "nation" "year"
## [3,] "complet" "work" "feder" "hous" "polic" "obama"
## [4,] "amp" "covid" "fund" "impeach" "left" "break"
## [5,] "strong" "help" "state" "presid" "law" "fbi"
## [6,] "endors" "american" "done" "american" "biden" "flynn"
## [7,] "support" "whitehous" "one" "schiff" "radic" "general"
## [8,] "will" "today" "million" "gop" "must" "know"
## [9,] "border" "get" "great" "dem" "now" "campaign"
## [10,] "militari" "act" "move" "case" "washington" "get"
## Topic 7 Topic 8 Topic 9 Topic 10
## [1,] "news" "biden" "will" "realdonaldtrump"
## [2,] "peopl" "trump" "amp" "presid"
## [3,] "fake" "joe" "state" "whitehous"
## [4,] "want" "elect" "dont" "american"
## [5,] "amp" "vote" "thank" "great"
## [6,] "just" "will" "want" "america"
## [7,] "new" "ballot" "way" "teamtrump"
## [8,] "media" "just" "noth" "live"
## [9,] "never" "republican" "democrat" "countri"
## [10,] "like" "order" "happen" "will"
terms(CTM_fit, K)
## Topic 1 Topic 2 Topic 3 Topic 4
## [1,] "impeach" "presid" "realdonaldtrump" "realdonaldtrump"
## [2,] "democrat" "realdonaldtrump" "presid" "presid"
## [3,] "presid" "will" "will" "amp"
## [4,] "realdonaldtrump" "biden" "trump" "will"
## [5,] "senat" "joe" "great" "peopl"
## [6,] "hous" "amp" "state" "state"
## [7,] "schiff" "american" "whitehous" "new"
## [8,] "amp" "ballot" "flynn" "american"
## [9,] "will" "peopl" "peopl" "want"
## [10,] "american" "vote" "new" "great"
## Topic 5 Topic 6 Topic 7 Topic 8
## [1,] "presid" "will" "amp" "will"
## [2,] "amp" "coronavirus" "will" "trump"
## [3,] "realdonaldtrump" "realdonaldtrump" "biden" "presid"
## [4,] "will" "amp" "trump" "biden"
## [5,] "trump" "whitehous" "job" "peopl"
## [6,] "news" "presid" "realdonaldtrump" "realdonaldtrump"
## [7,] "great" "american" "great" "usdot"
## [8,] "year" "work" "american" "state"
## [9,] "just" "great" "presid" "now"
## [10,] "peopl" "peopl" "now" "feder"
## Topic 9 Topic 10
## [1,] "will" "great"
## [2,] "nation" "will"
## [3,] "great" "realdonaldtrump"
## [4,] "amp" "amp"
## [5,] "senat" "presid"
## [6,] "feder" "democrat"
## [7,] "american" "thank"
## [8,] "presid" "peopl"
## [9,] "today" "republican"
## [10,] "job" "whitehous"
Based on the topics it could be seen that the president tweets were predominantly based on “Make America great” followed by “The Pandemic”.
We have been able to analyze if president’s tweets against influence stock market using topics and wilshire. Our result reflected that the correlation between themes extract against stock price trends is relatively significant. As Covid-19 is expected to be on-going and unpredictable, being able to analysis and predict the impact of tweets sentiment against stock market trend will help investors understand stock trends and make long-term investment decisions. The future steps of our study will be to analyze if the tweets influence a specific type of stocks.Theme 1 from 5 theme solution seems to cover black lives matter protests. Black lives matter related tweets by the US president seems to have weak positive correlation with stock market index. However, Presidential tweets between January 1st till the end of day September 30th are mostly about make America great again and white house, don’t seem to have stronger influence on stock market. Covid related tweets are negatively correlated with the stock market index.
If working in a group, specify what each member of the group did. For each of the steps below, specify who did the work. If more than one member worked on the step, put names of everyone who worked on it.
Staines, J. (2015). Mining Text and Time Series Data with Applications in Finance (Doctoral dissertation, UCL (University College London)).
Nguyen, T. H., & Shirai, K. (2015, July). Topic modeling based sentiment analysis on social media for stock market prediction. In Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing (Volume 1: Long Papers) (pp. 1354-1364).
Rao, Y., Li, Q., Mao, X., & Wenyin, L. (2014). Sentiment topic models for social emotion mining. Information Sciences, 266, 90-100.
Zainuddin, N., Selamat, A., & Ibrahim, R. (2018). Hybrid sentiment classification on twitter aspect-based sentiment analysis. Applied Intelligence, 48(5), 1218-1232.
Vinodhini, G., & Chandrasekaran, R. M. (2013). Effect of feature reduction in sentiment analysis of online reviews. International Journal of Advanced Research in Computer Engineering & Technology (IJARCET), 2(6), 2165-2172.
Balahur, A. (2013, June). Sentiment analysis in social media texts. In Proceedings of the 4th workshop on computational approaches to subjectivity, sentiment and social media analysis (pp. 120-128).
Paltoglou, G. (2014). Sentiment analysis in social media. In Online Collective Action (pp. 3-17). Springer, Vienna.
Sarlan, A., Nadam, C., & Basri, S. (2014, November). Twitter sentiment analysis. In Proceedings of the 6th International conference on Information Technology and Multimedia (pp. 212-216). IEEE.
Nemes, L., & Kiss, A. (2020). Social media sentiment analysis based on COVID-19. Journal of Information and Telecommunication, 1-15.
Yin, H., Yang, S., & Li, J. (2020). Detecting topic and sentiment dynamics due to COVID-19 pandemic using social media. arXiv preprint arXiv:2007.02304.