{"id":472,"date":"2010-04-25T00:54:01","date_gmt":"2010-04-25T05:54:01","guid":{"rendered":"http:\/\/www.thejuliagroup.com\/blog\/?p=472"},"modified":"2010-04-25T01:13:42","modified_gmt":"2010-04-25T06:13:42","slug":"life-is-full-of-disappointments","status":"publish","type":"post","link":"https:\/\/www.thejuliagroup.com\/blog\/life-is-full-of-disappointments\/","title":{"rendered":"Life is Full of Disappointments"},"content":{"rendered":"<p>I have been trying to get ready for two workshops this summer. One is called Visual Data with SPSS (pretty obvious what it is about). The second one is statistics using SAS Enterprise Guide. I was going to call the first course Statistics without Numbers and the second one Statistics without Programming. A colleague pointed out that what students want is not statistics without programming but statistics without pain. I never quite see statistics as painful in the same way that some students do, but I conceded his point and so that is now the official name on the schedule.<\/p>\n<p>It will, in fact, be a course without programming because I have spent half the weekend so far beating the data into shape. Unfortunately, this is going to be a bit misleading for students because in real life data don&#8217;t come nicely packaged. There are a couple of things that I have not found a way to do in SAS, SPSS or Stata using a point-and-click (GUI) interface.<\/p>\n<p>Chief among these is array processing. Say, for example, I want to recode all 90 questions on a survey to have both -1 and 8 as missing values. The closest you can do this is in SPSS with the TRANSFORM > RECODE  menu options and it does remember the previous values you entered for old and new values. Still, it&#8217;s much quicker to just write the syntax for it. Same with Stata and SAS. If there&#8217;s a way to do it quickly, I have yet to discover it.<\/p>\n<p>One idea I stole from Dreamweaver is snippets, little bits of code you store to do specific little tasks, like create a form button. Probably the most common &#8220;snippet&#8221; I use in SAS is the array\/ do &#8211; loop<\/p>\n<p>data in.visualdata ;<br \/>\n\tset in.visual ;<br \/>\n\tarray redo{*} _numeric_  ;<br \/>\n\tarray nxt{*}  q1 &#8212; q920a ;<br \/>\n\tDo i = 1 to dim(redo) ;<br \/>\n\t\tif redo{i} = -1 then redo{i} = . ;<br \/>\n\tend ;<br \/>\n\tDo j = 1 to dim(nxt) ;<br \/>\n\t\tif nxt{j} = 8 then nxt{j} = . ;<br \/>\n\tend ;<\/p>\n<p>Above, the data used -1 for missing data for all of the numeric variables, so it was easy enough to take care of that. However, for some questions, 8 was coded &#8220;no opinion\/ don&#8217;t know&#8221; so I wanted that to be missing also, but for other questions 8 was a valid value. So, I needed two array statements and two do-loops.<\/p>\n<p>I did not see any way to do this without programming other than 90+ pointy-clicky things. Not.<\/p>\n<p>I have similar &#8220;snippets&#8221; that do the exact same thing for Stata and SPSS.<\/p>\n<p>Another disappointment in Enterprise Guide in particular is the lack of a convenient where clause. I would like to only analyze cases where the respondent selected Obama or McCain as the likely candidate in the election.  I could easily use the QUERY feature in SAS EG , create a computed column, recode into a new column called vote2008 and now have three values, missing, Obama and McCain. However, if I wanted results only on those who had selected Obama or McCain I would have to use the Filter &#038; Sort feature and create a new dataset, I thought perhaps there was a WHERE clause and I had missed it.<\/p>\n<p>So, I googled &#8220;SAS Enterprise Guide&#8221; WHERE clause and was linked to a<a href=\"http:\/\/blogs.sas.com\/sasdummy\/index.php?\/archives\/76-SAS-Enterprise-Guide-for-SAS-programmers.html\"> post that ironically mentioned my blog saying that I can&#8217;t see a lot of experienced programmers switching to Enterprise Guide<\/a>.  <em>[In an aside here, I should mention I did not get as much hate mail as from the R people, just some snippy comments from the SAS EG folks about how I am &#8220;old&#8221;. Having survived the adolescence of three daughters and a fourth now on the brink I have developed immunity to all such comments . Moo ha ha  <---- Evil scientist laugh, in case you didn't recognize it.]<\/em><br \/>\n<figure id=\"attachment_473\" aria-describedby=\"caption-attachment-473\" style=\"width: 128px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2010\/04\/evabday.jpg\" alt=\"Eva, Supergenius Baby\" title=\"evabday\" width=\"128\" height=\"96\" class=\"size-full wp-image-473\" \/><figcaption id=\"caption-attachment-473\" class=\"wp-caption-text\">Eva, Supergenius Baby<\/figcaption><\/figure><\/p>\n<p>Besides, when you&#8217;re old, you get to have grandchildren as compensation. So, it&#8217;s all good. <\/p>\n<p>In the comments on the blog that commented on my blog (are you lost yet?) was a discussion of the disappointing absence of the WHERE clause.<\/p>\n<p>I overcame this disappointment quickly because SPSS actually does have something like what I wanted. Go to the DATA menu and choose SELECT CASES, throw in an IF clause and you have the dataset you want to analyze. Then, when you go to the next analysis, you can select different cases if your little heart desires.  In another, fleeting, disappointment, SAS Enterprise Guide does not seem to have an option to export to SPSS (or Stata, for that matter), although SAS 9.2 does export to both SPSS and Stata (and about damn time, too). No big deal. I exported it to Excel which will pop open in SPSS no problem.<\/p>\n<p>In yet another disappointment (is the title of this post not &#8220;Life is full of disappointments&#8221;?&#8221;) I could not find a way to make SAS EG do the graph I wanted which was the mean income of people who voted for McCain and people who voted for Obama. The bar chart options kept giving me percentage, cumulative percentage, frequency and cumulative frequency as the only options. Yes, I KNOW I could code it in PROC GCHART but have you ever actually written anything in SAS\/Graph? Yuck! It reminds me of when I used to have to write things using Tell-A-Graf to produce plots on our plotters at General Dynamics. (And if you remember any of that, you really ARE old!)<\/p>\n<p>Of course, the course IS entitled Visual Data with SPSS and I was only cleaning up the dataset in SAS EG because it happened to be open.<\/p>\n<p>In the final disappointment that has been going on for a while, actually, I haven&#8217;t been able to read in the formats with a .stc file from ICPSR.  I contacted them and they suggested running with options nofmterr .   This is one of those pieces of advice like yelling &#8220;Run faster!&#8221; to a runner in a race. It is correct but not really very helpful. My problem is that I wanted to have the formats created so I could use them. Usually ICPSR provides you code in SAS, SPSS or Stata with the formats\/ data labels. Not this time. Oh well, that is something helpful, young assistant can do on Monday. Thankfully I will only be using 16 of the bazillion variables.<\/p>\n<p>Anyway, I am over all of it. Tomorrow, after judo practice,  I am going to the Renaissance Faire for Mother&#8217;s Day.  We are going tomorrow because, for the umpteenth year in a row I will be out of town on Mother&#8217;s Day. This time, though, it is NOT for work but to watch my next-to-youngest baby compete in Tunisia. Some people, like those that<a href=\"http:\/\/www.fusionmma.com\/ronda-rousey\/\"> watched her winning this final at the Valentine&#8217;s Day Massacre,<\/a> say she is not such a baby, but she still is to me.<\/p>\n<p>So, yeah, my software isn&#8217;t perfect but the weather is lovely and my kids are pretty good. As for my husband, he just brought me up a glass of Chardonnay and it is time to kick back, drink it and read the New York Times (yes, even though I live in LA, I read both papers every day).<\/p>\n<p>Just read a tweet from some young starlet saying,<br \/>\n&#8220;You don&#8217;t marry someone because you can live with them, but because you can&#8217;t live without them.&#8221;<\/p>\n<p>And my thought was,<br \/>\n&#8220;Honey, you are obviously single. (And put some more clothes on, too.)&#8221;<br \/>\nYes. I AM old.<\/p>\n<p>So, despite the disappointments, I guess I will survive to teach the summer workshops. Who knows, I may even get time to go to the beach.<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2010\/04\/beachbahamasjpg-300x225.jpg\" alt=\"beachbahamasjpg\" title=\"beachbahamasjpg\" width=\"300\" height=\"225\" class=\"aligncenter size-medium wp-image-475\" srcset=\"https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2010\/04\/beachbahamasjpg-300x225.jpg 300w, https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2010\/04\/beachbahamasjpg.jpg 640w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have been trying to get ready for two workshops this summer. One is called Visual Data with SPSS (pretty obvious what it is about). The second one is statistics using SAS Enterprise Guide. I was going to call the first course Statistics without Numbers and the second one Statistics without Programming. A colleague pointed&#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":[11,8],"tags":[],"class_list":["post-472","post","type-post","status-publish","format-standard","hentry","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\/472","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=472"}],"version-history":[{"count":7,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/posts\/472\/revisions"}],"predecessor-version":[{"id":480,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/posts\/472\/revisions\/480"}],"wp:attachment":[{"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/media?parent=472"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/categories?post=472"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/tags?post=472"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}