{"id":76,"date":"2018-01-19T03:11:16","date_gmt":"2018-01-19T03:11:16","guid":{"rendered":"http:\/\/lanimcleod.com\/?p=76"},"modified":"2018-05-18T09:17:56","modified_gmt":"2018-05-18T09:17:56","slug":"civic-engagement-and-social-media","status":"publish","type":"post","link":"https:\/\/lanimcleod.com\/?p=76","title":{"rendered":"Civic Engagement and Social Media"},"content":{"rendered":"<h2>Skill Summary<\/h2>\n<table width=\"540\">\n<tbody>\n<tr style=\"background-color: #dd9933; color: #fff;\">\n<td style=\"width: 60; padding: 0 5px;\"><strong>Language<\/strong><\/td>\n<td width=\"78\"><strong>Method<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"60\">Python<\/td>\n<td width=\"78\">Hypothesis Testing<\/td>\n<\/tr>\n<tr>\n<td width=\"60\">Python<\/td>\n<td width=\"78\">Working with APIs<\/td>\n<\/tr>\n<tr>\n<td width=\"60\">Python<\/td>\n<td width=\"78\">LDA Method<\/td>\n<\/tr>\n<tr>\n<td width=\"60\">Python<\/td>\n<td width=\"78\">Least Squares Regression<\/td>\n<\/tr>\n<tr>\n<td width=\"60\">Python<\/td>\n<td width=\"78\">Principle Component Analysis<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div class=\"sl-container\">\n<div class=\"sl-content\">\n<div class=\"slide\">\n<p class=\"sl-callout\"><em>Extracts from a\u00a0grad school analysis I ran investigating what agencies have been communicating through social media and the resulting response from constituents. <\/em><\/p><p>By looking at tweets of 8 top active agencies on Twitter, I hoped to identify shared topics that agencies are tweeting about and \u00a0if these topics are a good prediction for retweets \u2013 as a proxy for civic engagement.\u00a0 While any study of social media platforms are subject to critique due to questions of adoption, usage and access, looking at what has been tried and its response among citizens may help agencies proactively navigate in the debate by knowing what topics hold their active constituents attention and what areas require other forms of outreach or engagement.<\/p>\n<\/div>\n<div class=\"slide\">\n<p class=\"sl-callout\">The top eight agencies that represented operational, administrative, emergency and service constituency specific missions were chosen for the analysis. This \u2018stratified sample\u2019 was done in order to get the most diversity in types of tweets issued, while minimizing the volume of data under analysis.<\/p><p>The most recent 3200 tweets were pulled using Twelt.com. The Twitter API was used to pull back twitter profiles and the number of followers and status counts for the selected agencies, as of the last update date of 12\/12.<\/p>\n<\/div>\n<div class=\"slide\">\n<p class=\"sl-callout\">The LDA method, a model that treats a topic as a discrete distribution of words with a probability with concentration and base measure, was used to identify groups of words that formed a topic across all tweets.<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-78 size-large\" src=\"http:\/\/lanimcleod.com\/wp-content\/uploads\/2017\/09\/LDAResult-1024x757.png\" alt=\"\" width=\"1024\" height=\"757\" srcset=\"https:\/\/lanimcleod.com\/wp-content\/uploads\/2017\/09\/LDAResult-1024x757.png 1024w, https:\/\/lanimcleod.com\/wp-content\/uploads\/2017\/09\/LDAResult-300x222.png 300w, https:\/\/lanimcleod.com\/wp-content\/uploads\/2017\/09\/LDAResult-768x568.png 768w, https:\/\/lanimcleod.com\/wp-content\/uploads\/2017\/09\/LDAResult.png 1124w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<\/div>\n<div class=\"slide\">\n<p class=\"sl-callout\">Determining the right number of topics was accomplished through trial and error. The LDA model was run several times over a test set of the data at varying alpha, number of topics, and number of passes and then cross validated against training data . The number of topics tried was from 40 down to 5. A final number of 7 was chosen.\u00a0From trial and error, the higher number of passes led to a greater accuracy in results. \u00a0Each tweet has it\u2019s own distribution over topics given by probabilities from the model.<\/p>\n<\/div>\n<div class=\"slide\">\n<p class=\"sl-callout\">My summary of the 7 topics:<br \/>\nTopic 0: Get help here \u2013 customer service notice<br \/>\nTopic 1: Call to action<br \/>\nTopic 2: 911 remembrance?<br \/>\nTopic 3: Tweets notifying constituents of the agencies presence on twitter<br \/>\nTopic 4: another customer service type<br \/>\nTopic 5: Event notification<br \/>\nTopic 6: How to<\/p>\n<\/div>\n<div class=\"slide\">\n<p class=\"sl-callout\">A numpy matrix was extracted from the LDA model listing each tweets probability of belonging to the final list of 7 topics. The probability distributions were treated as features against the number of retweets. An ordinary least squares regression was run, checked for dimensionality reduction using principal component analysis and then I reran the regression with significant features.<\/p>\n<\/div>\n<div class=\"slide\">\n<p class=\"sl-callout\">Data Sources<br \/>\n<a href=\"http:\/\/www.twelt.com\">www.twelt.com<\/a> &#8211; tweets<\/p><p><a href=\"http:\/\/www.twitter.com\">www.twitter.com<\/a> &#8211; agency handles and profile summary data<\/p><p><a href=\"http:\/\/www.opendatanyc.gov\">www.opendatanyc.gov<\/a> &#8211; 2011-2012 social media platform counts of city agencies<\/p>\n<\/div>\n<div class=\"sl-arrows\"><button class=\"sl-leftarrow\" onclick=\"plusDivs(-1)\">&#10094;<\/button><button class=\"sl-rightarrow\" onclick=\"plusDivs(1)\">&#10095;<\/button><\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Skill Summary Language Method Python Hypothesis Testing Python Working with APIs Python LDA Method Python Least Squares Regression Python Principle Component Analysis Extracts from a\u00a0grad school analysis I ran investigating what agencies have been communicating through social media and the resulting response from constituents. By looking at tweets of 8 top active agencies on Twitter, [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":77,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[4],"tags":[],"class_list":["post-76","post","type-post","status-publish","format-standard","has-post-thumbnail","category-analysis","entry"],"_links":{"self":[{"href":"https:\/\/lanimcleod.com\/index.php?rest_route=\/wp\/v2\/posts\/76","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lanimcleod.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lanimcleod.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lanimcleod.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/lanimcleod.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=76"}],"version-history":[{"count":22,"href":"https:\/\/lanimcleod.com\/index.php?rest_route=\/wp\/v2\/posts\/76\/revisions"}],"predecessor-version":[{"id":467,"href":"https:\/\/lanimcleod.com\/index.php?rest_route=\/wp\/v2\/posts\/76\/revisions\/467"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lanimcleod.com\/index.php?rest_route=\/wp\/v2\/media\/77"}],"wp:attachment":[{"href":"https:\/\/lanimcleod.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=76"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lanimcleod.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=76"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lanimcleod.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=76"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}