{"id":2673,"date":"2011-08-15T15:15:47","date_gmt":"2011-08-15T19:15:47","guid":{"rendered":"http:\/\/www.decisionsciencenews.com\/?p=2673"},"modified":"2014-02-24T08:29:18","modified_gmt":"2014-02-24T13:29:18","slug":"how-many-nyc-restaurants-get-as-on-their-health-inspections","status":"publish","type":"post","link":"https:\/\/www.decisionsciencenews.com\/?p=2673","title":{"rendered":"How many NYC restaurants get As on their health inspections?"},"content":{"rendered":"<p>WITH DATA LIKE THESE, WHO CAN SAY?<\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/www.decisionsciencenews.com\/wp-content\/uploads\/2011\/08\/nyc_rest-.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2674\" title=\"nyc_rest\" src=\"http:\/\/www.decisionsciencenews.com\/wp-content\/uploads\/2011\/08\/nyc_rest-.png\" alt=\"\" width=\"485\" height=\"425\" \/><\/a><\/p>\n<p>Decision Science News is no stranger to <a href=\"http:\/\/www.decisionsciencenews.com\/2011\/07\/03\/best-graph-ever\/\">misleading infographics in free New York newspapers<\/a>. We could upgrade to real newspapers, but we find that playing &#8220;spot the infographic flaw&#8221; really makes the time fly on the subway.<\/p>\n<p>We saw the above graphic in a paper called <a href=\"http:\/\/www.metro.us\/newyork\">Metro<\/a>. In New York City, restaurants are graded by health inspectors and receive an &#8220;A&#8221;, &#8220;B&#8221;, or &#8220;C&#8221; rating (any lower than C and they are shut down). This graphic was supposed to inform us about the percentage of restaurants with As, by borough and citywide. Can you spot the goof?<\/p>\n<p>You might be curious how the weighted average of 73.3%, 62.8%, 63.6%, 61.4%, and 62.2% could be 69% (shown in the red box) given that 73.3% gets the smallest weight in the average. <\/p>\n<p>Ignoring the top row in the table, a simple calculation from the remaining numbers gives 63.6% as the percentage of restaurants with As. But which stat is correct? Perhaps the top row is correct and some other numbers in the table are wrong.<\/p>\n<p>Amazingly, the same day, <a href=\"http:\/\/www.amny.com\/\">AM New York<\/a>, yet another free paper, ran more or less the same story, but with different numbers. Based on those, 68% of restaurants had As. Disappointingly, all their by-borough percentages failed to line up with hose from Metro (see R code at end of this article).<\/p>\n<p>Decision Science News then tried to cut out the middleman and hit the <a href=\"http:\/\/www.nyc.gov\/html\/doh\/html\/services\/restaurant-inspection.shtml\">New York City Department of Health and Mental Hygiene Website<\/a>.\u00a0Pie charts are much maligned, but when it comes to the topic of food safety, why not? If it were up to us, we would have drawn in a crust and whipped cream, but then <a href=\"http:\/\/www.decisionsciencenews.com\/2011\/01\/07\/five-books-that-changed-a-statistician\/\">our taste in charts is controversial<\/a>.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/www.decisionsciencenews.com\/wp-content\/uploads\/2011\/08\/nycgrads.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2675\" title=\"nycgrads\" src=\"http:\/\/www.decisionsciencenews.com\/wp-content\/uploads\/2011\/08\/nycgrads.png\" alt=\"\" width=\"485\" height=\"350\" \/><\/a><br \/><font size=1>Taken from <a href=\"http:\/\/www.nyc.gov\/html\/doh\/downloads\/pdf\/rii\/restaurant-grading-1-year-report.pdf\">http:\/\/www.nyc.gov\/html\/doh\/downloads\/pdf\/rii\/restaurant-grading-1-year-report.pdf<\/a><\/font><\/p>\n<p>So, we now have four candidate figures, 69%, 63.6%, 68% and 69%, which are in no way independent, but do suggest the answer is &#8220;just shy of 70%&#8221;.<\/p>\n<p>Another interesting tidbit in the health department&#8217;s report is that the restaurant grades may be effective at changing restaurants&#8217; behavior. At first inspection, 39% of restaurants got As, 34% got Bs, and 27% got Cs. From page 3:<\/p>\n<blockquote><p>Among those scoring in the B range on initial inspection, nearly 40% improved to earn an A on reinspection. Of restaurants that scored in the C range on their initial inspection, 72% improved enough to earn an A or B on re-inspection.<\/p><\/blockquote>\n<p>There you have it!<\/p>\n<p>R CODE FOR R NERDS<br \/>\n<code><br \/>\n################<br \/>\n#Metro data<br \/>\ngraded=c(22454,2204,5235,9086,5030,899)<br \/>\nasMetrostated=c(.69,.662,.628,.636,.614,.733)<br \/>\nasMetrocount=round(asMetrostated*graded)<br \/>\nmetro=data.frame(graded,asMetrostated,asMetrocount)<br \/>\nrow.names(metro)=c(\"citywide\",\"bronx\",\"brooklyn\",\"manhattan\",\"queens\",\"statenIsland\")<br \/>\nmetro<br \/>\nsprintf(\"Total graded: %d\", sum(metro[2:6,1]))<br \/>\nsprintf(\"Total As: %d\", sum(metro[2:6,3]))<br \/>\nsprintf(\"Percent As: %.2f\", (sum(metro[2:6,3]) \/ sum(metro[2:6,1]) * 100))<br \/>\n################<br \/>\n#AM New York data<br \/>\nstatenIsland=c(644,73,20,82)<br \/>\nqueens=c(3009,601,152,806)<br \/>\nbrooklyn=c(3197,619,152,774)<br \/>\nbronx=c(1394,260,54,332)<br \/>\nmanhattan=c(5792,1006,256,1314)<br \/>\nam=data.frame(bronx,brooklyn,manhattan,queens,statenIsland)<br \/>\nam[5,]=apply(am[1:4,],2,sum)<br \/>\nam[6,] = am[1,]\/am[5,]<br \/>\nrow.names(am)=c(\"A\",\"B\",\"C\",\"GradePending\",\"total\",\"As\")<br \/>\nround(am,2)<br \/>\nsprintf(\"Percent As: %.2f\", sum(am[1,]) \/ sum(am[5,]))<\/code><\/p>\n<p>ADDENDUM: Thanks to the folks at <a href=\"http:\/\/www.katom.com\/learning-center\/information_on.html\">katom.com<\/a> for finding a broken link on this page. Check out their site for restaurant inspection info.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Decision Science News is no stranger to misleading infographics in free New York newspapers. We could stop reading them entirely, but we find that playing &#8220;spot the infographic flaw&#8221; makes time fly on the subway.<\/p>\n<p>Recently we saw the above graphic in a paper called Metro. Can you spot the goof?<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","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,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[7,16,74],"tags":[20,245,1208,244,243,70,101],"class_list":["post-2673","post","type-post","status-publish","format-standard","hentry","category-gossip","category-ideas","category-r","tag-decision-making","tag-infoviz","tag-r","tag-restaurant-grades","tag-restaurants","tag-statistics","tag-stats"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p4LKj-H7","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.decisionsciencenews.com\/index.php?rest_route=\/wp\/v2\/posts\/2673","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.decisionsciencenews.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.decisionsciencenews.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.decisionsciencenews.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.decisionsciencenews.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2673"}],"version-history":[{"count":24,"href":"https:\/\/www.decisionsciencenews.com\/index.php?rest_route=\/wp\/v2\/posts\/2673\/revisions"}],"predecessor-version":[{"id":4535,"href":"https:\/\/www.decisionsciencenews.com\/index.php?rest_route=\/wp\/v2\/posts\/2673\/revisions\/4535"}],"wp:attachment":[{"href":"https:\/\/www.decisionsciencenews.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2673"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.decisionsciencenews.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2673"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.decisionsciencenews.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2673"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}