Picking a surreal vacation destination in the US

Do you need help picking a summer vacation destination - one that's not just great, but surreal? If so, this blog's for you!

It's that time of the year again - I've got gobs of vacation time saved up, but I was drawing a blank on where to go... So I turned to my trusty pal Google, did a few searches, and found an interesting article about the 18 most surreal places in the US. A veritable bucket list of summer destinations that could satisfy my vacation appetite for years to come!

The article listed each location, gave a short description, and included cool photos. This was great for getting started, but it just wasn't quite the interface to the data that I wanted:


Being one of those geographically challenged Americans, I didn't really have a concept of exactly where these places were located, just based on their names. I had a general idea (say, within 500 miles), but I'm more of a "GPS Person" when it comes to locating a place I haven't been to before.

So I created a SAS dataset with the lat/long location of each of these destinations, and plotted the locations as markers on a map. I set up html tags so you can hover your mouse over each marker to see the name, and click on them for more info.

I don't usually let you see the intermediate (bad, or less good) versions of my maps, but I'm including this one, so you can see the difference in it and the final map. There were a couple of destinations in Alaska, so I included Alaska and Hawaii in the bottom corner of the map. This is the traditional place to put these two states so they fit conveniently onto the page, but it just didn't feel right clicking on something that was visually south of  California (on the page layout, at least), to see images of the Northern Lights. Read More »

Post a Comment

You don't know squat about the Las Vegas housing market

How bad was the recent recession on the Las Vegas housing market, and what lingering side effects are still being felt? If you don't know squat about real estate housing markets, then this blog post is for you! It takes a simple graphical look at some data that helps explain the basics ...

I recently read an interesting article in our local news about a real estate scam. Apparently someone had surreptitiously gotten access to a vacant house, and listed it for sale on Craigslist. The new 'owner' paid a $3,000 deposit, and was unpleasantly surprised when the police showed up and told him he was trespassing and had to leave. This got me wondering about all those foreclosed houses that are still vacant in the aftermath of the housing bubble and recent recession. I did a few Web searches on the topic, and found that this is an especially big issue for Las Vegas right now.

I wondered how much of a drop the Las Vegas housing market had experienced (compared to other big cities), so I located the historical home price index data and downloaded the spreadsheet. It was good to have my hands on the data, but I found it a bit difficult to get a good mental picture of it, just by looking at hundreds of numbers...


Read More »

Post a Comment

What we can learn from popular science communicators


I recently had a chance to hear Dr. Karl Kruszelnicki on triple j radio in Australia.  Known simply as Dr. Karl, he has a weekly national show answering science questions on an alternative rock radio station.  Yes, science on rock radio. Yes, national. Yes, Thursday morning – when people are listening.  Frankly, he is good -- really good, really interesting with a continuous number of callers wanting answers to science questions.

This got me thinking, what can we learn from the top popular science communicators of our time?  So I spent some time listening and reading some of their past work to determine what I could take away.  Make no mistake about it.  Learning to communicate technical information is a work in progress for all of us.  Learning from these masters can help.  Starting with Dr. Karl.

Dr. Karl

Dr. Karl covers a remarkable range of facts and background materials.  One of his common methods of relaying information is a form of storytelling.  Specifically, the stories are importantly related back to the listener’s personal experiences.  Psychology researchers Schank and Abelson have a term for this:  they call it “mapping the speaker’s stories onto the listener’s stories.”  Consider the following examples from a recent show.

A listener was wondering why ice evaporates if left for a long period in a freezer.  Dr. Karl responds with, “Think about water on a little puddle in the road. It does not get above 100 degrees C but it evaporates…”, the reason is explained that some of the molecules in the puddle do get to 100 degrees.  He goes on to explain that something similar happens in the freezer, but at a much slower rate.

Of interest is how he explained this.  Clearly, it was easier to “map” this story onto the image of a puddle on the road, as opposed to what the conditions are inside a freezer.

