{"id":4984,"date":"2016-02-24T03:47:38","date_gmt":"2016-02-24T08:47:38","guid":{"rendered":"http:\/\/www.thejuliagroup.com\/blog\/?p=4984"},"modified":"2016-02-24T03:47:38","modified_gmt":"2016-02-24T08:47:38","slug":"sas-studio-finding-prevalence-with-pointing-and-clicking","status":"publish","type":"post","link":"https:\/\/www.thejuliagroup.com\/blog\/sas-studio-finding-prevalence-with-pointing-and-clicking\/","title":{"rendered":"SAS Studio: Finding prevalence with pointing and clicking"},"content":{"rendered":"<p>Policy makers have very good reason for wanting to know how common a condition or disease is. It allows them to plan and budget for treatment facilities, supplies of medication, rehabilitation personnel. There are two broad answers to the question, \u201cHow common is condition X?\u201d and, interestingly, both of these use the exact same SAS procedures. <strong>Prevalence is the number of persons with a condition divided by the number in the population. It\u2019s often given as per thousand, or per 100,000, depending on how common the condition is.<\/strong> Prevalence is often referred to as a snapshot. It&#8217;s how many people have a condition at any given time.<\/p>\n<p>&nbsp;<\/p>\n<p>Just for fun, let\u2019s take a look at how to compute prevalence with SAS Studio.<\/p>\n<p><strong>Step 1: Access your data set<\/strong><\/p>\n<p>First, assign a libname so that you can access your data. To do that, you create a new SAS program by clicking on the first tab in the top menu and selecting SAS Program.<\/p>\n<p><a href=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/02\/step1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4985\" src=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/02\/step1.png\" alt=\"Click to create new program\" width=\"360\" height=\"189\" srcset=\"https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/02\/step1.png 360w, https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/02\/step1-300x158.png 300w\" sizes=\"auto, (max-width: 360px) 100vw, 360px\" \/><\/a><br \/>\n<code><br \/>\nlibname mydata \"\/courses\/number\/number\/\" access=readonly;<\/code><\/p>\n<p>(Students only have readonly access to data sets in the course directory. This prevents them from accidentally deleting files shared by the whole class. As a professor with many years of experience, let me just tell you that this is a GREAT idea.)<\/p>\n<p>Click on the little running guy at the top of your screen and, voila, your LIBNAME is assigned and the directory is now available for access.<\/p>\n<p>(Didn&#8217;t believe me there is a little running guy that means &#8220;run&#8221;? Ha!)<\/p>\n<p><a href=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/02\/running_guy.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4986\" src=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/02\/running_guy.png\" alt=\"running guy\" width=\"121\" height=\"105\" \/><\/a><\/p>\n<p>Next, in the left window pane, click on Tasks and in the window to the right, click on the icon next to the data field.<\/p>\n<p><a href=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/02\/select_file.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4987\" src=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/02\/select_file-300x108.png\" alt=\"window to select library\" width=\"450\" height=\"163\" srcset=\"https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/02\/select_file-300x108.png 300w, https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/02\/select_file.png 861w\" sizes=\"auto, (max-width: 450px) 100vw, 450px\" \/><\/a><\/p>\n<p>From the drop down menu of directories, select the one with your data and then click on the file you need to analyze.<\/p>\n<p><a href=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/02\/3selectfile.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-4988\" src=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/02\/3selectfile-300x255.png\" alt=\"list of files in directory\" width=\"300\" height=\"255\" srcset=\"https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/02\/3selectfile-300x255.png 300w, https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/02\/3selectfile.png 637w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Step 2: Select the statistic that you want and then select the variable. In this case, I selected one-way frequencies, and one cool thing is that SAS will automatically show you ONLY the roles you need for a specific test. If you were doing a two-sample t-test, for example, it would ask for you groups\u00a0variable and your analysis variable. Since I am doing a one-way frequency, there is only an analysis variable.<\/p>\n<p><a href=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/02\/roles.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-4989\" src=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/02\/roles-300x164.png\" alt=\"select roles\" width=\"300\" height=\"164\" srcset=\"https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/02\/roles-300x164.png 300w, https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/02\/roles.png 400w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>When you click on the plus next to Analysis Variables, all of the variables in your data set pop up and you can select which you want to use. Then, click on your little running guy again, and voila again, results.<\/p>\n<p><a href=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/02\/results.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4990\" src=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/02\/results.png\" alt=\"Results of proc freq\" width=\"500\" height=\"193\" srcset=\"https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/02\/results.png 500w, https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/02\/results-300x116.png 300w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/a><\/p>\n<p>So &#8230; the prevalence of diabetes is about 11% of the ADULT population in California, or about 110 per 1,000.<\/p>\n<p>You can also code it very simply if you would like:<br \/>\nlibname mydata &#8220;\/courses\/number\/number\/&#8221; access=readonly;<\/p>\n<p>PROC FREQ DATA = mydata.datasetname ;<\/p>\n<p>TABLE variable ;<\/p>\n<p>Of course, all of this assumes that your data is cleaned and you have a binary variable with has disease\/ \u00a0doesn&#8217;t have disease, which is a pretty large assumption.<\/p>\n<p><a href=\"http:\/\/www.thejuliagroup.com\/blog\/?p=4946\">Now, curiously, the code above is the exact SAME code we used to compute incidence of Down syndrome a few weeks ago. <\/a>What&#8217;s up with that and how can you use the exact same code to compute two different statistics?<\/p>\n<p>Patience, my dear. That is a post for another day.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Policy makers have very good reason for wanting to know how common a condition or disease is. It allows them to plan and budget for treatment facilities, supplies of medication, rehabilitation personnel. There are two broad answers to the question, \u201cHow common is condition X?\u201d and, interestingly, both of these use the exact same SAS&#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-4984","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\/4984","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=4984"}],"version-history":[{"count":1,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/posts\/4984\/revisions"}],"predecessor-version":[{"id":4991,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/posts\/4984\/revisions\/4991"}],"wp:attachment":[{"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/media?parent=4984"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/categories?post=4984"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/tags?post=4984"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}