Analysis of Trump’s Tweet Source

Lucy D’Agostino McGowan

12/6/2016









Android









iPhone









based on simple sentiment analysis





based on simple sentiment analysis

univariate Poisson regression





NRC Emotion Lexicon

word sentiment
abandon negative
abandoned negative
abandonment negative
abba positive
abduction negative
aberrant negative
aberration negative
abhor negative
abhorrent negative
ability positive









439 from the iPhone




349 from the Android

Hashtag Use

Time of tweets

Number of Negative Words

Proposed Models

Model 1

\(y_i \sim\textrm{Poisson} (\mu_i)\)

\(\mu_i \sim \exp(\beta_0+\color{lightgreen}\beta_\color{lightgreen}1\times \textrm{source}+\beta_2\times \textrm{time} + \beta_3 \times \textrm{hashtag} + \textrm{offset})\)

\(\beta_j\sim \textrm{Normal}(a, b)\)

Proposed Models

Model 2

\(y_k\sim\textrm{Bernoulli}(p_k)\)

\(\textrm{logit}(p_k) = \alpha_i+\beta_0+\color{lightgreen}\beta_\color{lightgreen}1\times\textrm{source}+\beta_2\times \textrm{time}+\beta_3\times\textrm{hashtag}\)

\(\alpha_i\sim\textrm{Normal}(0,\tau)\)

\(\tau\sim\textrm{Gamma}(0.001,0.001)\)

Priors

Flat: Normal(0,1e6)

Skeptical: Normal(-2,1)

Optimistic: Normal(2,1)

Results

Poisson Model

mean sd 2.5% 25% 50% 75% 97.5% Rhat n.eff
beta 1 (source: Android) 0.1789621 0.0813651 1.95485e-02 0.123875 0.1782 0.2337 0.3382025 1.000989 15000
deviance 1695.2528000 2.8215757 1.69200e+03 1693.000000 1695.0000 1697.0000 1702.0000000 1.001589 2900




Mixed-effects Model

mean sd 2.5% 25% 50% 75% 97.5% Rhat n.eff
beta 1 (source: Android) 0.3805776 0.1349299 0.1166 0.2904 0.3812 0.471625 0.64283 1.001756 2300
deviance 2092.3568667 45.0809723 2002.9750 2062.0000 2094.0000 2124.000000 2178.00000 1.008192 310

Poisson Model

Mixed Effects Model

Poisson Model Gelman Plot

This shows the shink factor as the number of iterations increases. A factor of 1 means the the between and within chain variances are equal, factors greater than 1 indicate that there are differences between chains.

Mixed-effects Model Gelman Plot

This shows the shink factor as the number of iterations increases. A factor of 1 means the the between and within chain variances are equal, factors greater than 1 indicate that there are differences between chains.




POISSON MODEL!



Frequentist Model



term estimate std.error statistic p.value
(Intercept) -1.0605161 0.1060808 -9.997249 0.0000000
Android 0.1784824 0.0812016 2.198016 0.0279480
time 0.0110638 0.0057287 1.931281 0.0534483
hashtag -0.1254822 0.1170869 -1.071702 0.2838541

Priors



Conclusions

A tweet sent from an Android increases the expectation of the number of negative words in the tweet by a factor of 1.2, with a 95% Credible interval of (1.02, 1.4) as compared to one sent from an iPhone, adjusting for the time of day the tweet was sent, whether the tweet included a hashtag, and the number of classified words in the tweet.