Another listener had a question about GMO crops.  To give a background he starts with an image for the listener.  “Have you ever been walking along a long a field of long grass, and you see those little tiny grass seeds that are about the size or smaller than the size of a match?  That’s corn.”  He goes on to discuss how grass seeds were bred into corn over thousands of years.  Again, mapping to a familiar image of walking in a field.  Then after that background, he discusses the modern approach to producing GMO crops.

The Dr. Karl weekly shows are available as podcasts.  There is a lot to learn from him, both science and the art of presenting information.  Additionally, during winter in the Northern hemisphere you can almost hear the sunshine through the broadcast from downunder. Read More »

Post a Comment

Is that a CSV file ... or have you been drinking?

In this blog post I explore some of the open data police incident reports for Raleigh and Cary, while showing you the easy way to handle various types of CSV files.

In recent years, many cities have set up open data websites, to share various kinds of data about their city. I decided to download the Raleigh and Cary police incident reports, and set up some examples that might be a good starting point for others wishing to analyze the open data for their city.

I found the Raleigh, NC open data page for their police incidents, clicked the 'Export' button and downloaded the CSV file. Their data is stored in a very simple/traditional comma-separated-value format, and I was therefore able to use SAS' Proc Import with the traditional dbms=csv:

PROC IMPORT OUT=raleigh_data

Here's what the imported data looks like:


Similarly, I found the Cary, NC page, and downloaded their data in the csv format. I naively tried the traditional SAS code to import the csv:


But the data came out in (mainly) two big character variables, with multiple fields all globbed together.


Upon further investigation of the cpd-incidents.csv file, I found that the values were separated by semicolons rather than commas. And I thought to myself, "That's not a comma separated value file - what have these people been drinking!?!" But upon further investigation of the definition of a csv file, I found that it has "records divided into fields separated by delimiters (typically a single reserved character such as comma, semicolon, or tab; sometimes the delimiter may include optional spaces)." I guess a semicolon is actually fair game ... so I put on my big-boy pants, and used some slightly different Proc Import code, that allows me to specify the delimiter:


And now the data imports much more cleanly, with each field in a separate variable. Here are a few of the many variables in the data: Read More »

Post a Comment

Jedi SAS Tricks: DIY Tasks in SAS Studio

In my previous post, Jedi SAS Tricks - Make This a Button in Base SAS I demonstrated running a SAS program from a tool bar button in the SAS Windowing environment. The program we execute is the macro from a previous post, Jedi SAS Tricks: The DATA to DATA Step Macro. The wily Chris Hemedinger commented that he had written a blog about a custom task for this function in Enterprise Guide, which is an excellent solution for our Enterprise Guide users. Just so our SAS Studio users don't feel left out, I'm going to show you on how to make a custom SAS Studio task that runs the Data2DataStep macro for you. Because this post is a bit longer and more complex than usual, I'm going to include a link to a ZIP file containing a PDF of the instructions and a copy of the XML code for the Data2DataStep task.

SAS Studio tasks are written in XML, so are very easy to create, copy and modify. In fact, SAS Studio allows you to edit your tasks right in the browser! It's a very useful exercise to copy a few tasks and experiment with the XML to get a feel for what each section does. After poking around, I chose to start my new task by right-clicking in the Task window and choosing New Task from the pop-up menu. This creates a blank template we can use to create our task. Let’s got through the template section by section and create a task that will collect input, then execute the Data2DataStep macro for us.

The first section is the Registration section. First, note the GUID (Globally Unique Identifier). This 128-bit integer uniquely identifies each task. SAS Studio provides you a new GUID every time you copy or create a new task. OK - first we’ll edit the Name and Description tags for our task and add a Category tag to help keep out tasks organized. You can also add links to SAS documentation which might be of interest to the user, if desired. The information we enter here will appear on the INFORMATION tab of our task:

      <description>Generates a DATA step to recreate a few observations of a data set.</description>
      <procedures>DATA step</procedures>
         <link href="http://support.sas.com/documentation/onlinedoc/sasstudio/index.html"/>SAS Studio User's Guide
         <link href="https://support.sas.com/documentation/cdl/en/lestmtsref/68024/HTML/default/viewer.htm#titlepage.htm"/>Base SAS Statements
         <link href="http://support.sas.com/training/studio"/>SAS Tutorials

