

{"id":3775,"date":"2015-11-08T12:46:56","date_gmt":"2015-11-08T17:46:56","guid":{"rendered":"http:\/\/rud.is\/b\/?p=3775"},"modified":"2018-09-14T14:01:48","modified_gmt":"2018-09-14T19:01:48","slug":"visualizing_survey_data","status":"publish","type":"post","link":"https:\/\/rud.is\/b\/2015\/11\/08\/visualizing_survey_data\/","title":{"rendered":"Visualizing Survey Data : Comparison Between Observations"},"content":{"rendered":"<p>Cybersecurity is a domain that <em>really<\/em> likes surveys, or at the very least it has many folks within it that like to conduct and report on surveys. One recent <a href=\"http:\/\/www.ponemon.org\/blog\/the-second-annual-study-on-exchanging-cyber-threat-intelligence-there-has-to-be-a-better-way\">survey on threat intelligence<\/a> is in it&#8217;s second year, so it sets about comparing answers across years. Rather than go into the <em>many<\/em> technical\/statistical issues with this survey, I&#8217;d like to focus on alternate ways to visualize the comparison across years.<\/p>\n<p>We&#8217;ll use the data that makes up this chart (Figure 3 from the report):<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"3777\" data-permalink=\"https:\/\/rud.is\/b\/2015\/11\/08\/visualizing_survey_data\/surveybars\/\" data-orig-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/11\/surveybars.png?fit=1366%2C900&amp;ssl=1\" data-orig-size=\"1366,900\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"surveybars\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/11\/surveybars.png?fit=510%2C336&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/11\/surveybars.png?resize=510%2C336&#038;ssl=1\" alt=\"surveybars\" width=\"510\" height=\"336\" class=\"aligncenter size-full wp-image-3777\" \/><\/p>\n<p>since it&#8217;s pretty representative of the remainder of the figures.<\/p>\n<p>Let&#8217;s start by reproducing this figure with ggplot2:<\/p>\n<pre><code class=\"language-r\">library(dplyr)\nlibrary(tidyr)\nlibrary(stringr)\nlibrary(ggplot2)\nlibrary(scales)\nlibrary(ggthemes)\nlibrary(extrafont)\n\nloadfonts(quiet=TRUE)\n\nread.csv(\"question.csv\", stringsAsFactors=FALSE) %>%\n  gather(year, value, -belief) %>%\n  mutate(year=factor(sub(\"y\", \"\", year)),\n         belief=str_wrap(belief, 40)) -> question\n\nbeliefs <- unique(question$belief)\nquestion$belief <- factor(beliefs, levels=rev(beliefs[c(1,2,4,5,3,7,6)]))\n\ngg <- ggplot(question, aes(belief, value, group=year))\ngg <- gg + geom_bar(aes(fill=year), stat=\"identity\", position=\"dodge\",\n                    color=\"white\", width=0.85)\ngg <- gg + geom_text(aes(label=percent(value)), hjust=-0.15,\n                     position=position_dodge(width=0.8), size=3)\ngg <- gg + scale_x_discrete(expand=c(0,0))\ngg <- gg + scale_y_continuous(expand=c(0,0), label=percent, limits=c(0,0.8))\ngg <- gg + scale_fill_tableau(name=\"\")\ngg <- gg + coord_flip()\ngg <- gg + labs(x=NULL, y=NULL, title=\"Fig 3: Reasons for fully participating\\n\")\ngg <- gg + theme_tufte(base_family=\"Arial Narrow\")\ngg <- gg + theme(axis.ticks.x=element_blank())\ngg <- gg + theme(axis.text.x=element_blank())\ngg <- gg + theme(axis.ticks.y=element_blank())\ngg <- gg + theme(legend.position=\"bottom\")\ngg <- gg + theme(plot.title=element_text(hjust=0))\ngg<\/code><\/pre>\n<p><img decoding=\"async\" src=\"\/svg\/surveydata_files\/figure-html\/unnamed-chunk-3-1.svg\" title=\"\" alt=\"\" width=\"960\" \/><\/p>\n<p>Now, the survey does caveat the findings and talks about non-response bias, sampling-frame bias and self-reporting bias. However, nowhere does it talk about the margin of error or anything relating to uncertainty. Thankfully, both the 2014 and 2015 reports communicate population and sample sizes, so we can figure out the margin of error:<\/p>\n<pre><code class=\"language-r\">library(samplesize4surveys)\n\nmoe_2014 <- e4p(19915, 701, 0.5)\n## With the parameters of this function: N = 19915 n =  701 P = 0.5 DEFF =  1 conf = 0.95 . \n## The estimated coefficient of variation is  3.709879 . \n## The margin of error is 3.635614 . \n## \n\nmoe_2015 <- e4p(18705, 692, 0.5)\n## With the parameters of this function: N = 18705 n =  692 P = 0.5 DEFF =  1 conf = 0.95 . \n## The estimated coefficient of variation is  3.730449 . \n## The margin of error is 3.655773 .<\/code><\/pre>\n<p>They are both roughly <code>3.65%<\/code> so let's take a look at our dodged bar chart again with this new information:<\/p>\n<pre><code class=\"language-r\">mutate(question, ymin=value-0.0365, ymax=value+0.0365) -> question\n\ngg <- ggplot(question, aes(belief, value, group=year))\ngg <- gg + geom_bar(aes(fill=year), stat=\"identity\",\n                    position=position_dodge(0.85),\n                    color=\"white\", width=0.85)\ngg <- gg + geom_linerange(aes(ymin=ymin, ymax=ymax),\n                         position=position_dodge(0.85),\n                         size=1.5, color=\"#bdbdbd\")\ngg <- gg + scale_x_discrete(expand=c(0,0))\ngg <- gg + scale_y_continuous(expand=c(0,0), label=percent, limits=c(0,0.85))\ngg <- gg + scale_fill_tableau(name=\"\")\ngg <- gg + coord_flip()\ngg <- gg + labs(x=NULL, y=NULL, title=\"Fig 3: Reasons for fully participating\\n\")\ngg <- gg + theme_tufte(base_family=\"Arial Narrow\")\ngg <- gg + theme(axis.ticks.x=element_blank())\ngg <- gg + theme(axis.text.x=element_blank())\ngg <- gg + theme(axis.ticks.y=element_blank())\ngg <- gg + theme(legend.position=\"bottom\")\ngg <- gg + theme(plot.title=element_text(hjust=0))\ngg<\/code><\/pre>\n<p><img decoding=\"async\" src=\"\/svg\/surveydata_files\/figure-html\/unnamed-chunk-5-1.svg\" title=\"\" alt=\"\" width=\"960\" \/><\/p>\n<p>Hrm. There seems to be a <em>bit<\/em> of overlap. Let's just focus on that:<\/p>\n<pre><code class=\"language-r\">gg <- ggplot(question, aes(belief, value, group=year))\ngg <- gg + geom_pointrange(aes(ymin=ymin, ymax=ymax),\n                         position=position_dodge(0.25),\n                         size=1, color=\"#bdbdbd\", fatten=1)\ngg <- gg + scale_x_discrete(expand=c(0,0))\ngg <- gg + scale_y_continuous(expand=c(0,0), label=percent, limits=c(0,1))\ngg <- gg + scale_fill_tableau(name=\"\")\ngg <- gg + coord_flip()\ngg <- gg + labs(x=NULL, y=NULL, title=\"Fig 3: Reasons for fully participating\\n\")\ngg <- gg + theme_tufte(base_family=\"Arial Narrow\")\ngg <- gg + theme(axis.ticks.x=element_blank())\ngg <- gg + theme(axis.text.x=element_blank())\ngg <- gg + theme(axis.ticks.y=element_blank())\ngg <- gg + theme(legend.position=\"bottom\")\ngg <- gg + theme(plot.title=element_text(hjust=0))\ngg<\/code><\/pre>\n<p><img decoding=\"async\" src=\"\/svg\/surveydata_files\/figure-html\/unnamed-chunk-6-1.svg\" title=\"\" alt=\"\" width=\"960\" \/><\/p>\n<p>The report actually makes hard claims based on the year-over-year change in the answers to many of the questions (not just this chart). Most have these overlapping intervals. Now, I understand that when a paying customer says they want a report that they wouldn't really be satisfied with a one-pager saying <em>\"See last years's report\"<\/em>, but not communicating the uncertainty in these results seems like a significant omission.<\/p>\n<p>But, I digress. There are better (or at least alternate) ways than bars to show this comparison. One is a \"dumbbell chart\".<\/p>\n<pre><code class=\"language-r\">question %>%\n  group_by(belief) %>%\n  mutate(line_col=ifelse(diff(value)<0, \"2015\", \"2014\"),\n         hjust=ifelse(diff(value)<0, -0.5, 1.5)) %>%\n  ungroup() -> question\n\ngg <- ggplot(question)\ngg <- gg + geom_path(aes(x=value, y=belief, group=belief, color=line_col))\ngg <- gg + geom_point(aes(x=value, y=belief, color=year))\ngg <- gg + geom_text(data=filter(question, year==\"2015\"),\n                     aes(x=value, y=belief, label=percent(value),\n                         hjust=hjust), size=2.5)\ngg <- gg + scale_x_continuous(expand=c(0,0), limits=c(0,0.8))\ngg <- gg + scale_color_tableau(name=\"\")\ngg <- gg + labs(x=NULL, y=NULL, title=\"Fig 3: Reasons for fully participating\\n\")\ngg <- gg + theme_tufte(base_family=\"Arial Narrow\")\ngg <- gg + theme(axis.ticks.x=element_blank())\ngg <- gg + theme(axis.text.x=element_blank())\ngg <- gg + theme(axis.ticks.y=element_blank())\ngg <- gg + theme(legend.position=\"bottom\")\ngg <- gg + theme(plot.title=element_text(hjust=0))\ngg<\/code><\/pre>\n<p><img decoding=\"async\" src=\"\/svg\/surveydata_files\/figure-html\/unnamed-chunk-7-1.svg\" title=\"\" alt=\"\" width=\"960\" \/><\/p>\n<p>I've used line color to indicate whether the 2015 value increased or decreased from 2014.<\/p>\n<p>But, we still have the issue of communicating the margin of error. One way I came up with (which is not perfect) is to superimpose the dot-plot on top of the entire margin of error interval. While it doesn't show the discrete start\/end margin for each year it does help to show that making definitive statements on the value comparisons is not exactly a good idea:<\/p>\n<pre><code class=\"language-r\">group_by(question, belief) %>%\n  summarize(xmin=min(ymin), xmax=max(ymax)) -> band\n\ngg <- ggplot(question)\ngg <- gg + geom_segment(data=band,\n                        aes(x=xmin, xend=xmax, y=belief, yend=belief),\n                        color=\"#bdbdbd\", alpha=0.5, size=3)\ngg <- gg + geom_path(aes(x=value, y=belief, group=belief, color=line_col),\n                     show.legend=FALSE)\ngg <- gg + geom_point(aes(x=value, y=belief, color=year))\ngg <- gg + geom_text(data=filter(question, year==\"2015\"),\n                     aes(x=value, y=belief, label=percent(value),\n                         hjust=hjust), size=2.5)\ngg <- gg + scale_x_continuous(expand=c(0,0), limits=c(0,0.8))\ngg <- gg + scale_color_tableau(name=\"\")\ngg <- gg + labs(x=NULL, y=NULL, title=\"Fig 3: Reasons for fully participating\\n\")\ngg <- gg + theme_tufte(base_family=\"Arial Narrow\")\ngg <- gg + theme(axis.ticks.x=element_blank())\ngg <- gg + theme(axis.text.x=element_blank())\ngg <- gg + theme(axis.ticks.y=element_blank())\ngg <- gg + theme(legend.position=\"bottom\")\ngg <- gg + theme(plot.title=element_text(hjust=0))\ngg<\/code><\/pre>\n<p><img decoding=\"async\" src=\"\/svg\/surveydata_files\/figure-html\/unnamed-chunk-8-1.svg\" title=\"\" alt=\"\" width=\"960\" \/><\/p>\n<p>Finally, the year-to-year nature of the data was just <em>begging<\/em> for a slopegraph:<\/p>\n<pre><code class=\"language-r\">question %>% mutate(vjust=0.5) -> question\nquestion[(question$belief==\"Makes threat data more actionable\") &\n           (question$year==\"2015\"),]$vjust <- -1\nquestion[(question$belief==\"Reduces the cost of detecting and\\npreventing cyber attacks\") &#038;\n           (question$year==\"2015\"),]$vjust <- 1.5\n\nquestion$year <- factor(question$year, levels=c(\"2013\", \"2014\", \"2015\", \"2016\", \"2017\", \"2018\"))\n\ngg <- ggplot(question)\ngg <- gg + geom_path(aes(x=year, y=value, group=belief, color=line_col))\ngg <- gg + geom_point(aes(x=year, y=value), shape=21, fill=\"black\", color=\"white\")\ngg <- gg + geom_text(data=filter(question, year==\"2015\"),\n                     aes(x=year, y=value,\n                         label=sprintf(\"\\u2000%s %s\", percent(value),\n                                       gsub(\"\\n\", \" \", belief)),\n                         vjust=vjust), hjust=0, size=3)\ngg <- gg + geom_text(data=filter(question, year==\"2014\"),\n                     aes(x=year, y=value, label=percent(value)),\n                     hjust=1.3, size=3)\ngg <- gg + scale_x_discrete(expand=c(0,0.1), drop=FALSE)\ngg <- gg + scale_color_tableau(name=\"\")\ngg <- gg + labs(x=NULL, y=NULL, title=\"Fig 3: Reasons for fully participating\\n\")\ngg <- gg + theme_tufte(base_family=\"Arial Narrow\")\ngg <- gg + theme(axis.ticks=element_blank())\ngg <- gg + theme(axis.text=element_blank())\ngg <- gg + theme(legend.position=\"none\")\ngg <- gg + theme(plot.title=element_text(hjust=0.5))\ngg <- gg + theme(plot.title=element_text(hjust=0))\ngg<\/code><\/pre>\n<p><img decoding=\"async\" src=\"\/svg\/surveydata_files\/figure-html\/unnamed-chunk-9-1.svg\" title=\"\" alt=\"\" width=\"960\" \/><\/p>\n<p>It doesn't help communicate uncertainty but it's a nice alternative to bars.<\/p>\n<p>Hopefully this helps provide some alternatives to bars for these types of comparisons and also ways to communicate uncertainty without confusing the reader (communicating uncertainty to a broad audience is <em>hard<\/em>).<\/p>\n<p>Perhaps those conducting surveys (or data analyses in general) could subscribe to a \"data visualizers\" paraphrase of a quote from Epidemics, Book I, of the Hippocratic school:<\/p>\n<p><em>\"Practice two things in your dealings with data: either help or do not harm the reader.\"<\/em><\/p>\n<p>The full Rmd and data for this post is in <a href=\"https:\/\/gist.github.com\/hrbrmstr\/f7ab55e7ae1fc8569df3\">this gist<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Cybersecurity is a domain that really likes surveys, or at the very least it has many folks within it that like to conduct and report on surveys. One recent survey on threat intelligence is in it&#8217;s second year, so it sets about comparing answers across years. Rather than go into the many technical\/statistical issues with [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3783,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":3,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":""},"categories":[681,677,709,678,673,674,753,91,656],"tags":[810],"class_list":["post-3775","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cybersecurity","category-data-analysis-2","category-data-driven-security","category-data-visualization","category-datavis-2","category-dataviz","category-ggplot","category-r","category-slopegraph","tag-post"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Visualizing Survey Data : Comparison Between Observations - rud.is<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/rud.is\/b\/2015\/11\/08\/visualizing_survey_data\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Visualizing Survey Data : Comparison Between Observations - rud.is\" \/>\n<meta property=\"og:description\" content=\"Cybersecurity is a domain that really likes surveys, or at the very least it has many folks within it that like to conduct and report on surveys. One recent survey on threat intelligence is in it&#8217;s second year, so it sets about comparing answers across years. Rather than go into the many technical\/statistical issues with [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/rud.is\/b\/2015\/11\/08\/visualizing_survey_data\/\" \/>\n<meta property=\"og:site_name\" content=\"rud.is\" \/>\n<meta property=\"article:published_time\" content=\"2015-11-08T17:46:56+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-09-14T19:01:48+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/11\/Visualizing_Survey_Data___Comparison_Between_Observations.png?fit=1848%2C1110&ssl=1\" \/>\n\t<meta property=\"og:image:width\" content=\"1848\" \/>\n\t<meta property=\"og:image:height\" content=\"1110\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"hrbrmstr\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"hrbrmstr\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2015\\\/11\\\/08\\\/visualizing_survey_data\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2015\\\/11\\\/08\\\/visualizing_survey_data\\\/\"},\"author\":{\"name\":\"hrbrmstr\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#\\\/schema\\\/person\\\/d7cb7487ab0527447f7fda5c423ff886\"},\"headline\":\"Visualizing Survey Data : Comparison Between Observations\",\"datePublished\":\"2015-11-08T17:46:56+00:00\",\"dateModified\":\"2018-09-14T19:01:48+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2015\\\/11\\\/08\\\/visualizing_survey_data\\\/\"},\"wordCount\":486,\"commentCount\":4,\"publisher\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#\\\/schema\\\/person\\\/d7cb7487ab0527447f7fda5c423ff886\"},\"image\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2015\\\/11\\\/08\\\/visualizing_survey_data\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2015\\\/11\\\/Visualizing_Survey_Data___Comparison_Between_Observations.png?fit=1848%2C1110&ssl=1\",\"keywords\":[\"post\"],\"articleSection\":[\"Cybersecurity\",\"Data Analysis\",\"data driven security\",\"Data Visualization\",\"DataVis\",\"DataViz\",\"ggplot\",\"R\",\"slopegraph\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/rud.is\\\/b\\\/2015\\\/11\\\/08\\\/visualizing_survey_data\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2015\\\/11\\\/08\\\/visualizing_survey_data\\\/\",\"url\":\"https:\\\/\\\/rud.is\\\/b\\\/2015\\\/11\\\/08\\\/visualizing_survey_data\\\/\",\"name\":\"Visualizing Survey Data : Comparison Between Observations - rud.is\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2015\\\/11\\\/08\\\/visualizing_survey_data\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2015\\\/11\\\/08\\\/visualizing_survey_data\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2015\\\/11\\\/Visualizing_Survey_Data___Comparison_Between_Observations.png?fit=1848%2C1110&ssl=1\",\"datePublished\":\"2015-11-08T17:46:56+00:00\",\"dateModified\":\"2018-09-14T19:01:48+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2015\\\/11\\\/08\\\/visualizing_survey_data\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/rud.is\\\/b\\\/2015\\\/11\\\/08\\\/visualizing_survey_data\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2015\\\/11\\\/08\\\/visualizing_survey_data\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2015\\\/11\\\/Visualizing_Survey_Data___Comparison_Between_Observations.png?fit=1848%2C1110&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2015\\\/11\\\/Visualizing_Survey_Data___Comparison_Between_Observations.png?fit=1848%2C1110&ssl=1\",\"width\":1848,\"height\":1110},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2015\\\/11\\\/08\\\/visualizing_survey_data\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/rud.is\\\/b\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Visualizing Survey Data : Comparison Between Observations\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#website\",\"url\":\"https:\\\/\\\/rud.is\\\/b\\\/\",\"name\":\"rud.is\",\"description\":\"&quot;In God we trust. All others must bring data&quot;\",\"publisher\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#\\\/schema\\\/person\\\/d7cb7487ab0527447f7fda5c423ff886\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/rud.is\\\/b\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#\\\/schema\\\/person\\\/d7cb7487ab0527447f7fda5c423ff886\",\"name\":\"hrbrmstr\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/ukr-shield.png?fit=460%2C460&ssl=1\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/ukr-shield.png?fit=460%2C460&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/ukr-shield.png?fit=460%2C460&ssl=1\",\"width\":460,\"height\":460,\"caption\":\"hrbrmstr\"},\"logo\":{\"@id\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/ukr-shield.png?fit=460%2C460&ssl=1\"},\"description\":\"Don't look at me\u2026I do what he does \u2014 just slower. #rstats avuncular \u2022 ?Resistance Fighter \u2022 Cook \u2022 Christian \u2022 [Master] Chef des Donn\u00e9es de S\u00e9curit\u00e9 @ @rapid7\",\"sameAs\":[\"http:\\\/\\\/rud.is\"],\"url\":\"https:\\\/\\\/rud.is\\\/b\\\/author\\\/hrbrmstr\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Visualizing Survey Data : Comparison Between Observations - rud.is","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/rud.is\/b\/2015\/11\/08\/visualizing_survey_data\/","og_locale":"en_US","og_type":"article","og_title":"Visualizing Survey Data : Comparison Between Observations - rud.is","og_description":"Cybersecurity is a domain that really likes surveys, or at the very least it has many folks within it that like to conduct and report on surveys. One recent survey on threat intelligence is in it&#8217;s second year, so it sets about comparing answers across years. Rather than go into the many technical\/statistical issues with [&hellip;]","og_url":"https:\/\/rud.is\/b\/2015\/11\/08\/visualizing_survey_data\/","og_site_name":"rud.is","article_published_time":"2015-11-08T17:46:56+00:00","article_modified_time":"2018-09-14T19:01:48+00:00","og_image":[{"width":1848,"height":1110,"url":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/11\/Visualizing_Survey_Data___Comparison_Between_Observations.png?fit=1848%2C1110&ssl=1","type":"image\/png"}],"author":"hrbrmstr","twitter_card":"summary_large_image","twitter_misc":{"Written by":"hrbrmstr","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/rud.is\/b\/2015\/11\/08\/visualizing_survey_data\/#article","isPartOf":{"@id":"https:\/\/rud.is\/b\/2015\/11\/08\/visualizing_survey_data\/"},"author":{"name":"hrbrmstr","@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"headline":"Visualizing Survey Data : Comparison Between Observations","datePublished":"2015-11-08T17:46:56+00:00","dateModified":"2018-09-14T19:01:48+00:00","mainEntityOfPage":{"@id":"https:\/\/rud.is\/b\/2015\/11\/08\/visualizing_survey_data\/"},"wordCount":486,"commentCount":4,"publisher":{"@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"image":{"@id":"https:\/\/rud.is\/b\/2015\/11\/08\/visualizing_survey_data\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/11\/Visualizing_Survey_Data___Comparison_Between_Observations.png?fit=1848%2C1110&ssl=1","keywords":["post"],"articleSection":["Cybersecurity","Data Analysis","data driven security","Data Visualization","DataVis","DataViz","ggplot","R","slopegraph"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/rud.is\/b\/2015\/11\/08\/visualizing_survey_data\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/rud.is\/b\/2015\/11\/08\/visualizing_survey_data\/","url":"https:\/\/rud.is\/b\/2015\/11\/08\/visualizing_survey_data\/","name":"Visualizing Survey Data : Comparison Between Observations - rud.is","isPartOf":{"@id":"https:\/\/rud.is\/b\/#website"},"primaryImageOfPage":{"@id":"https:\/\/rud.is\/b\/2015\/11\/08\/visualizing_survey_data\/#primaryimage"},"image":{"@id":"https:\/\/rud.is\/b\/2015\/11\/08\/visualizing_survey_data\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/11\/Visualizing_Survey_Data___Comparison_Between_Observations.png?fit=1848%2C1110&ssl=1","datePublished":"2015-11-08T17:46:56+00:00","dateModified":"2018-09-14T19:01:48+00:00","breadcrumb":{"@id":"https:\/\/rud.is\/b\/2015\/11\/08\/visualizing_survey_data\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/rud.is\/b\/2015\/11\/08\/visualizing_survey_data\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/rud.is\/b\/2015\/11\/08\/visualizing_survey_data\/#primaryimage","url":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/11\/Visualizing_Survey_Data___Comparison_Between_Observations.png?fit=1848%2C1110&ssl=1","contentUrl":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/11\/Visualizing_Survey_Data___Comparison_Between_Observations.png?fit=1848%2C1110&ssl=1","width":1848,"height":1110},{"@type":"BreadcrumbList","@id":"https:\/\/rud.is\/b\/2015\/11\/08\/visualizing_survey_data\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/rud.is\/b\/"},{"@type":"ListItem","position":2,"name":"Visualizing Survey Data : Comparison Between Observations"}]},{"@type":"WebSite","@id":"https:\/\/rud.is\/b\/#website","url":"https:\/\/rud.is\/b\/","name":"rud.is","description":"&quot;In God we trust. All others must bring data&quot;","publisher":{"@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/rud.is\/b\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886","name":"hrbrmstr","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2023\/10\/ukr-shield.png?fit=460%2C460&ssl=1","url":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2023\/10\/ukr-shield.png?fit=460%2C460&ssl=1","contentUrl":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2023\/10\/ukr-shield.png?fit=460%2C460&ssl=1","width":460,"height":460,"caption":"hrbrmstr"},"logo":{"@id":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2023\/10\/ukr-shield.png?fit=460%2C460&ssl=1"},"description":"Don't look at me\u2026I do what he does \u2014 just slower. #rstats avuncular \u2022 ?Resistance Fighter \u2022 Cook \u2022 Christian \u2022 [Master] Chef des Donn\u00e9es de S\u00e9curit\u00e9 @ @rapid7","sameAs":["http:\/\/rud.is"],"url":"https:\/\/rud.is\/b\/author\/hrbrmstr\/"}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/11\/Visualizing_Survey_Data___Comparison_Between_Observations.png?fit=1848%2C1110&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p23idr-YT","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":4121,"url":"https:\/\/rud.is\/b\/2016\/03\/14\/spinning-cycles-in-box-4-to-take-the-pies-out-of-pi-day\/","url_meta":{"origin":3775,"position":0},"title":"Spinning Cycles in Box #4 To Take the Pies out of Pi Day","author":"hrbrmstr","date":"2016-03-14","format":false,"excerpt":">UPDATE: time spent per task factor order was wrong before. now fixed. I caught this tweet today: INSTEAD OF WORRYING ABOUT HOW OTHER DATA SCIENTISTS USE ? PERHAPS @WSJGraphics COULD SPEND THEIR ? LEARNING DATAVIZ pic.twitter.com\/xrP2eUhaaQ\u2014 Metrics Hulk (@MetricsHulk) March 14, 2016 The WSJ folks usually do a great job,\u2026","rel":"","context":"In &quot;Charts &amp; Graphs&quot;","block_context":{"text":"Charts &amp; Graphs","link":"https:\/\/rud.is\/b\/category\/charts-graphs\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/RStudioScreenSnapz018.png?fit=1200%2C894&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/RStudioScreenSnapz018.png?fit=1200%2C894&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/RStudioScreenSnapz018.png?fit=1200%2C894&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/RStudioScreenSnapz018.png?fit=1200%2C894&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/RStudioScreenSnapz018.png?fit=1200%2C894&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":3442,"url":"https:\/\/rud.is\/b\/2015\/05\/26\/a-quick-incomplete-comparison-of-ggplot2-rbokeh-plotting-idioms\/","url_meta":{"origin":3775,"position":1},"title":"A quick, incomplete comparison of ggplot2 &#038; rbokeh plotting idioms","author":"hrbrmstr","date":"2015-05-26","format":false,"excerpt":"I set aside a small bit of time to give [rbokeh](https:\/\/github.com\/bokeh\/rbokeh) a try and figured I'd share a small bit of code that shows how to make the \"same\" chart in both ggplot2 and rbokeh. #### What is Bokeh\/rbokeh? rbokeh is an [htmlwidget](http:\/\/htmlwidgets.org) wrapper for the [Bokeh](http:\/\/bokeh.pydata.org\/en\/latest\/) visualization library that\u2026","rel":"","context":"In &quot;Charts &amp; Graphs&quot;","block_context":{"text":"Charts &amp; Graphs","link":"https:\/\/rud.is\/b\/category\/charts-graphs\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3806,"url":"https:\/\/rud.is\/b\/2015\/12\/13\/fear-of-wapo-using-bad-pie-charts-has-increased-since-last-year\/","url_meta":{"origin":3775,"position":2},"title":"Fear of WaPo Using Bad Pie Charts Has Increased Since Last Year","author":"hrbrmstr","date":"2015-12-13","format":false,"excerpt":"I woke up this morning to a [headline story from the Washington Post](https:\/\/www.washingtonpost.com\/news\/the-fix\/wp\/2015\/12\/10\/to-many-christian-terrorists-arent-true-christians-but-muslim-terrorists-are-true-muslims\/) on _\"Americans are twice as willing to distance Christian extremists from their religion as Muslims_\". This post is not about the content of the headline or story. It _is_ about the horrible pie chart WaPo led the\u2026","rel":"","context":"In &quot;Data Visualization&quot;","block_context":{"text":"Data Visualization","link":"https:\/\/rud.is\/b\/category\/data-visualization\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/12\/unnamed-chunk-1-1.png?fit=1200%2C877&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/12\/unnamed-chunk-1-1.png?fit=1200%2C877&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/12\/unnamed-chunk-1-1.png?fit=1200%2C877&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/12\/unnamed-chunk-1-1.png?fit=1200%2C877&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/12\/unnamed-chunk-1-1.png?fit=1200%2C877&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":3649,"url":"https:\/\/rud.is\/b\/2015\/08\/27\/coloring-and-drawing-outside-the-lines-in-ggplot\/","url_meta":{"origin":3775,"position":3},"title":"Coloring (and Drawing) Outside the Lines in ggplot","author":"hrbrmstr","date":"2015-08-27","format":false,"excerpt":"Time for another Twitter-inspired blog post this week, this time from a tweet by @JonKalodimos: Is there a way to do this in #rstats #ggplot2 https:\/\/t.co\/kxWQFlYpbB\u2014 Jonathan Kalodimos (@JonKalodimos) August 27, 2015 I had seen and appreciated Ann's post on her makeover of the main graphic in [NPR's story](http:\/\/www.npr.org\/sections\/money\/2014\/10\/21\/357629765\/when-women-stopped-coding) and\u2026","rel":"","context":"In &quot;Data Visualization&quot;","block_context":{"text":"Data Visualization","link":"https:\/\/rud.is\/b\/category\/data-visualization\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3832,"url":"https:\/\/rud.is\/b\/2015\/12\/28\/world-map-panel-plots-with-ggplot2-2-0-ggalt\/","url_meta":{"origin":3775,"position":4},"title":"World Map Panel Plots with ggplot2 2.0 &#038; ggalt","author":"hrbrmstr","date":"2015-12-28","format":false,"excerpt":"James Austin (@awhstin) made some #spiffy 4-panel maps with base R graphics but also posited he didn't use ggplot2 because: \u2026ggplot2 and maps currently do not support world maps at this point, which does not give us a great overall view. That is certainly a box I would not put\u2026","rel":"","context":"In &quot;cartography&quot;","block_context":{"text":"cartography","link":"https:\/\/rud.is\/b\/category\/cartography\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/12\/facetmaps.png?fit=1154%2C722&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/12\/facetmaps.png?fit=1154%2C722&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/12\/facetmaps.png?fit=1154%2C722&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/12\/facetmaps.png?fit=1154%2C722&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/12\/facetmaps.png?fit=1154%2C722&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":3094,"url":"https:\/\/rud.is\/b\/2014\/10\/13\/spending-seized-assets-a-state-by-state-per-capita-comparison-in-r\/","url_meta":{"origin":3775,"position":5},"title":"Spending Seized Assets &#8211; A State-by-State Per-capita Comparison in R","author":"hrbrmstr","date":"2014-10-13","format":false,"excerpt":"The Washingon Post did another great story+vis, this time on states [Spending seized assets](http:\/\/www.washingtonpost.com\/wp-srv\/special\/investigative\/asset-seizures\/). According to their sub-head: >_Since 2008, about 5,400 police agencies have spent $2.5 billion in proceeds from cash and property seized under federal civil forfeiture laws. Police suspected the assets were linked to crime, although in\u2026","rel":"","context":"In &quot;Charts &amp; Graphs&quot;","block_context":{"text":"Charts &amp; Graphs","link":"https:\/\/rud.is\/b\/category\/charts-graphs\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/posts\/3775","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/comments?post=3775"}],"version-history":[{"count":0,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/posts\/3775\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/media\/3783"}],"wp:attachment":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/media?parent=3775"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/categories?post=3775"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/tags?post=3775"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}