Which stores will Walmart close in 2016?

You probably heard the recent announcement this past Friday that Walmart will be closing 269 stores. Are any closing near where you live? This blog shows some really cool SAS maps to let you drill-down into the data!

I've seen a few maps showing which Walmart stores are closing, but they just didn't present the data in a way I could get my brain around. Therefore I downloaded the list, imported it into SAS, and created my own maps.

First, I plotted the data on a US map (limiting it to just the 48 contiguous states), and highlighted the states with a closing by making it a brighter color. I then set up the colored states so you could click on them and see a map of just that state. Note that the maps in this blog are snapshot images - but you can click them to see the real/interactive maps.

walmart_closings_2016

For example, if you clicked Louisiana, you would see the map below. There's a summary count in the title showing that 8 stores are closing in Louisiana, and the map shows a marker at each closing location. You can click a marker to bring up a Google map zoomed-in on that Walmart location.

walmart_closings_2016_la

Along with each state map is a summary table, showing the type of store and the street address. You can click the links in the table to go to the Google map, just like the drill-downs for the markers on the map.

walmart_table

 

I invite you to click any of the images above, to try out my interactive maps, and let me know what you think in the comments section. Or perhaps you would like to download my code, and try creating your own map!

 

Post a Comment

Making peace with storytelling and analytics

AnalyticsA number of years ago I was driving home to Alabama for the holidays. Typical of the season the driving was not easy.  It was getting dark early and the traffic was fairly heavy. I had the radio on to pass the time.  A talk show was on and the topic was Southern storytelling. The host was interviewing local storytellers.  As you would expect, it was entertaining, but about how to be a storyteller – not just stories.

The host asked one of the guests if they embellish stories. The answer was not unexpected, “Yes, of course.” I was chuckling to myself likely nodding my head with what I expected to hear and unprepared for the rest of the answer. “Of course I embellish, that is the only way to tell the truth.” Unfortunately, I did not catch the name of the talker to give proper attribution, because this sage advice needs attribution. Or perhaps this was a secret that all storytellers know, but few reveal.

As she continued with this strange response, I began to see the wisdom of the conflicting ideas. How can embellishing help you tell the truth? The storyteller explained that to properly tell a story, you have to set the mood, the feeling of the event and the emotions, the sights, the smells – everything. The listener cannot truly get those senses because they obviously were not there. Embellishment replaces the senses and gives the listener a more accurate description by increasing the experience. I experienced one of those moments of universal truth.

I have heard the advice that to explain analytics requires you to tell stories with numbers. Frankly, I have never felt comfortable with the advice. It seemed trite and incomplete. It is not unusual to hear advice like this, most of the advice you read on presenting analytics seems to be good, but flimsy without a core or foundation we normally have for other aspects of analytics.  Similarly, this storytelling with numbers advice needed a core reasoning for me to embrace it. Read More »

Post a Comment

Need help picking lottery numbers?

What strategy do you use to pick your lottery numbers? Do you suspect that the future winning numbers might be somehow related to the past winning numbers? If so, this blog's for you!

The Powerball lottery jackpot is up to about $1.4 billion - the largest lottery jackpot there has ever been ... in the history of the world!

