R vs SAS, why is SAS prefered by private companies?

I learned R but it seems that companies are much more interested in SAS experience. What are the advantages of SAS over R?

-
It's tragic, but true I fear... – gung Aug 6 '12 at 17:59
A medical statistician once told me, that they use SAS because if they make mistakes due to software bugs and it comes to lawsuits, SAS will recompensate them. R comes without warranty. – Momo Aug 6 '12 at 20:15
@Momo R comes without warranty, true, but I would like to see a reference that SAS has that strong of one. I could not find the SAS license text on their website, but was able to find something for one component: support.sas.com/documentation/onlinedoc/sasc/doc650/common/… That has a 90 day warranty on the media that the software is shipped on and an all caps disclaimer of any other warranty. Please give a reference other than "someone once told me". – Brian Diggs Aug 6 '12 at 20:54
Was just meant as an anecdote, I like the pragmatic cynicism of the comment. But glad you checked, I never cared. – Momo Aug 6 '12 at 21:46
SAS comes with the same warranty as R: none. – Frank Harrell Jan 8 at 13:26

I think there are several issues (in ascending order of possible validity):

1. Tradition / habit: people are used to SAS, and don't want to have to learn something new. (Making it more difficult, the way you think in SAS and R is different.) This can apply to anyone who might have to send you code, or read / use your code, including managers and colleagues.
2. Distrust of freeware: I've had several people say they aren't willing to accept results from R because you don't have a for-profit company vetting the code to ensure it gives correct results before it goes out to customers, lest they end up losing business.
3. Big data: R performs operations with everything in memory, whereas SAS doesn't necessarily. Thus, if your data approaches the limits of your memory, there will be problems.

Personally, I only think #3 has any legitimate merit, although there are approaches to big data that have been developed with R. The issues with #1 speak for themselves. I think #2 ignores several facts: there is some vetting that goes on with R, many of the main packages are written by some of the biggest names in statistics, and there have been studies that compare the accuracy of different statistical software & R has certainly been competitive.

-
Point 1 gains more legitimacy if you also include "existing infrastructure" under that inertia banner. If there are existing business processes which already use SAS, then there is a transition cost with changing. If this is the case, it is not choosing between SAS and R, but choosing between staying with SAS and changing to R, which can have a different conclusion. – Brian Diggs Aug 6 '12 at 18:16
Oh, I totally believe that, and have been in these conversations myself. They apparently are not aware of what I said, though. As with pretty much any software, the guarantee is essentially in the law of large numbers: there has been so many users that ran so many regressions that this is most likely right. Otherwise, people would come back and say, "Why Splus and Stata and R and SPSS all give me 1.423590278, and SAS gives me 1.4182340399?" This is usually how statistical software is being debugged in practice. – StasK Aug 6 '12 at 18:59
The point of Point 2 is that, while SOME R packages are written by experts, others are not. Who vouches for them? Who tests them? (I know they are tested that they RUN, but who tests that they work correctly?) I know, you can look at the code, but that presupposes the time and ability to look over someone else's code and verify it, often for methods that are very complex. – Peter Flom Aug 6 '12 at 19:03
Who exactly vets SAS, Stata, SPSS, code? Is there any way at all to know if the results they provide, by the methods they say they are using, are actually implemented correctly? I know from following, for example, the lme4 mailing list that comparisons to SAS come up quite regularly. But it's impossible to know if we should even be making such comparisons. Without access to the source, we have to take those companies at their word that results produced by their software are actually valid. Frankly, I prefer to have the ability to review the software code I use. – Jason Morgan Aug 7 '12 at 1:17
True, but it's hard to penalize a statistical computing system for its comprehensiveness. Or to say it another way, R's way of doing something is better than another system's way of not doing it. – Frank Harrell Aug 7 '12 at 12:29

On top of what gung has correctly identified here, the biggest issue in the corporate world is legacy. And when you have a good quality production code that is known to do the job, you don't change it. SAS was out there since 1970s, and at the time it was the only effective, by then-standards, scripting statistical language. The amount of production code accumulated since then in SAS in pharma and government is unimaginable, tens of thosands of human years. Rewriting this in R or Stata would take a few years, the resulting code will become more flexible, more efficient, more transparent, easier and cheaper to maintain, but nobody will pay for such refactoring. (My experience doing this is that my Stata code is generally about three times shorter; I once had a project converting SPSS code into Stata where I made it about 20 times shorter. For those of you who worked in maintaining your statistical packages... well, you know what that means.)

