{"id":5120,"date":"2016-06-20T12:46:34","date_gmt":"2016-06-20T17:46:34","guid":{"rendered":"http:\/\/www.thejuliagroup.com\/blog\/?p=5120"},"modified":"2016-09-15T19:03:49","modified_gmt":"2016-09-16T00:03:49","slug":"the-village-watchman-and-sas-enterprise-guide-summary-tables","status":"publish","type":"post","link":"https:\/\/www.thejuliagroup.com\/blog\/the-village-watchman-and-sas-enterprise-guide-summary-tables\/","title":{"rendered":"The Village Watchman and SAS Enterprise Guide Summary Tables"},"content":{"rendered":"<blockquote><p><em>The government is extremely fond of amassing great quantities of statistics. These are raised to the nth degree, the cube roots are extracted, and the results are arranged into elaborate and impressive displays. What must be kept ever in mind, however, is that in every case, the figures are first put down by a village watchman, and he puts down anything he damn well pleases.<\/em><br \/>\nJosiah Stamp<\/p><\/blockquote>\n<p>Any time you do anything with any data your first step is to consider the wisdom of Sir Josiah Stamp and check the validity of your data. One quick first step is using the Summary Tables task from SAS Enterprise Guide. If you are not familiar with SAS Enterprise Guide, it is a menu driven application for using SAS for data analysis. You can open a program window and write code if you like, and I do that every now and then but that&#8217;s another post. In my experience, SAS Enterprise Guide works much better with smaller data sets &#8211; defined by me, as the blog owner, of less than 400,000 records or so. Your mileage may vary depending upon your system.<\/p>\n<p>How to do it:<\/p>\n<ol>\n<li>Open SAS Enterprise Guide<\/li>\n<li>Open your data set &#8211; (FILE &gt; OPEN &gt; DATA)<\/li>\n<li>From the TASKS menu, select DESCRIBE and then SUMMARY TABLES. The window below will pop up<\/li>\n<li>Drag the variables to the roles you want for each. Since I have less than 450 usernames here, I just quickly want to see are there duplicates, errors (e.g. &#8216;gret bear&#8217; is really the same kid as &#8216;grey bear&#8217; , with a typo). I also want to find out the number of problems each student attempted and the percent correct. So, I drag <em>&#8216;username&#8217;<\/em> under CLASSIFICATION VARIABLES and <em>&#8216;correct&#8217;\u00a0<\/em> under ANALYSIS variables. You can have more than one of each but it just so happens I only have one classification and one analysis variable I&#8217;m interested in right now.<\/li>\n<\/ol>\n<p><a href=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/06\/summary1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-5121\" src=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/06\/summary1.png\" alt=\"window with options for data\" width=\"450\" height=\"361\" srcset=\"https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/06\/summary1.png 730w, https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/06\/summary1-300x241.png 300w\" sizes=\"auto, (max-width: 450px) 100vw, 450px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>5. Next click on the tab at left that says SUMMARY TABLES and drag your variables and statistics where you want them. I want <em>&#8216;username&#8217; <\/em>as the row, so I drag it to the side,\u00a0<em>&#8216;correct&#8217;<\/em> as the column, N is already filled in as a statistic if you drag your classification variable to the table first. I also want the mean, so I drag that next to the N. Then, click RUN.<\/p>\n<p><a href=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/06\/summary22.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-5131\" src=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/06\/summary22.png\" alt=\"summary tables tab with statistics selected\" width=\"450\" height=\"323\" srcset=\"https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/06\/summary22.png 739w, https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/06\/summary22-300x216.png 300w\" sizes=\"auto, (max-width: 450px) 100vw, 450px\" \/><\/a><\/p>\n<p><strong>Wait a minute! Didn&#8217;t I say I wanted the percent correct for each student? Why would I select mean instead of percent?<\/strong><\/p>\n<p>Because the pctN will simply tell me what percent of the total N responses from this username make up. I don&#8217;t want that. Since the answers are score 0 = wrong, 1= right, the mean will tell me what percentage of the questions were answered correctly by each student. Hey, I know what I&#8217;m doing here.<\/p>\n<p>6. Look at the data! In looking at the raw data, I see that there are two erroneous usernames that shouldn&#8217;t be there. These data have been cleaned pretty well already, so I don&#8217;t find much to fix.<a href=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/06\/summary4_badoutput1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5133\" src=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/06\/summary4_badoutput1.png\" alt=\"summary4_badoutput\" width=\"248\" height=\"141\" \/><\/a>Now, I want to re-run the analysis deleting these two usernames.<\/p>\n<p>7. At the top of your table, you&#8217;ll see an option that says &#8220;Modify Task&#8221;. Click that.<\/p>\n<p><a href=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/06\/summary5_modify_task.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5125\" src=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/06\/summary5_modify_task.png\" alt=\"summary5_modify_task\" width=\"206\" height=\"77\" \/><\/a>8. You&#8217;ll have the summary tables window pop up, this time with your data filled in.\u00a0 Click on the edit button at the top right of this window. You are about to create a task filter.<\/p>\n<p><a href=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/06\/summary1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-5121\" src=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/06\/summary1.png\" alt=\"window with options for data\" width=\"450\" height=\"361\" srcset=\"https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/06\/summary1.png 730w, https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/06\/summary1-300x241.png 300w\" sizes=\"auto, (max-width: 450px) 100vw, 450px\" \/><\/a><\/p>\n<p>8. Under TASK FILTER pull down the first box to show the variable &#8216;<em>username&#8217;. <\/em> Pull down the second box to show the option NOT EQUAL TO and then click the three dots next to the third box. This will pull up a list of all of your values for usernames. You can select the one you want to exclude and click OK.\u00a0 Next to the three dots, pull down to select AND, then go through this to select the second username you want to delete. You can also just type in the values, but I tend to do it this way because I&#8217;m a bad typist with a bad short-term memory.<\/p>\n<p><a href=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/06\/summary6_edit.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5126\" src=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/06\/summary6_edit.png\" alt=\"summary6_edit\" width=\"730\" height=\"368\" srcset=\"https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/06\/summary6_edit.png 730w, https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/06\/summary6_edit-300x151.png 300w\" sizes=\"auto, (max-width: 730px) 100vw, 730px\" \/><\/a>9. Create a SAS dataset of the output. It&#8217;s super easy. Click on the RESULTS tab to the left and in the window that pops up click SAVE RESULTS TO A DATA SET. Then, click RUN.<\/p>\n<p><a href=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/06\/summary3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5123\" src=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/06\/summary3.png\" alt=\"summary3\" width=\"640\" height=\"179\" srcset=\"https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/06\/summary3.png 640w, https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/06\/summary3-300x84.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a>\u00a0\u00a0 10. The most recently created data set should be your default data set for analysis but click on it in your process flow diagram to activate it just in case. <a href=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/06\/summary7_newdata.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5127\" src=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/06\/summary7_newdata.png\" alt=\"summary7_newdata\" width=\"306\" height=\"233\" srcset=\"https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/06\/summary7_newdata.png 306w, https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/06\/summary7_newdata-300x228.png 300w\" sizes=\"auto, (max-width: 306px) 100vw, 306px\" \/><\/a><\/p>\n<p>11. From the DESCRIBE menu again select SUMMARY STATISTICS<\/p>\n<p>12. Drag &#8216;<em>correct_mean&#8217; <\/em> under ANALYSIS VARIABLES and click RUN.<\/p>\n<p>The resulting table gives me my answer &#8211; the mean is .838 with a standard deviation of .26 for N=424 subjects.\u00a0 So &#8230; the average subject answered 84% of the problems correctly. This, however, is just the first step. <a href=\"http:\/\/www.thejuliagroup.com\/blog\/?p=5135\">There are couple more interesting questions to be answered with this data set before moving on. Read the next step here.\u00a0<\/a><\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p><a href=\"http:\/\/sites.fastspring.com\/7generation\/product\/fishlake\">Want to play the game that produced these data? Own a Mac or Windows computer? Have ten bucks?<\/a><\/p>\n<p><a href=\"http:\/\/sites.fastspring.com\/7generation\/product\/fishlake\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4866 size-full\" src=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2015\/11\/tv_minot1.jpg\" alt=\"Girl on TV playing game\" width=\"450\" height=\"296\" srcset=\"https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2015\/11\/tv_minot1.jpg 450w, https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2015\/11\/tv_minot1-300x197.jpg 300w\" sizes=\"auto, (max-width: 450px) 100vw, 450px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/sites.fastspring.com\/7generation\/product\/fishlake\">Here you go.<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The government is extremely fond of amassing great quantities of statistics. These are raised to the nth degree, the cube roots are extracted, and the results are arranged into elaborate and impressive displays. What must be kept ever in mind, however, is that in every case, the figures are first put down by a village&#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,8],"tags":[],"class_list":["post-5120","post","type-post","status-publish","format-standard","hentry","category-software","category-statistics","category-technology"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/posts\/5120","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=5120"}],"version-history":[{"count":6,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/posts\/5120\/revisions"}],"predecessor-version":[{"id":5214,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/posts\/5120\/revisions\/5214"}],"wp:attachment":[{"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/media?parent=5120"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/categories?post=5120"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/tags?post=5120"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}