If you've never played the lottery before, here's what a lottery ticket looks like (thanks Paul!) Basically, you pay $2 and pick 5 numbers (two of which I've scribbled out in pink in Paul's ticket below, so you won't know his exact lucky number!) And if those 5 numbers are drawn, you win. If more than 1 person also picks the same winning numbers, then you have to split the prize with them.

lottery_ticket_paul

So, how do you go about picking your 5 lucky numbers? What's the min & max number range? Currently, you can pick numbers 1-69. The number range has changed over the years - in 2014 it was 1-59, and in 2005 it was 1-55. Here's a graph that shows the changes since 1998:

powerball_lottery

But what numbers are 'lucky'? Well that's the million dollar question! ... or actually, the 1.4 billion dollar question! Some people use birthdays, addresses, gym locker combinations, age, or phone number digits. Some people believe it's pretty well random. Some people believe numbers that have been picked in the past are also more likely to be picked in the future (because of the weight of the paint on the balls, etc). Or some people believe that if a number hasn't been picked in the past, then it is 'due' to be picked soon. Read More »

Post a Comment

5 new SAS Press titles for the new year

Whether your New Year’s resolution is to get SAS certified or to become a more advanced SAS programmer, we’ve got you covered with these upcoming SAS Press books, many of which will be making their bookshelf debut at SAS® Global Forum 2016 in fabulous Las Vegas!

  1. The SAS® Programmer’s PROC REPORT Handbook: Basic to Advanced Reporting Techniques by Jane Eslinger includes everything you need to build perfect reports, every time. Ever wonder how to add a logo to your reports, or how to use PROC DOCUMENT in conjunction with PROC REPORT? Look no further! This handbook has it all! (1st Quarter 2016)eslinger
  2. Multiple Time Series Modeling Using the SAS® VARMAX Procedure by Anders Milhoj will teach you the time series analytical possibilities that SAS offers today. This book teachers beginning to advanced users how to use PROC VARMAX to analyze a time series and build advanced models! (1st Quarter 2016)
  3. Clinical Graphs Using SAS® by Sanjay Matange provides the knowledge, the code, and helpful examples to create common clinical graphs with SAS graphics tools such as the SG Procedures and the Graph Template Language. It teaches you how to create the complex health and life sciences graphs you need to analyze biostatistics data, clinical data, and submit drug approvals to the FDA. With the addition of new features in SAS 9.4 and helpful examples in this book, these graphs become positively easy to make! (1st Quarter 2016)matange_webcover
  4. The DS2 Procedure: SAS® Programming Methods at Work by Peter Eberhardt teaches you how to speed up your processing by using DS2 programming to perform work in threads and process observations in parallel. This book introduces you to Object Oriented Programming methods, DATA programs, user-defined methods, predefined packages, and threaded processing. DS2 is the next wave of programming languages in SAS that will have you simplifying your big data problems in a snap! (1st Quarter 2016)eberhardt_webcover
  5. Exploratory Factor Analysis with SAS® by Erin S. Banjanovic and Jason W Osborne demystifies exploratory factor analysis in SAS with an applied and user-friendly approach, using real-world examples with real data. It provides guidance for implementing best practices for EFA in SAS and interpreting the results for end users. This book reviews each of the major steps in EFA: data cleaning, extraction, rotation, interpretation, and replication. Faculty teaching with this book will love this book for their classes, and individual readers can learn at their own pace, practicing and reinforcing the concepts as they go! (2nd Quarter 2016)factor analysis

Read More »

Post a Comment

Is holiday spending up or down?

I was reading through Deloitte University Press' 2015 Holiday Spending survey - the results were interesting, but their graph made you jump through mental hoops to understand the data. So of course I used SAS to create a simpler version of the graph, so you'll have more time for holiday shopping!

But before we get to the nitty-gritty graphics, I wanted to share a picture of my friend Joy's tree. Notice that she decorates it with a "mermaid motif" which I think is quite unique and beautiful. (And speaking of holiday shopping, aren't those some nicely wrapped presents under the tree!?!)

tree_and_presents

And now, back to the analytics...

Here's Deloitte's graph. Notice that the title and area labels are not easy to read, and the graph seems a bit cluttered (both with the text labels on every data point, and the intersecting graphs). Also, I always discourage showing multiple area-under-line charts together, because it's difficult for the user to quickly know whether the charts are overlaid, or stacked. Also, it's not evident which color is 'good' and which is 'bad'.

us_holiday_spending_orig

After a bit of studying, it appeared that the "spend more/same" and "spend less" should always add up to 100%, therefore a stacked 100% bar chart seemed to be a much more intuitive way to graph this data. I added a reference line to make it clear where 50% is, because that's an important number. Here's my SAS graph, which is much easier to understand quickly:
Read More »

Post a Comment

Quote confusion: How do quotes and macro work together?

The English language, a mishmash of words from many tongues and with rules that aren’t always consistent, sometimes causes people to stumble when writing quotes. There are numerous humorous websites with examples of incorrectly-used quotes on signs saying things like “Sandwiches Prepared ‘Fresh’,” or “Help ‘Wanted’ – Please ‘inquire’ within”.

In SAS, we sometimes use quotes incorrectly as well, and macro neophytes often ask how to know when quotes are needed around macro variables, and when they’re not. Should we quote all our macro variables (no), and if only some, which ones? To answer I say two things:

  1. with regard to quotes, your code should look the same whether there are macro variables inside them or not,
  2. if there are quoted strings inside which you insert macro variables, be sure the quotes are double.