In a sense, this is a similar story with the academic publishers: they are riding a tide of the end users maintaining their subscriptions out of necessity; a university without subscription to Nature is not really a university. Free publishing via professional societies will make it cheaper, people prepare their submissions in LaTeX these days, so they are camera ready, and the same people will be providing the peer review, so there will be no quality setback on any of the dimensions. But... there's no brand name and the impact factor behind the online journals.

This sums it all up: http://scatter.wordpress.com/2011/06/28/stata-12/. Stata is preferred in economics and policy-related circles, and the more I learn SAS, the more I like Stata.

-
SAS has a horrific syntax that started with something similar to JCL (IBM's Job Control Language) for submitting punched-card batch jobs back in the day. It's remarkable that people are still using it, really. – Wayne Aug 6 '12 at 19:33
+1 I particularly enjoyed the BlackBerry:iOS:Android:Nokia as SAS:Stata:R:SPSS analogy in the scatterplot post. – jthetzel Aug 6 '12 at 21:24
Wayne, if you have ever had given another thought about CARDS statement, you realize that SAS is the statistical software package to work with punchcards. Stata works with rectangular data sets. R works with objects. So depending on what kind of data format you have to deal with, one may be better than others. – StasK Aug 7 '12 at 3:36
One big point in the legacy is things like FDA approval or similar regulations. Industry I've spoken to won't touch anyhing(TM) after they got through that to be sure they don't have to go through the whole process again. And that is a big argument in terms of money. – cbeleites Aug 11 '12 at 14:50

In the pharmaceutical industry SAS is used because it is what the FDA uses and likes. There are some serious reasons though. Results are traceable and the output has a time stamp. FDA statisticians can check what you get. It is very good for database management and it is reliable software. Of course many of the attributes of SAS can be argued to be present in other software packages including R and SAS is expensive. Still I think anyone wanting to be an applied statistician working in industry will be best off to at least learn how to program in SAS. Use R or STATA if you prefer but know SAS. When you work for a company that wants you to use SAS they will pay for the licensing.

-
Here's some additional information on the FDA's thinking with regards to R: blog.revolutionanalytics.com/2012/06/fda-r-ok.html – Matt Parker Aug 6 '12 at 19:26
I'd argue that R results are just as traceable and capable of being timestamped, and the link above suggests that at least some FDA personnel would be comfortable replicating results in R. No doubt that knowing SAS opens a lot of doors; I'm glad I know both SAS and R. – Matt Parker Aug 6 '12 at 19:29
The R Foundation published a paper in 2008 discussing the use of R in regulated clinical trials. It should be a good reference for collaborators who are skeptical of using R. – jthetzel Aug 6 '12 at 19:52
i agree that there is a move to use R more in clinical research and that many believe that R can be made every bit as traceable as SAS. – Michael Chernick Aug 6 '12 at 21:12
The FDA are quite vocal about NOT endorsing or requiring any one software to be used. It's historically true that most submission have used SAS, so the FDA have lots of SAS knowledge, but they have been very quick to embrace other systems, using R for quite a lot of recent work, especially around meta analysis. – PaulHurleyuk Aug 6 '12 at 21:20

In addition to the good answers so far, I'd add the embarrassment factor. If you spend hundreds of thousands of dollars last year on SAS and SAS support, and you propose spending nothing for R, with extremely low support prices (Revolution, etc), someone up the chain's going to ask why. Was it a mistake to spend so much money last year when R existed last year? Or is it a mistake to drop professional software for something created by a group of volunteers?

Once the problem's framed in that manner, it's a lose-lose proposition, so perhaps better to not bring it up.

-
This is perhaps the most cynical answer on cross validated. +1 – probabilityislogic Jan 7 at 13:12
@probabilityislogic: Thanks! To be clear, this is more of a comment on poor higher-level management than on the people who use the software. I've worked in places where there really was the attitude (at higher levels), "Hmmm... you didn't spend all of the money we budgeted for you this year. Obviously you can get by on less money, so we're cutting your budget for next year and giving the extra to the department who overspent." Dilbert Rules. – Wayne Jan 7 at 15:31
"You did not spend the money..." -- that's exactly how the Soviet planning system used to work, from my firsthand knowledge. – StasK Jan 9 at 16:19

Nobody has suggested the reason it is preferred is plain idiocy. Here's two quotes I recently came across:

and

"We would be unable to provide any support for this as it is open source software"

Two minutes with these people would show them how wrong they are.

-
Two minutes with which people? Without references it's almost as if you just made those quotes up. – David Heffernan Aug 7 '12 at 7:21
sas.com/news/preleases/castle.html for the first, and the second was from a local council after a request from a student to have R on their council-supported laptop. – Spacedman Aug 7 '12 at 8:03
That's better. Surely you can edit these links into the answer. – David Heffernan Aug 7 '12 at 8:19
the second quote seems fine from a council IT department, they can't be expected to support all possible open source software that a customer might use, hence the blanket warning. I think the worst anti open source quote I've heard was from SAS saying soemthing like 'would you trust a jumbo jet designed in open source, an engine might drop off' – PaulHurleyuk Aug 7 '12 at 12:37
@PaulHurleyuk: +1 The quote was “We have customers who build engines for aircraft. I am happy they are not using freeware when I get on a jet.” by a SAS marketing director in this New York Times article on R. The SAS representative clarified her remarks in a later blog post. – jthetzel Aug 7 '12 at 12:53

I have worked as effectively a SAS programmer for the last seven years, next to me a co-worker has been programming SAS longer than I have been alive. As noted here, there is a massive amount of inertia/legacy behind SAS; but SAS just like R is a way to a means, not the means itself.

SAS is extremely efficient at sequential data access, and database access through SQL is extremely well integrated. PROC's are very well documented, but unfortunately not-entirely standardized with notation (PROC OPTMODEL and IML are two examples). It is a bit clumsy when it comes to writing complicated code, and not as elegant for parallel code. I have also found importing csv files to be a source of great misery at times and prefer to just dump it to R first then to a database.

Although SAS does have interfaces to shared objects and dll's you don't get nice access to any header files or anything like that, and code distribution also isn't available through happy packages.

There is however little concern about someone including some esoteric now-defunct or broken package in your code that you now need to maintain, and the quality of the code in SAS tends to be uniformly excellent (R core code is also excellent, and also freely available to anyone).

As mentioned before SAS is also extremely expensive, but it is a good tool that I go to when I know there is a canned procedure that works well for my needs.

R + SAS + mysql with a little bit of perl to glue to them together works amazingly :)

