{"id":4953,"date":"2016-02-03T17:55:47","date_gmt":"2016-02-03T22:55:47","guid":{"rendered":"http:\/\/www.thejuliagroup.com\/blog\/?p=4953"},"modified":"2016-02-03T17:57:27","modified_gmt":"2016-02-03T22:57:27","slug":"watch-me-work-data-project","status":"publish","type":"post","link":"https:\/\/www.thejuliagroup.com\/blog\/watch-me-work-data-project\/","title":{"rendered":"Watch me work: Data Project"},"content":{"rendered":"<p>On twitter, there were a few comments from people who said they didn&#8217;t like to take interns because &#8220;More than doing work, they want to watch me work.&#8221;<\/p>\n<p>I see both sides of that. You&#8217;re busy. You&#8217;re not netflix. I get it. On the other hand, that&#8217;s a good way to learn.<\/p>\n<p><a href=\"http:\/\/www.7generationgames.com\/about\/\">The data are part of the evaluation of the effectiveness of 7 Generation Games in increasing math achievement scores. You can read more about us here. Below is a sneak peek of the artwork\u00a0from the level we are creating now for Forgotten Trail.<\/a><\/p>\n<p><a href=\"http:\/\/www.7generationgames.com\/about\/\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4960\" src=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/02\/FTwinter.jpg\" alt=\"characters from Forgotten Trail in Maine\" width=\"450\" height=\"330\" srcset=\"https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/02\/FTwinter.jpg 450w, https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/02\/FTwinter-300x220.jpg 300w\" sizes=\"auto, (max-width: 450px) 100vw, 450px\" \/><\/a><\/p>\n<p>So, here you go. I&#8217;m starting on a data analysis project today and I thought I&#8217;d give you the blow by blow.<\/p>\n<p><a href=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/02\/analyze1.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4954\" src=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/02\/analyze1-300x49.jpg\" alt=\"phpmyadmin\" width=\"450\" height=\"74\" srcset=\"https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/02\/analyze1-300x49.jpg 300w, https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/02\/analyze1.jpg 866w\" sizes=\"auto, (max-width: 450px) 100vw, 450px\" \/><\/a><\/p>\n<p>It just so happens that the first several steps are all point-y and click-y. You could do it other ways but this is how I did it today. So, step one, I went to phpMyAdmin on the server where the data were saved and clicked Export.<\/p>\n<p><a href=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/02\/analyze2.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4956\" src=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/02\/analyze2.jpg\" alt=\"analyze2\" width=\"513\" height=\"456\" srcset=\"https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/02\/analyze2.jpg 513w, https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/02\/analyze2-300x267.jpg 300w\" sizes=\"auto, (max-width: 513px) 100vw, 513px\" \/><\/a><\/p>\n<p>For the format to export, I selected CSV and then clicked on the Go button. Now I have it downloaded to my desktop.<\/p>\n<p><a href=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/02\/analyz3.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4957\" src=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/02\/analyz3.jpg\" alt=\"import data\" width=\"245\" height=\"252\" \/><\/a><\/p>\n<p>Step 3: I opened SAS Enterprise Guide and selected Import Data. \u00a0I could have done this with SAS and written code to read the file, but, well, I didn&#8217;t. Nope, no particular reason, just this isn&#8217;t a very big data set so I thought, what the heck, why not.<\/p>\n<p><a href=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/02\/analyze4_uncheck.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4958\" src=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/02\/analyze4_uncheck.jpg\" alt=\"boxes to check in import data menu\" width=\"450\" height=\"294\" srcset=\"https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/02\/analyze4_uncheck.jpg 450w, https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/02\/analyze4_uncheck-300x196.jpg 300w\" sizes=\"auto, (max-width: 450px) 100vw, 450px\" \/><\/a><\/p>\n<p>Step 4: DO NOT ACCEPT THE DEFAULTS! \u00a0Since I have a comma-delimited file with no field names, I need to uncheck the box that says File contains field names on record number. SAS conveniently shows you the data below so I can see that it is comma-delimited. I know I selected CSV but it&#8217;s always god practice to check. I can also see that the data starts at the first record, so I want to change that value in Data records start at record number to 1.<\/p>\n<p><a href=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/02\/analyze5_easier_modify.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4959\" src=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/02\/analyze5_easier_modify.jpg\" alt=\"changing names\" width=\"450\" height=\"184\" srcset=\"https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/02\/analyze5_easier_modify.jpg 577w, https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2016\/02\/analyze5_easier_modify-300x123.jpg 300w\" sizes=\"auto, (max-width: 450px) 100vw, 450px\" \/><\/a><\/p>\n<p>Step 5: Change the names \u00a0&#8211; I am never going to remember what F1, F2 etc. are, so for the first 5 , I click on the row and edit the names to be the name and label I want.<\/p>\n<p>That&#8217;s it. Now I click the next button on the bottom of the screen until SAS imports my data.<\/p>\n<p>I could have continued changing all of the variable names, because I KNOW down the line I am not going to remember that F6 is actually the first question or that F25 is question 28a. However, I wanted to do some other things that I thought would be easier to code, so I opened up a program file in SAS Enterprise guide and wrote some code.<\/p>\n<p>\/* THIS CREATES TWO ARRAYS BECAUSE I AM TOO LAZY<\/p>\n<p>TO RENAME 32 QUESTIONS INDIVIDUALLY<\/p>\n<p>THE PRETEST DATA SET WAS CREATED BY THE STEPS ABOVE USING IMPORT DATA *\/<\/p>\n<p>&nbsp;<\/p>\n<p class=\"p2\"><span class=\"s1\"><b>data<\/b><\/span> pretest2 ;<\/p>\n<p class=\"p2\"><span class=\"s2\">\u00a0 \u00a0 set<\/span> pretest ;<\/p>\n<p class=\"p2\">** NOTE THAT THERE IS A $ AFTER THE NUMBER OF ELEMENTS IN THE ARRAY<\/p>\n<p class=\"p2\">** BECAUSE THIS IS A CHARACTER ARRAY ;<\/p>\n<p class=\"p2\"><span class=\"s2\">\u00a0 \u00a0 array<\/span> ren{<span class=\"s3\"><b>32<\/b><\/span>} $ f6-f37 ;<\/p>\n<p class=\"p2\"><span class=\"s2\">array<\/span> qs {<span class=\"s3\"><b>32<\/b><\/span>} $ q1-q27 q28a q28b q28c q29 q30;<\/p>\n<p class=\"p2\"><span class=\"s2\">do<\/span> i = <span class=\"s3\"><b>1<\/b><\/span> <span class=\"s2\">to<\/span> <span class=\"s3\"><b>32<\/b><\/span> ;<\/p>\n<p class=\"p2\">qs{i} = ren{i} ;<\/p>\n<p class=\"p2\"><span class=\"s2\">end<\/span> ;<\/p>\n<p class=\"p2\">** YOU CAN ALSO USE A RENAME STATEMENT TO RENAME THE SAME VARIABLES ;<\/p>\n<p class=\"p2\"><span class=\"s2\">rename<\/span> f38 = date_test ;<\/p>\n<p class=\"p2\">*** SINCE I NO LONGER NEED THE VARIABLES F6- F37 OR THE INDEX VARIABLE FOR THE<\/p>\n<p class=\"p2\">ARRAY, I DROP THEM HERE ;<\/p>\n<p class=\"p2\"><span class=\"s2\">drop<\/span> f6- f37 i ;<\/p>\n<p class=\"p2\">*** SOME STUDENTS SAVED THE TEST MORE THAN ONCE BECAUSE THEY SAVED BEFORE THEY WERE DONE AND AT THE END. SO, I SORT BY USERNAME AND TEST. WE WILL ONLY KEEP THE LAST ONE.<\/p>\n<p class=\"p2\"><span class=\"s1\"><b>proc<\/b><\/span> <span class=\"s1\"><b>sort<\/b><\/span> <span class=\"s2\">data<\/span>=pretest2 ;<\/p>\n<p class=\"p2\"><span class=\"s2\">by<\/span> username date_test ;<\/p>\n<p class=\"p2\">*** THIS KEEPS JUST THE LATEST TEST DATE. ALSO, WE TESTED THIS 45 TIMES IN<\/p>\n<p class=\"p2\">THE PROCESS OF GETTING READY FOR USE IN THE SCHOOLS. ALL OF OUR STAFF USED USERNAMES WITH &#8216;TEST&#8221; SO I USED THE INDEX FUNCTION TO FIND IF THERE WAS A &#8220;TEST&#8221; IN THE USERNAME AND, IF SO, DELETED THAT RECORD ;<\/p>\n<p class=\"p2\"><span class=\"s1\"><b>data<\/b><\/span> pretest2 ;<\/p>\n<p class=\"p2\"><span class=\"s2\">set<\/span> pretest2;<\/p>\n<p class=\"p2\"><span class=\"s2\">by<\/span> username date_test ;<\/p>\n<p class=\"p2\"><span class=\"s2\">if<\/span> last.username ;<\/p>\n<p class=\"p2\"><span class=\"s2\">if<\/span> index(username,<span class=\"s4\">&#8216;TEST&#8217;<\/span>) &gt; <span class=\"s3\"><b>0<\/b><\/span> <span class=\"s2\">then<\/span> delete;<\/p>\n<p class=\"p3\"><b>run<\/b><span class=\"s5\">;<\/span><\/p>\n<p class=\"p3\">Okay, that&#8217;s it. Now I have my data all ready to analyze. Pretty painless, isn&#8217;t it?<\/p>\n<p class=\"p2\">Want to learn more about SAS?<\/p>\n<p class=\"p2\"><a href=\"http:\/\/www2.sas.com\/proceedings\/sugi30\/242-30.pdf\">Here is a good paper on Arrays made easy<\/a> .<\/p>\n<p class=\"p2\"><a href=\"http:\/\/www2.sas.com\/proceedings\/sugi31\/247-31.pdf\">If you&#8217;re interested in character functions like index, here is a good paper by Ron Cody.<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>On twitter, there were a few comments from people who said they didn&#8217;t like to take interns because &#8220;More than doing work, they want to watch me work.&#8221; I see both sides of that. You&#8217;re busy. You&#8217;re not netflix. I get it. On the other hand, that&#8217;s a good way to learn. The data are&#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-4953","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\/4953","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=4953"}],"version-history":[{"count":3,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/posts\/4953\/revisions"}],"predecessor-version":[{"id":4963,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/posts\/4953\/revisions\/4963"}],"wp:attachment":[{"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/media?parent=4953"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/categories?post=4953"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/tags?post=4953"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}