Consider the following code, which contains a WHERE statement referencing both a character and a numeric value, and no macro triggers:

data work.test;
  set sashelp.class;
  where sex='F' and height < 63;
run;
 
proc print data=work.test;
  title 'Girls Below 63 Inches';
run;

Next, I add two %LET statements, and several macro variable references. Notice however that I neither add nor remove any quotes, instead the quotes stay in the same places – I simply change single quotes to double quotes:
Read More »

Post a Comment

Release the fourth one first, they did!

If you're just a casual Star Wars fan, you might be confused about the order of the movies. Here's a SAS graph that will help you make sense of it all, before Episode VII comes out this week!

star_wars_releases

 

If you'd like to see how I created this custom graph, here's a link to the SAS code. There are all kinds of neat tricks demonstrated in the code, such as: annotating bars and labels, html hover-text and drill downs, date axis by 5-year increments, and the roman numeral numeric format.

And in the "random pictures from my friends" department ... I asked a handful of my co-workers if they had any Star Wars toys in their office. Within about 1 minute, I got a reply from Gordon that he just so happened to have a Yoda golf driver head cover! (Yoda is kind of a 'thing' here in SAS R&D, if you hadn't heard!)

yoda

Read More »

Post a Comment

New SAS University Edition titles from SAS Press

IMG_2113With the huge success of SAS® University Edition, we were very excited at the opening market for SAS titles and opportunities for new books. This year, we published three titles to help get you up and running with programming in SAS University Edition, explore the power of running statistical analysis in SAS, and apply your new skills in business.

An Introduction to SAS University Edition, by bestselling author Ron Cody, provides a comprehensive guide to getting started with SAS University Edition. It leads you through how to use it to solve problems, introduces the point-and-click interface of SAS Studio, and teaches you how to write your own SAS programs.

The newly released Essential Statistics Using SAS University Edition, by Geoff Der and Brian Everitt, demonstrates how to use SAS University Edition to apply a variety of statistical methodologies, from the simple to the not-so-simple, to a range of data sets. The book covers techniques such as multiple linear regression, logistic regression, and Poisson regression.

Business Statistics Made Easy, by Gregory John Lee, Wits Business School, helps readers to learn or refresh core statistical methods for business with SAS and practically approach real business analytics issues and techniques. The book avoids complex mathematics in favor of easy-to-follow explanations. Read More »

Post a Comment

Get dedicated to your learning with these top-selling SAS Press books of 2015

Top Learning BooksContinuing your education can be daunting. Just thinking about all of that time that could be spent relaxing and you have to carve out two hours to study…really!

Trust me when I say, I feel your pain. BUT, you will reap the rewards ten-fold, I promise.

Check out these top 10 best-selling books from SAS Press that will help you with that studying:

Read More »

Post a Comment

How do your favorite SNL cast members stack up?

Saturday Night Live has been on television for about as long as most of us have been old enough to stay up and watch it (since 1975). Therefore, when I saw that Rolling Stone had ranked all the cast members throughout the show's history, I knew this was going to be an interesting chunk of data to analyze!

I assume that if you're reading this article, you have watched Saturday Night Live (SNL) before. And if you're an SNL fan, you will thoroughly enjoy the Rolling Stone article ranking all 141 cast members -- it's a great read, and contains lots of interesting and entertaining information. But, it only contains text and photographs ... all this data, and no graphs.

So I rolled up my sleeves, and got to work. First I went through the entire article and copy-n-pasted the data for each cast member into a text file that I could read into SAS (as with many graphs, getting the data is the tedious part). Note what the article says about the ranks -- "We're not ranking their careers, merely their stints on SNL."

For my first graph, I wanted to show the range of years for each cast member, as well as their rank. I did this by plotting a marker at their starting and ending years, and annotated a line to connect them. In general, it seems that the ones with better rankings had longer tenures, and there seem to be several 'clusters' of short-tenure cast members. Also, there seem to be fewer very-low ranking cast members in recent years. (You can click the image below to see the interactive version, with html hover-text for each of the plot markers.)

snl_ranked

Next, I replaced the connecting lines with plot markers, such that there was a separate marker for each year. This creates more of a scatter plot, and is a stepping stone to performing some additional analytics on the data: Read More »

Post a Comment