-
The remark about maintaining old packages goes just as well for a user written macro or an old proc that sas hasn't updated. – probabilityislogic Jan 7 at 13:05

Customer support.

I once had a chat with a friend working in a company specializing in installing servers, and he then explained to me why big companies always opt for Microsoft products rather than go open source. The advantage Microsoft has over its open source competitors is the customer support. If something goes wrong with the product, the company can call Microsoft, big companies even have personalized support for them. Not so with open source software.

I think that is the exact same reason SAS is getting precedence over R.

-
revolution R (or other companies)? – Ben Bolker Aug 9 '12 at 15:09
I think these comments are not correct. In the server world, open source rules, and the Apache web server is the most popular web server. – Frank Harrell Aug 11 '12 at 13:47
I never said he was talking about servers. Rather about products like Microsoft Office. I only mentioned that he is working in the server world. – Raskolnikov Aug 12 '12 at 10:35

Whilst its quite pessimistic, my answer would be that the kind of people who make sweeping decisions in corporations like 'we just use SAS' are also the kind of people who don't trust what they don't understand, and automatically think the value of something is directly proportional to the amount of money you spend on it. This leads them to prefer paying for SAS rather than spend time investigating alternatives.

-

I think this quote from Anne H. Milley sums up the way a lot of people feel about R:

We have customers who build engines for aircraft. I am happy they are not using freeware when I get on a jet.

Unfortunately, I think this misconception (free==inferior) is common in the general public.

-

The reason I understood to be the most convincing was that SAS has an extensive library of vertical business specific modules that people in these verticals all use, so it is somewhat of a lock-in.
But also that SAS has addressed the needs of these vertical segments in business and optimized around their needs - optimized in the sense of "user doesn't have to do a lot of extra work to get the results". I am not a SAS user, so this is not meant as a biased defense of the SAS business strategy.

-

I don't think application security has been mentioned. This question was raised in Stack Overflow but dropped since it was off topic.

I collaborate with the the Swedish National Board of Health and Welfare that use SAS. When I talked to their statisticians (that like R) they claim that their IT-folks prefer SAS since they don't trust the packages downloaded in R. My wife also works in SAS and her institution often claims the same issue...

I would love to see some comments on this issue. I've done a quick search but haven't found any good references...

