{"id":1593,"date":"2011-08-22T20:02:26","date_gmt":"2011-08-23T01:02:26","guid":{"rendered":"http:\/\/www.thejuliagroup.com\/blog\/?p=1593"},"modified":"2011-08-22T20:02:26","modified_gmt":"2011-08-23T01:02:26","slug":"census-in-black-white-what-i-wondered-about-lately","status":"publish","type":"post","link":"https:\/\/www.thejuliagroup.com\/blog\/census-in-black-white-what-i-wondered-about-lately\/","title":{"rendered":"Census in Black &#038; White: What I wondered about lately"},"content":{"rendered":"<p>The census now allows more than one race to be checked. For many years, friends of mine in inter-racial couples when they registered their children for school would check the &#8220;Other&#8221; box for race, rather than pick black or white.<\/p>\n<p>Although an individual&#8217;s census form responses are confidential, you certainly are free to tell anyone what you put. <a href=\"http:\/\/articles.latimes.com\/2010\/apr\/04\/nation\/la-na-obama-census4-2010apr04\">In response to an inquiry, the white house spokesperson said that President Obama had checked only &#8220;African-American or Black<\/a>&#8220;, even though his mother is white.<\/p>\n<p>Now that you can select both black and white as race, I wondered how many people did. Unlike normal people who wonder about these things, I decided to download all 3,030,728 records from the 2009 American Community Survey to find out. Once I downloaded the survey and read it into SAS, I produced the chart below. I was quite surprised to see how few people checked both black and white. As you can see, it was less than 1%.<\/p>\n<p><a href=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2011\/08\/Racedist.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1594\" title=\"Racedist\" src=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2011\/08\/Racedist.jpg\" alt=\"Distribution of race shows 0.7% selected both black and white\" width=\"505\" height=\"338\" srcset=\"https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2011\/08\/Racedist.jpg 505w, https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2011\/08\/Racedist-300x200.jpg 300w\" sizes=\"auto, (max-width: 505px) 100vw, 505px\" \/><\/a><\/p>\n<p>The SAS code to create this chart is shown below. You might think this is a ridiculous amount of work to create one chart and you could do it way easier in Excel. You&#8217;d be correct except for two things.\u00a0 One, I know that earlier versions of Excel no way could you read in 3,000,000+\u00a0 records. Even if you can do it now I&#8217;ll bet it&#8217;s painfully slow. Two, most of these options or steps only need to be done once and I was doing multiple charts. The AXIS and PATTERN statements only need to be specified once.<\/p>\n<p>If you DO want to create your chart in Excel, you could just do the first part, the PROC FREQ, and then export your output from the frequency procedure to a four- record file and do the rest in Excel. There is no need to get religiously attached to doing everything with one program or package.<\/p>\n<p><code><br \/>\nPROC FREQ DATA = lib.pums9 NOPRINT;<\/code><\/p>\n<p><code>TABLES racblk* racwht \/ OUT = lib.blkwhitmix ;<\/code><\/p>\n<p><code>WEIGHT pwgtp ;<\/p>\n<p>DATA byrace ;<\/p>\n<p>SET lib.blkwhitmix ;<\/p>\n<p>IF racblk = 1 AND racwht = 0 THEN Race = \"Black\" ;<\/p>\n<p>ELSE IF racblk = 0 AND racwht = 1 THEN Race = \"White\" ;<\/p>\n<p>ELSE IF racblk = 0 AND racwht = 0 THEN Race = \"Other\" ;<\/p>\n<p>ELSE IF racblk = 1 AND racwht = 1 THEN Race = \"Mixed\" ;<\/p>\n<p>PERCENT = PERCENT\/ 100 ;<\/p>\n<p>AXIS1 LABEL = ( ANGLE = 90 \"Percent\") ORDER = (0 to 1 by .1 ) ;<\/p>\n<p>AXIS2 ORDER = (\"White\" \"Black\" \"Mixed\" \"Other\" ) ;<\/p>\n<p>PATTERN1 COLOR = BLACK ;<\/p>\n<p>PATTERN2 COLOR= GRAY\u00a0 ;<\/p>\n<p>PATTERN3 COLOR = BROWN ;<\/p>\n<p>PATTERN4 COLOR=WHITE\u00a0 ;<\/p>\n<p>PROC GCHART DATA=byrace ;<\/p>\n<p>VBAR Race \/ raxis = axis1 maxis = axis2<\/p>\n<p>SUMVAR= percent<\/p>\n<p>TYPE=SUM<\/p>\n<p>OUTSIDE= SUM<\/p>\n<p>PATTERNID = MIDPOINT ;<\/p>\n<p>LABEL\u00a0 Race\u00a0 = \"Race\"\u00a0 ;<\/p>\n<p><\/code><\/p>\n<p>&nbsp;<\/p>\n<p><code>FORMAT percent percent8.1\u00a0 ;<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The census now allows more than one race to be checked. For many years, friends of mine in inter-racial couples when they registered their children for school would check the &#8220;Other&#8221; box for race, rather than pick black or white. Although an individual&#8217;s census form responses are confidential, you certainly are free to tell anyone&#8230;<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[15,11],"tags":[],"class_list":["post-1593","post","type-post","status-publish","format-standard","hentry","category-open-data","category-statistics"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/posts\/1593","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/comments?post=1593"}],"version-history":[{"count":3,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/posts\/1593\/revisions"}],"predecessor-version":[{"id":1597,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/posts\/1593\/revisions\/1597"}],"wp:attachment":[{"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/media?parent=1593"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/categories?post=1593"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/tags?post=1593"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}