# Resources for an R user who must learn SAS

I use R. Every day. I think in terms of data.frames, the apply() family of functions, object-oriented programming, vectorization, and ggplot2 geoms/aesthetics. I just started working for an organization that primarily uses SAS. I know there's a book about learning R for SAS users, but what are some good resources for R users who've never used SAS?

• care to say why is that book not good enough? – Eduardo Leoni Mar 8 '11 at 23:28
• @Eduardo It's in the wrong direction :-). – whuber Mar 8 '11 at 23:43
• @Steven Maybe you should start with the IML procedure which is the closest conceptually to R. At least that will get the juices going. psych.yorku.ca/lab/sas/iml.htm But, I admit there is probably a need for that reverse tome. – Ralph Winters Mar 9 '11 at 0:19
• On a side note, I code a little in R and mostly in Python and just joined a company that heavily uses SAS. I am making some great inroads after 5 months of getting Python included in our toolbox, displacing SAS in some areas. As you navigate the waters, we should consider starting a Wiki about "How to get your company to adopt something other than SAS/SPSS for analytics". I am finding the cultural issues are far more difficult than simply evangelizing the language or performance differences. – Josh Hemann Mar 10 '11 at 20:29
• If you decide to follow up on @RalphWinter's suggestion, you might like the SAS/IML blog: blogs.sas.com/content/iml From SAS/IML you can also call R functions, which might help you in the transition: blogs.sas.com/iml/index.php?/archives/… – Rick Sep 2 '11 at 19:26

15 months ago, I started my current job as someone who had been using R exclusively for about 3 years; I had used SAS in my first-ever stats class, loathed it, and never touched it again until I started here. Here's what has been helpful for me, and what hasn't:

• Colleagues' code. This is the single most useful source, for me. Some of it was very good code, some of it was very bad code, but all of it showed me how to think in SAS.
• SUGI. Though they are often almost unbearably corny, there is a vast wealth of these little how-to papers all over the Internet. You don't need to look for them; just Google, and they'll present themselves to you.
• The O'Reilly SQL Pocket Guide, by Gennick. I dodge a lot of SAS coding by using PROC SQL for data manipulation and summarization. This is cheating, and I don't care.
• This paper explaining formats and informats (PDF). This is without a doubt the least-intuitive part of SAS for me.
• UCLA's Academic Technology Services' Statistical Computing site. UCLA has heaps of great introductory material here, and there's a lot of parallel material between its R and SAS sections (like these analysis examples).

• Anything I've ever read that is intended for people transitioning between R and SAS. I have the "R and SAS" book from Kleinman and Horton, which I've opened twice only to not find the answers I needed. I've read a few other guides here and there. Maybe it's just my learning style, but none of this stuff has ever stuck with me, and I inevitably end up googling for it once I actually need it.

You'll be okay, though. Just read your colleagues' code, ask questions here and on StackOverflow, and - whatever you do - don't try to plot anything.

• @Matt - I think Proc SGPLOT roxxx. – suncoolsu Mar 9 '11 at 2:33
• @Matt Parker - I have not found a SAS general resource book I have found satisfactory. Do you have any suggestions or do you simply rely on internet searches? – Andy W Mar 9 '11 at 4:39
• @Matt I found The Kleinman and Horton book pretty useful. And, like @suncoolsu I find the new SGPLOT, SGSCATTER and SGPANEL PROCS are much better than the old SAS graphics system. And SGRENDER allows a LOT of control over graphics. And the ODS graphics that come with each statistical PROC are very nice defaults. – Peter Flom Mar 9 '11 at 10:22
• @Matt (+1) Nice response. I also came across this blog which provides illustrated examples of R/SAS: sas-and-r.blogspot.com. – chl Mar 9 '11 at 10:37
• Thanks for the pointers on those new procedures, @suncoolsu and @Peter - I've only recently been upgraded to 9.2, so I'll definitely check that out. Also, just to clarify: I don't think "SAS and R" is poorly done, it has just never really helped me when I was in need. @chl, the blog you found is actually the companion blog to this book, which is a really nice addition by the authors. – Matt Parker Mar 9 '11 at 16:10

A couple things to add to what @matt said:

In addition to SUGI (which is now renamed SAS Global Forum, and will be held this year in Las Vegas) there are numerous local and regional SAS user groups. These are smaller, more intimate, and (usually) a lot cheaper. Some local groups are even free. See here

SAS-L. This is a mailing list for SAS questions. It is quite friendly, and some of the participants are among the best SAS programmers there are.

The book SAS and R: Data Management, Statistical Analysis and Graphics by Kleinman and Horton. Look up what you want to do in the R index, and you'll find how to do it in SAS as well. Sort of like a inter-language dictionary.

• I'll second the recommendation for the Kleinman book. – Josh Hemann Mar 10 '11 at 20:24

In addition to Matt Parkers excellent advice (particularly about reading colleagues code), the actual SAS documentation can be surprisingly helpful (once you've figured out the name of what you want): http://support.sas.com/documentation/

And the Global Forum/SUGI proceedings are available here: http://support.sas.com/events/sasglobalforum/previous/online.html

• I'll second the vote for the SAS documentation, it really is pretty good (and voluminous). – Hong Ooi Mar 10 '11 at 0:16