-
What is the alternative to downloading a package that provides new capabilities (as most R packages do)? Is it to home grow those capabilities? Is that more reliable? – Frank Harrell Aug 11 '12 at 18:59
@FrankHarrell I agree, but I think this may be an easy area for the R developers to target and improve. A simple solution could be different levels of security for packages - if a package has a system call or connects on its own to the Internet the package should have a higher clearance. This could allow installations with only low-level clearance in those institutions/companies where a data leakage is of major concern. I as a user could then also do an extra check when I choose to install a high clearance package. (Btw, when is your book (RMS ver 2) scheduled?) – Max Gordon Aug 11 '12 at 20:38
I'm hoping that the 2nd edition of RMS will be available in just over a year. – Frank Harrell Aug 12 '12 at 13:48

(slightly off topic): viewing it the other point round: some of the advantages R has in academia don't apply to industry.

E.g. in academia it is a clear advantage if you can tell the students to go and get the software and work at home. In industry, you're usually not supposed to take any data home with you...

Neither are you supposed to try out a few things(TM), download tons of packages (even if reputable & tested), use cutting-edge methods. Instead you're usually expected to stick to methods & code that have been used for years and where the behaviour is known for ages. You wouldn't win much academic merits with that.

And of course, as has been mentioned: noone is going to risk redoing all kinds of regulatory approval for the sake of switching to R. From what I've seen that's less about R and more about the enormous costs + work for getting regulatory approval.

-
There is nothing that needs to be done to redo regulatory approval for the sake of switching to R. – Frank Harrell Aug 11 '12 at 18:58
@Frank: maybe we're thinking in different scenarios: I guess you're possibly thinking of a new trial (and there your're right) - I'm more thinking in terms of process analytics (chemical + statistical analysis) of ongoing production. AFAIK, you cannot just switch your data analysis there (but then, that's not SAS country) . But I may be wrong. – cbeleites Aug 11 '12 at 19:18
I'm not familiar with that world but I suspect that scientists have more freedom than they think. – Frank Harrell Aug 12 '12 at 13:49

So I use both R and SAS - admittedly in academia - but there are a couple reasons that I tend to head toward SAS at times:

1. Better documentation. R is getting better at this, but documentation, especially the official documentation, is often kind of terrible and opaque. Beyond that, SAS is supported by a massive infrastructure of books - the use R! series is helping this in R, but it's not quite there yet. I can turn to Paul Allison's Survival Analysis Using SAS, or Categorical Data Analysis Using SAS or the book I have on Monte Carlo methods using SAS and I have a book clearly written in a fairly consistent style for the language I'm using.
2. Inertia. This isn't just "companies are lazy" - inertia has value too. There's institutional knowledge. So-and-so has code that does that - and does it well.
3. Packages. Some packages in R are amazing. Some packages are not. You have to go find them, evaluate them, and even then there's some leap-of-faith issues in that the package is only as good as the guy writing it. It's hard to trust that. SAS has essentially the "full faith and credit of the SAS Institute" which has a pretty solid track record.
4. Single-source support. If SAS is broken, you call SAS. If R is broken you call....?
-
"If R is broken you call....?" Brian Ripley :-) (+1 for this well argued response) – chl Aug 11 '12 at 20:28
+1, especially for points 1 and 3. – andrea Aug 11 '12 at 20:52
Regarding 4), I think there is a confounding of concepts. If you use a program and it breaks, you generally have two options. You can pay for support, or you can seek out freely available support (online community, literature, yourself). R and SAS can be compared as statistical programming languages. Both have freely available support, which can also be compared. R and SAS cannot be compared as paid support solutions... – jthetzel Aug 11 '12 at 21:16
...SAS Institute provides paid support for SAS. Companies like Revolution Analytics and TIBCO (S+) provide paid support for R. If you want to compare paid support solutions for R and SAS, you should compare SAS Institute to Revolution Analytics and TIBCO, not R. The confusion, I believe, arises from the tight integration of the SAS language with the SAS Institute and the non-integration of the R language with R-related corporate support and education. – jthetzel Aug 11 '12 at 21:17
@jthetzel I don't think its "confusion". SAS the language is tightly coupled with SAS the service. Any platform SAS works on has support from SAS. This is not true for R - support and the language are decoupled, there may be no help for you depending on platform (try talking to Revolution sometime while not using Windows or RHEL...), and they won't necessarily take responsibility for RandomPackage's errors, where as SAS will support PROC Arbitrary. – EpiGrad Aug 11 '12 at 21:22

