# Tag Info

57

I think there are several issues (in ascending order of possible validity): 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 ...

31

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 ...

28

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 ...

23

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 ...

20

Nobody has suggested the reason it is preferred is plain idiocy. Here's two quotes I recently came across: "Using open-source software such as R was out of the question – we couldn't guarantee a perfectly repeatable outcome" and "We would be unable to provide any support for this as it is open source software" Two minutes with these people ...

17

Type III SS depend on the parameterization used. If I set options(contrasts=c("contr.sum","contr.poly")) before running drop1(Data.lm,~.,test="F") I get exactly the same type III SS as SAS does. For the R-community dogma on this issue, you should read Venables' Exegeses on linear models ( http://www.stats.ox.ac.uk/pub/MASS3/Exegeses.pdf ) See also: How does ...

15

The exact equation is given in: Venables, W. N. and Ripley, B. D. (2002) Modern Applied Statistics with S. Fourth Edition. Springer-Verlag. I'll give you an example: ### simulate some data with AR(1) where rho = .75 xi <- 1:50 yi <- arima.sim(model=list(ar=.75), n=50) ### get residuals res <- resid(lm(yi ~ xi)) ### acf for lags 1 and 2 ...

14

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: Helpful: Colleagues' code. This is the single most useful source, for me. Some of it was ...

14

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: 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 ...

11

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 ...

9

Full disclosure: I work at SAS. The IML blog is http://blogs.sas.com/iml. Both languages are matrix-vector languages with a rich run-time library and the ability to write your own functions. For data analysis tasks and matrix computations, they both provide the neccessary tools to help you analyze your data. The SAS/IML syntax is very similar to the SAS ...

9

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 ...

9

(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 ...

8

The naive way to calculate the auto correlation (and possibly what Excel uses) is to create 2 copies of the vector then remove the 1st n elements from the first copy and the last n elements from the second copy (where n is the lag that you are computing from). Then pass those 2 vectors to the function to calculate the correlation. This method is OK and ...

8

You would want to use a flexible formulation that would capture non-linearity automatically, e.g., some version of a generalized additive model. A poor man's choice is a polynomial $x_k$, $x_k^2$, ..., $x_k^{p_k}$, but such polynomials produce terrible overswings at the ends of the range of their respective variables. A much better formulation would be to ...

8

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.

8

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 ...

8

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.

7

For the first question, the default method in SAS to find the df is not very smart; it looks for terms in the random effect that syntactically include the fixed effect, and uses that. In this case, since trt is not found in ind, it's not doing the right thing. I've never tried BETWITHIN and don't know the details, but either the Satterthwaite option ...

7

Yes. After all it is about your intuition. R would suit you fine. Coding will be quite easy for you if you know Java already (or any other "standard programming language" for that matter). Computational statistics deals with the design of algorithms for implementing statistical methods, probably that is the closest to what you try to describe here. Have ...

6

Try the examples under dendrogram. You can make it as interactive as you want. require(graphics); require(utils) hc <- hclust(dist(USArrests), "ave") (dend1 <- as.dendrogram(hc)) # "print()" method str(dend1) # "str()" method str(dend1, max = 2) # only the first two sub-levels op <- par(mfrow= c(2,2), mar = c(5,2,1,4)) plot(dend1) ## ...

6

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. ...

6

This doesn't sound like a missing data problem to me: it sounds like a question of model structure. Distilling it to its essence, it seems you have two independent categorical variables gender ($X$, say) and "channel" ($Y$) and a binary response ($Z$). Conceptually the model is $$logit(\Pr(Z=1)) = \beta_0 + \beta_1 X + \beta_2 Y + \varepsilon$$ when $Y$ ...

6

I use table and prop.table, but CrossTable in the gmodels package might give you results even closer to SAS. See this link. Also, to generate "descriptive statistics for multiple variables at once," you would use the summary function; e.g., summary(mydata).

5

It seems like you need an introduction to regression. People made book recommendations here. Free book recommendations here. It's hard to make sure you're doing the analysis right when we don't know what the variables are or what the goal is. But based on the output, I can tell you that your second regression specification looks better than your first. ...

5

Though ridge regression looks at first like simple algorithm the devil is in the details. Apparently original variables are scaled, and parameter $\lambda$ is not the parameter you would think it is given the original description. From what I gathered reading the reference given in R help page of lm.ridge there is no one agreed way of doing ridge regression. ...

5

It has the same meaning as any other confidence interval: under the assumption that the model is correct, if the experiment and procedure is repeated over and over, 95% of the time the true value of the quantity of interest will lie within the interval. In this case, the quantity of interest is the expected value of the response variable. It is probably ...

5

I would recommend going through a self-study course such as the UCLA website and specifically the SAS Starter Kit. If you learn better within an interactive environment, I would suggest checking out online course offerings such as the World Campus SAS courses offered at Penn State University (Stat 480, 481, & 482). Update: Sorry should've read more ...

5

Summarising data in base R is just a headache. This is one of the areas where SAS works quite well. For R, I recommend the plyr package. In SAS: /* tabulate by a and b, with summary stats for x and y in each cell */ proc summary data=dat nway; class a b; var x y; output out=smry mean(x)=xmean mean(y)=ymean var(y)=yvar; run; with plyr: smry <- ...

5

Having spent some time on this code, it appears to me as though it basically: 1) Does a logistic regression with right hand side b0_f + b1_f*x1 andy > 0 as a target variable, 2) For those observations for which y > 0, performs a regression with right hand side b0_h + b1_h*x1, a Gamma likelihood and link=log, 3) Also estimates the shape parameter of the ...

Only top voted, non community-wiki answers of a minimum length are eligible