Including codes and data for the Summer 2020 Python Project.
The name of Project is Wag the Dog’ Media: Does the President Distract the Public When Issuing Executive Orders?"
Files Included:
- Scrapes all presidential orders from https://www.presidency.ucsb.edu by
- its content,
- issue no,
- issue date, and
- url since the presidentcy of Donald Trump.
- Created by \gencer_ExecutiveOrderScraping.py after scraping.
- Downloaded from http://www.trumptwitterarchive.com/
- Over 24 thousand Trump tweets, each tweet includes
- content
- number of likes
- numbe of retweets
- Preprocesses executive orders.
- Creates the beginning and end dates of 1,3,5,7,11, and 15 days intervals around the executive orders
- Applies these intervals to \gencer_TrumpTweets.csv
- Processed version by \preprocessing_exeorder.py that includes
- Intervals and Search Term results.
- Downloads nltk Twitter corpus data to train a logistic function for sentiment analysis (5000positive \ 5000negative)
- Trains a logistic regression based on the training data (the code from Coursera course: Natural Language Processing).
- Preprocesses each Trump tweet by
- removing stop words,
- removing punctuations,
- stemming and tokenizing (the code from Coursera course: Natural Language Processing).
- Predicts the sentiment scores of each tweet
- Processed version by \sentiment_analysis_for_tweets.py that includes
- Sentiment Score of each Tweet
- Runs the linear regressions
- Creates figures with estimates and confidence intervals
- Presentation of the Python project
- Includes all figures created by \dataanalysis_gencer.Rmd for the project.
- all in .jpg format.