Preliminary Analyses

Menu

Loading wiki pages...

View
Wiki Version:
<h1>Guide to Preliminary Analyses</h1> <p>The Preliminary Analyses consist of a set of analyses that duplicate the workflow we plan for the main analyses outlined in the registered reports, but were performed using convenience samples and predicting sentiment of tweets (rather than the self-reported mental health variables we plan to study in the registered report).</p> <p>The folder titled "Preliminary Analyses" should have everything you need to duplicate the analyses described in the registered report. It consists of four folders. The <strong>data</strong> folder contains the data files used in the preliminary analyses. The <strong>lexicons</strong> folder contains the sentiment and emotion lexicons used to score tweets (<em>note: Only sentiment is looked at in the preliminary analyses</em>). The <strong>scripts</strong> folder contains the R code for the analyses, processing the tweets (to score sentiment and emotion), and the a knitted pdf from the script use to gather one of the samples (the others are not in a shareable state as they currently contain my Twitter authentication information).</p> <p>The scripts all use relative paths, so you should be able to download the whole folder and start running the scripts (as long as you preserve the folder's structure as it is currently). More information about the contents of each is provided below. There is a consisten naming format that will help you navigate it, which is the following:</p> <h2>Background on data</h2> <p>Data were downloaded from Twitter's API using a combination of <a href="https://cran.r-project.org/web/packages/twitteR/README.html" rel="nofollow">twitteR (Gentry, 2015)</a> and <a href="https://rtweet.info/" rel="nofollow">rtweet (Kearney, 2018)</a>. There are ultimately three samples:</p> <ol> <li><strong>Costello seed</strong><ul> <li>A sample of users from my own two-step friend network (i.e., my friends' friends).</li> </ul> </li> <li><strong>Obama & Trump Seed</strong> <ul> <li>A sample of users that follow Obama or Trump (randomly sampled followers of each).</li> <li>Note, the data folder contains a filtered (filtered to have 25+ tweets) and non-filtered versions.</li> </ul> </li> <li><strong>'New' 10 Seed</strong><ul> <li>Followers sampled from 10 different popular accounts:</li> <li>‘@joelembiid’, ‘@katyperry’, ‘@jimmyfallon’, ‘@billgates’, ‘@oprah’, ‘@kevinheart4real’, ‘@wizkhalifa’, ‘@adele’, ‘@nba’, and ‘@nfl’</li> </ul> </li> </ol> <p>A knitted pdf from collecting the third sample is in the scripts folder <a href="https://osf.io/3wtne/" rel="nofollow">here</a></p> <p>I attempted to download two things from the API for each of these samples: 1. Each user's friends list 2. Each user's timeline of tweets</p> <p>Users' tweets were scored for sentiment and emotion based on sentiment and emotion lexicons developed for Twitter by <a href="http://doi.org/10.1111/coin.12024" rel="nofollow">Mohammad & Kiritchenko (2015)</a>. The lexicons can be seen in the lexicon folder, and the script for cleaning/processing and scoring the tweets are in the scripts folder (see below)</p> <h1>Data</h1> <p>The data folder contains several datasets. Names should be relatively self-explanatory, but the logic of the filenames is as follows:</p> <ul> <li>They all start with their sample name. So any file that starts with <strong>costello_seed</strong> is from that sample.</li> <li>Files with <strong>timelines_df</strong> in the name contain the raw, unprocessed tweet/timeline data.</li> <li>Files with <strong>processed tweets</strong> in the name contain scored tweets (for each user available in that sample).</li> <li>filenames with <strong>friends</strong> or <strong>Users_friends</strong> in the name should have user-friend edgelist. Couple things to note here:</li> <li>The Costello & Obama/Trump seed sample have a single friends/user-friends dataframe; this also contains friend information (including their name/handle).</li> <li>The new 10seed sample was collected using slightly different functions, so it has 2 files. One has just friend id's (numeric id's) and usernames, and the other (that ends with 'friend_info') has the friend information (including thei name/handle)</li> </ul> <h1>Lexicons</h1> <p>This folder contains two lexicons, both from <a href="http://doi.org/10.1111/coin.12024" rel="nofollow">Mohammad & Kiritchenko (2015)</a>, downloaded from the <a href="https://saifmohammad.com/WebPages/lexicons.html" rel="nofollow">first author's website</a> 1. <a href="https://osf.io/gjmwx/" rel="nofollow">Hashtag Sentiment Lexicon</a> * titled: "HS-unigrams.txt" 2. <a href="[https://osf.io/6gjcw/]" rel="nofollow">Hashtag Emotion Lexicon</a></p> <h1>Plots</h1> <p>This folder just contains the two plots (of training performance) that are saved out by the predictive modeling scripts. Note that if you download this set of folders and run either predictive modeling script (unmodified), you will overwrite the plots. However, if you don't modify the scripts, they should be identical to the originals.</p> <h1>Scripts</h1> <p>This folder contains scripts (and knitted pdf & html documents) for the preliminary analyses. Those scripts and knitted documents correspond to the following.</p> <h2>Downloading API DAta</h2> <ul> <li>Only available (currently) for new 10 seed sample, and only available as <a href="https://osf.io/3wtne/" rel="nofollow">PDF</a></li> </ul> <h2>Processing & Scoring Tweets</h2> <ul> <li>Scoring Tweets for <strong>Costello Seed Sample</strong> <a href="https://osf.io/tg8qs/" rel="nofollow">RMD</a> and <a href="https://osf.io/hf59t/" rel="nofollow">PDF</a> </li> <li>Scoring Tweets for <strong>Obama/Trump Seed Sample</strong> <a href="https://osf.io/nsm5y/" rel="nofollow">RMD</a> and <a href="https://osf.io/d2xwt/" rel="nofollow">PDF</a></li> <li>Scoring Tweets for <strong>New 10 Seed Sample</strong> <a href="https://osf.io/vgj53/" rel="nofollow">RMD</a> and <a href="https://osf.io/9aqmf/" rel="nofollow">html</a></li> </ul> <h2>Predicting Sentiment from Friends</h2> <ul> <li>Predictive Modeling for <strong>combined Costello & Obama/Trump seed</strong></li> <li>Referred to as <em>initial samples</em> in manuscript</li> <li><a href="https://osf.io/2z9jh/" rel="nofollow">RMD</a> & <a href="https://osf.io/xk2zt/" rel="nofollow">HTML</a></li> <li>Predictive Modeling for <strong>New 10 seed Sample</strong></li> <li>Referred to as <em>replication sample</em> in manuscript</li> <li><a href="https://osf.io/mzk4e/" rel="nofollow">RMD</a> & <a href="https://osf.io/eps4v/" rel="nofollow">HTML</a></li> </ul>
OSF does not support the use of Internet Explorer. For optimal performance, please switch to another browser.
Accept
This website relies on cookies to help provide a better user experience. By clicking Accept or continuing to use the site, you agree. For more information, see our Privacy Policy and information on cookie use.
Accept
×

Start managing your projects on the OSF today.

Free and easy to use, the Open Science Framework supports the entire research lifecycle: planning, execution, reporting, archiving, and discovery.