One issue does not seem to have been addressed explicitly: ass-covering. If you go with SAS and things blow up, the decision maker can always say that he bought state-of-the-art software, and how was he to know it would break? If he decided to go with R, this argument will be harder to make. Yes, this is related to the inertia argument already mentioned here.

A few decades ago, they used to say that "noboby ever got fired for buying IBM", which has been called the greatest marketing phrase ever.

-

Being the big commercial product that SAS is, there's a strong and coordinated effort by payed salespersons to promote it. I don't think that efforts to promote the usage of R can match these.

-
Yes, people have to some extent discover R on their on. But much of the issue comes down to inertia of learning a new language. New languages are always coming out that have advantages over older languages yet users cling to the old languages (witness COBOL). Programming in SAS is hugely inefficient, requiring perhaps double the number of programmers to do the same job as R, but SAS experts are happy to hum along on their merry way and companies are afraid of the kind of disruption that would save them millions of dollars in salaries. – Frank Harrell Jan 8 at 13:33

As a user of both SAS and R, I would say the biggest reason we use SAS over R (when we do) is its ability for sequential processing. We only need machines with no more than 4GB RAM to process 15 years worth of data. I would need a much larger machine using stock R and I have not tried to migrate the SAS code to run with Revolution R.

-
+1, although it's worth noting that there are a few ways to work with larger-than-memory datasets in R (bigmemory, ff, chunking data from a database, a wide range of distributed computing options). But all of that takes setup; SAS will indeed just chug through whatever you throw at it, which is a real advantage. – Matt Parker Jan 16 at 17:58

I once worked for a consulting company that gave SAS assistance to a large chip manufacturer in the Silicon Valley. Our contact person at the company told us that he got an offer by another company to give them the exact same consulting, by using a different software which covers all areas covered by SAS and which would cost the company a fraction of what SAS was charging them (\$30,000 as opposed to \$1,000,000). The contact person considered what to do and decided against informing his boss about the offer because he feared getting fired for using SAS in the first place and not considering cheaper alternatives. Instead, he insisted that our consulting company give their company a big break in our consulting fee. Our company agreed.

-

I look at Open Source or licenced software like this, be it SAS or anything else. My IT department is there to provide a service to our business. The company earns no money from IT, only from the business IT supports. The business has annual revenues of \$16 Billion. IT costs around \$200 million a year. If money was the issue I would cut costs, but if I save 10% (\$20 million) of my budget, will the business notice? Will they just reduce my budget next year? If the IT fails the business loses revenue, how much will vary on the nature of the failure. Parts of the business may no longer earn revenue. If a product like SAS fails, I can sue under a contract. If an OSS product fails, I cannot. I will not recover my \$16 Billion, but I may get some back, and realistically with SAS, you are unlikely to lose the lot. The difference in price versus cost has to justify any additional perceived risk to the business. Sometimes it is cheaper to stick with SAS than to retrain. Sometimes there are higher priority issues, so companies stay with SAS. Some companies do not need the full functionality in which case alternatives are viable. Some do not need the support and again the alternatives are viable. If you meet the business requirements then either options are valid, if you want to provide support for a business you need to look at the total cost of ownership over 5-10 years, the ability to recruit experts in the tools, stability in the product so you don't have to rewrite everything with each new release, the training courses available to skill up, the size of the potential skills available in your region... Often the biggest problems with OSS come about through the poor architecture of the products, look at Linux when 64 bit processors came out, look today at MySQL was recently ported but without support for secondary indexes which is coming later...

-
I don't follow your reasoning. The amount of money wasted paying programmers to program in an archaic language (SAS) vs. modern free languages is stunning. – Frank Harrell Apr 15 at 15:25

Why would a major drug company even want to convert to R from SAS? SAS costs millions but it is nothing to a drug company. However, converting all the stable reporting systems from SAS to R would cost 50-100 times more.

SAS has phenomenal support system: every time I needed help they were able to provide it within few hours.

And what exactly does R have that SAS does not: 1) better graphics...ok, it is a big one but graphics are not everything. besides R can always be used an extra tool to create some cool graphs and SAS is not too bad when it comes to graphics 2) modern and more efficient programming language. Many SAS users are not programmers and don't care about using a cool language. They just want to be able to analyze the data.

I love R but it would be insane for a big company to convert to SAS. It could make sense for smaller firms though

-