Read More »

Post a Comment

SAS Author Spotlight: Goutam Chakraborty


SAS Books team at SAS Global Forum 2016

As the excitement of SAS Global Forum begins to die down and we dust off our sequins for another year, it’s time to get back behind the desk.

This year at SAS Global Forum we hosted a "Top Tips from Your Favorite SAS Press Authors" lunch where we asked three or four authors to present a top tip or two, talk a little about publishing a book with SAS Press, and then invited questions from the audience. Thank you to all who attended – there was a great turn out! For those who were unable to attend we have put together a website of the tips presented at the lunch and a few more from other authors who were not able to present. Check them out and maybe make your day a little easier!

We’ve also uploaded our next Author Spotlight video featuring Goutam Chakraborty, author of our best-selling book, Text Mining and Analysis: Practical Methods, Examples, and Case Studies Using SAS®. Here we ask him about his experience writing the book, how it changed his life, and one thing not many people know about him in 9th grade! Read More »

Post a Comment

Jedi SAS Tricks - Make This a Button in Base SAS

A recent post, Jedi SAS Tricks: The DATA to DATA Step Macro, engendered a lot of response on Twitter. One of the re-tweets included a call to action - make this a button in Base SAS!

Tweet says "Make this a button in base SAS"
Read More »

Post a Comment

What does PROC REPORT do?

SGF2016_SM_0705At SAS Global Forum in Las Vegas I was asked the question, “What does PROC REPORT do?”  It is a simple question, but I hesitated to answer.  I’m normally so deep inside the nitty gritty details of PROC REPORT that I don’t often think about what it would be like to see and use PROC REPORT for the first time.

What level of understanding do you assume when trying to describe SAS programming to a novice user? Where does one start when trying to explain any procedure in SAS?  The simplest answer I can give to the question, “What does PROC REPORT do?” does not seem to cover everything that it should.  But you have to start somewhere, right?  If I were given a second chance to answer that question I would say: Read More »

Post a Comment

A graph fit for a Prince

I was sad to hear that one of my favorite singers, Prince, died last week. This blog post describes a graph I created to show his legacy.

Prince was at the height of his popularity when I was in high school and college, which were the formative years for much of my musical taste. And if my life had a soundtrack, I would probably have several of his songs on it. Especially the time period when I owned this little red 1975 Corvette ...


My friend Patricia is also a big Prince fan. She's a writer who has interviewed many musicians, and has actually met Prince. Well ... at least in the spirit of Charlie Murphy's Prince skit on the Chappelle show. Is this the real Prince - I'll let you be the judge!


While feeling nostalgic, and searching out "all things Prince" on the Internet, I came upon the following interesting graph on the fivethirtyeight website. It was an eye-catching graph, but it was a bit confusing, and didn't quite do Prince justice, imho. At first, I thought the songs inside the Prince-symbol had some special significance ... but after studying it a while I decided they didn't. I also wondered which 40 songs were in the graph (Were all my favorites there? Were there perhaps some songs I hadn't heard before?) The graph didn't really enlighten me...


So I found the Billboard article with the data, imported it into SAS, and set about making my own graph ... a graph fit for a Prince! Read More »

Post a Comment

SAS training leads to certification success

Teaching SAS coding is fun. The best part of teaching is hearing success stories from candidates who earn a SAS certification after taking SAS training.

Suiru Jiang is an MBA candidate who successfully passed her SAS certification exam. She took my five-day SAS programming fast track course at Goodman School of Business at Brock University.

I recently sat down with Suiru to ask about her experience to hopefully provide a perspective to other candidates prepping for the certification exam.Suiru_Jiang

Question 1: Why did you want to get SAS certified? What do you think are the benefits to certification?

Suiru:  SAS is a powerful statistical platform which can access a variety of data. SAS is derived from the English language which makes understanding as well as application of this programming language easy.

Big data is the future trend. Data analysts have bright prospects. The biggest benefits of getting SAS certified is how it opens doors to employment. SAS certification demonstrates that you can learn your job more quickly. Read More »

Post a Comment