{"id":4446,"date":"2015-01-15T01:49:32","date_gmt":"2015-01-15T06:49:32","guid":{"rendered":"http:\/\/www.thejuliagroup.com\/blog\/?p=4446"},"modified":"2015-01-15T01:49:32","modified_gmt":"2015-01-15T06:49:32","slug":"descriptives-details-and-death","status":"publish","type":"post","link":"https:\/\/www.thejuliagroup.com\/blog\/descriptives-details-and-death\/","title":{"rendered":"Descriptives, Details and Death"},"content":{"rendered":"<p>I think descriptive statistics are under-rated. One reason I like <a href=\"http:\/\/store.elsevier.com\/Epidemiology\/Leon-Gordis\/isbn-9781455737338\/\">Leon Gordis&#8217; Epidemiology book <\/a>is that he agrees with me. He says that sometimes statistics pass the &#8220;inter-ocular test&#8221;. That is, they hit you right between the eyes.<\/p>\n<p><a href=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2015\/01\/eyeballs.gif\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4449\" src=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2015\/01\/eyeballs.gif\" alt=\"moving eyeballs\" width=\"72\" height=\"37\" \/><\/a><\/p>\n<p>I&#8217;m a big fan of eye-balling statistics and SAS\/GRAPH is good for that. Let&#8217;s take this example. It is fairly well established that women have a longer life span than men in the United States. In other words, men die at a younger age. Is that true of all causes?<\/p>\n<p>To answer that question, I used a subset of the Framingham Heart Study and looked at two major causes of death, coronary heart disease and cancer. The first thing I did was round the age at death into five year intervals to smooth out some of the fluctuations from year to year.<\/p>\n<p>data test2 ;<br \/>\nset sashelp.heart ;<br \/>\nageatdeath5 = round(ageatdeath,5) ;<br \/>\nproc freq data=test2 noprint;<br \/>\ntables sex*ageatdeath5*deathcause \/ missing out= test3 ;<br \/>\n\/* NOTE THAT THE MISSING OPTION IS IMPORTANT *\/<\/p>\n<p><strong>THE DEVIL IS IN THE DETAILS<\/strong><\/p>\n<p>Then I did a frequency distribution by sex, age at death and cause of death. Notice that I used the missing option. That is super-important. Without it, instead of getting what percentage of the entire population died of a specific cause at a certain age,\u00a0 I would get a percentage of those who died. However, as with many studies of survival, life expectancy, etc. a substantial proportion of the people were still alive at the time data were being collected. So, percentage of the population, and percentage of people who died were quite different numbers. I used the NOPRINT option on the PROC FREQ statement simply because I had no need to print out a long, convoluted frequency table I wasn&#8217;t going to use.<\/p>\n<p>I used the OUT = option to output the frequency distribution to a dataset that I could use for graphing.<\/p>\n<p><strong>More details:<\/strong> The symbol statements just make the graphs easier to read by putting an asterisk at each data point and by joining the points together. I have very bad eyesight so anything I can do to make graphics more readable, I try to do.<br \/>\nsymbol1 value = star ;<br \/>\nsymbol1 interpol = join ;<\/p>\n<p>Here I am just sorting the data set by cause of death and only keeping those with Cancer or Coronary Heart Disease.<br \/>\nproc sort data=test3;<br \/>\nby deathcause ;<br \/>\nwhere deathcause in (&#8220;Cancer&#8221;,&#8221;Coronary Heart Disease&#8221;);<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Even more details.\u00a0<\/strong> You always want to have the axes the same on your charts or you can&#8217;t really compare them. That is what the UNIFORM option in the PROC GPLOT statement does. The PLOT statement requests a plot of percent who died at each age by sex. The LABEL statement just gives reasonable labels to my variables.<\/p>\n<p>proc gplot data = test3 uniform;<br \/>\nplot percent*ageatdeath5 = sex ;<br \/>\nby deathcause ;<br \/>\nLabel percent = &#8220;%&#8221;<br \/>\nageatdeath5 = &#8220;Age at Death&#8221; ;<\/p>\n<p><a href=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2015\/01\/deathcause.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4448\" src=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2015\/01\/deathcause.png\" alt=\"cause of death by age by gender\" width=\"450\" height=\"676\" srcset=\"https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2015\/01\/deathcause.png 450w, https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2015\/01\/deathcause-199x300.png 199w\" sizes=\"auto, (max-width: 450px) 100vw, 450px\" \/><\/a><\/p>\n<p>When you look at these graphs, even if your eyes are as bad as mine you can see a few things. The top chart is of cancer and you can conclude a couple of\u00a0 things right away.<\/p>\n<ol>\n<li>There is not nearly the discrepancy in the death rates of men and women for cancer as there is for heart disease.<\/li>\n<li>Men are much more likely to die of heart disease than women at every age up until 80 years old. After that, I suspect that the percentage of men dying off has declined relative to women because a very large proportion of the men are already dead.<\/li>\n<\/ol>\n<p>So, the answer to my question is &#8220;No.&#8221;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I think descriptive statistics are under-rated. One reason I like Leon Gordis&#8217; Epidemiology book is that he agrees with me. He says that sometimes statistics pass the &#8220;inter-ocular test&#8221;. That is, they hit you right between the eyes. I&#8217;m a big fan of eye-balling statistics and SAS\/GRAPH is good for that. Let&#8217;s take this example&#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":[9,11],"tags":[],"class_list":["post-4446","post","type-post","status-publish","format-standard","hentry","category-software","category-statistics"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/posts\/4446","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=4446"}],"version-history":[{"count":2,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/posts\/4446\/revisions"}],"predecessor-version":[{"id":4450,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/posts\/4446\/revisions\/4450"}],"wp:attachment":[{"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/media?parent=4446"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/categories?post=4446"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/tags?post=4446"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}