Matthew Keller
2008-Jan-15 19:45 UTC
[R] things that are difficult/impossible to do in SAS or SPSS but simple in R
Hi all, I'm giving a talk in a few days to a group of psychology faculty and grad students re the R statistical language. Most people in my dept. use SAS or SPSS. It occurred to me that it would be nice to have a few concrete examples of things that are fairly straightforward to do in R but that are difficult or impossible to do in SAS or SPSS. However, it has been so long since I have used either of those commercial products that I am drawing a blank. I've searched the forums and web for a list and came up with just Bob Muenchen's comparison of general procedures and Patrick Burns' overview of the three. Neither of these give concrete examples of statistical problems that are easily solved in R but not the commercial packages. Can anyone more familiar with SAS or SPSS think of some examples of problems that they couldn't do in one of those packages but that could be done easily in R? Similarly, if there are any examples of the converse I would also be interested to know. Best, Matt -- Matthew C Keller Asst. Professor of Psychology University of Colorado at Boulder www.matthewckeller.com
Doran, Harold
2008-Jan-15 19:54 UTC
[R] things that are difficult/impossible to do in SAS or SPSS butsimple in R
SAS cannot deal with multiple levels of random effects in a generalized linear mixed model whereas the lmer function can handle multiple levels. The SAS proc can only deal with 1 level of clustering and it is still extremely s l o w ..> -----Original Message----- > From: r-help-bounces at r-project.org > [mailto:r-help-bounces at r-project.org] On Behalf Of Matthew Keller > Sent: Tuesday, January 15, 2008 2:45 PM > To: R Help > Subject: [R] things that are difficult/impossible to do in > SAS or SPSS butsimple in R > > Hi all, > > I'm giving a talk in a few days to a group of psychology > faculty and grad students re the R statistical language. Most > people in my dept. > use SAS or SPSS. It occurred to me that it would be nice to > have a few concrete examples of things that are fairly > straightforward to do in R but that are difficult or > impossible to do in SAS or SPSS. However, it has been so long > since I have used either of those commercial products that I > am drawing a blank. I've searched the forums and web for a > list and came up with just Bob Muenchen's comparison of > general procedures and Patrick Burns' overview of the three. > Neither of these give concrete examples of statistical > problems that are easily solved in R but not the commercial packages. > > Can anyone more familiar with SAS or SPSS think of some > examples of problems that they couldn't do in one of those > packages but that could be done easily in R? Similarly, if > there are any examples of the converse I would also be > interested to know. > > Best, > > Matt > > -- > Matthew C Keller > Asst. Professor of Psychology > University of Colorado at Boulder > www.matthewckeller.com > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >
Wensui Liu
2008-Jan-15 20:30 UTC
[R] things that are difficult/impossible to do in SAS or SPSS but simple in R
Just a part list i am interested that R can but SAS can't. latent class regression R : flexmix package SAS: none generalized regression neural nets R: grnnR SAS: none generalized PLS R: gpls SAS: none mars R: mda SAS: none On Jan 15, 2008 2:45 PM, Matthew Keller <mckellercran at gmail.com> wrote:> Hi all, > > I'm giving a talk in a few days to a group of psychology faculty and > grad students re the R statistical language. Most people in my dept. > use SAS or SPSS. It occurred to me that it would be nice to have a few > concrete examples of things that are fairly straightforward to do in R > but that are difficult or impossible to do in SAS or SPSS. However, it > has been so long since I have used either of those commercial products > that I am drawing a blank. I've searched the forums and web for a list > and came up with just Bob Muenchen's comparison of general procedures > and Patrick Burns' overview of the three. Neither of these give > concrete examples of statistical problems that are easily solved in R > but not the commercial packages. > > Can anyone more familiar with SAS or SPSS think of some examples of > problems that they couldn't do in one of those packages but that could > be done easily in R? Similarly, if there are any examples of the > converse I would also be interested to know. > > Best, > > Matt > > -- > Matthew C Keller > Asst. Professor of Psychology > University of Colorado at Boulder > www.matthewckeller.com > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- ==============================WenSui Liu Statistical Project Manager ChoicePoint Precision Marketing (http://spaces.msn.com/statcompute/blog)
Greg Snow
2008-Jan-15 20:58 UTC
[R] things that are difficult/impossible to do in SAS or SPSS butsimple in R
My SAS and SPSS are rusty as well, so things may have changed, but I think it is still difficult to do simulations and general bootstrap type analyses (simulate or resample a dataset, analyze it and capture a piece (or pieces) of the output, repeate many times and end up with a vector/matrix of interest). Some aspects of graphics, adding to graphs I believe is still quite a bit easier in R/S-PLUS. Show some interactive graphics, start with simple things like the identify function, up to more complex examples (some in the TeachingDemos package as well as other places), also look at the iplots and rgl packages. I (and I expect others here) am interested in what you find, maybe you could post a link to your finished presentation after you give it. Those are the things that come to my mind first, hope it helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.snow at imail.org (801) 408-8111> -----Original Message----- > From: r-help-bounces at r-project.org > [mailto:r-help-bounces at r-project.org] On Behalf Of Matthew Keller > Sent: Tuesday, January 15, 2008 12:45 PM > To: R Help > Subject: [R] things that are difficult/impossible to do in > SAS or SPSS butsimple in R > > Hi all, > > I'm giving a talk in a few days to a group of psychology > faculty and grad students re the R statistical language. Most > people in my dept. > use SAS or SPSS. It occurred to me that it would be nice to > have a few concrete examples of things that are fairly > straightforward to do in R but that are difficult or > impossible to do in SAS or SPSS. However, it has been so long > since I have used either of those commercial products that I > am drawing a blank. I've searched the forums and web for a > list and came up with just Bob Muenchen's comparison of > general procedures and Patrick Burns' overview of the three. > Neither of these give concrete examples of statistical > problems that are easily solved in R but not the commercial packages. > > Can anyone more familiar with SAS or SPSS think of some > examples of problems that they couldn't do in one of those > packages but that could be done easily in R? Similarly, if > there are any examples of the converse I would also be > interested to know. > > Best, > > Matt > > -- > Matthew C Keller > Asst. Professor of Psychology > University of Colorado at Boulder > www.matthewckeller.com > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >
Roland Rau
2008-Jan-15 21:26 UTC
[R] things that are difficult/impossible to do in SAS or SPSS but simple in R
Hi, maybe I missed something while using SAS or SPSS. So please make sure that I am not talking nonsense here. - How would you re-use results in SPSS or SAS? If it is possible for SAS and SPSS, I am fairly sure it is not as easy as in R: lmmodel1 <- lm(Y~X) myslope <- coef(lmmodel1)[2] - You have population and death data on the individual level classified by year, age, sex, and country. Now you want to calculate the probability of dying by year, age, sex, and country. In R, i would do: pop.array <- tapply(X=popdata$Count, INDEX=list(Age=popdata$Age, Year=popdata$Year, Sex=popdata$Sex, Country=popdata$Country), FUN=sum) dth.array <- tapply(X=dthdata$Count, INDEX=list(Age=dthdata$Age, Year=dthdata$Year, Sex=dthdata$Sex, Country=dthdata$Country), FUN=sum) prop.dying.array <- dth.array / pop.array Now you can easily extract a vector of the probability of dying of 85 year-old men dying in the first year of observation in all countries by writing: prop.dying.array[86,1,1,] - I hope I am wrong on this one. But when I was using SPSS, I could not find any possibility to include left truncated data in survival analysis. Maybe I did not find this possibility or maybe it has been included since. - The function outer() - Data are not always rectangular data frames. Those are just a few thoughts which came to my mind. I hope this helps, Roland Matthew Keller wrote:> Hi all, > > I'm giving a talk in a few days to a group of psychology faculty and > grad students re the R statistical language. Most people in my dept. > use SAS or SPSS. It occurred to me that it would be nice to have a few > concrete examples of things that are fairly straightforward to do in R > but that are difficult or impossible to do in SAS or SPSS. However, it > has been so long since I have used either of those commercial products > that I am drawing a blank. I've searched the forums and web for a list > and came up with just Bob Muenchen's comparison of general procedures > and Patrick Burns' overview of the three. Neither of these give > concrete examples of statistical problems that are easily solved in R > but not the commercial packages. > > Can anyone more familiar with SAS or SPSS think of some examples of > problems that they couldn't do in one of those packages but that could > be done easily in R? Similarly, if there are any examples of the > converse I would also be interested to know. > > Best, > > Matt >
Roland Rau
2008-Jan-15 21:54 UTC
[R] things that are difficult/impossible to do in SAS or SPSS but simple in R
Hi Matthew, something else came to my mind: why don't you post something similar to the newsgroups: comp.soft-sys.stat.spss comp.soft-sys.sas R-help is obviously biased and maybe there are things "we" (the R community) are just missing. Maybe there are things possible in SPSS or SAS which R people are not aware of? I would be really curious what SPSS or SAS users could give as an argument why they prefer their software. All the best, Roland Matthew Keller wrote:> Hi all, > > I'm giving a talk in a few days to a group of psychology faculty and > grad students re the R statistical language. Most people in my dept. > use SAS or SPSS. It occurred to me that it would be nice to have a few > concrete examples of things that are fairly straightforward to do in R > but that are difficult or impossible to do in SAS or SPSS. However, it > has been so long since I have used either of those commercial products > that I am drawing a blank. I've searched the forums and web for a list > and came up with just Bob Muenchen's comparison of general procedures > and Patrick Burns' overview of the three. Neither of these give > concrete examples of statistical problems that are easily solved in R > but not the commercial packages. > > Can anyone more familiar with SAS or SPSS think of some examples of > problems that they couldn't do in one of those packages but that could > be done easily in R? Similarly, if there are any examples of the > converse I would also be interested to know. > > Best, > > Matt >
Frank E Harrell Jr
2008-Jan-15 23:04 UTC
[R] things that are difficult/impossible to do in SAS or SPSS but simple in R
Matthew Keller wrote:> Hi all, > > I'm giving a talk in a few days to a group of psychology faculty and > grad students re the R statistical language. Most people in my dept. > use SAS or SPSS. It occurred to me that it would be nice to have a few > concrete examples of things that are fairly straightforward to do in R > but that are difficult or impossible to do in SAS or SPSS. However, it > has been so long since I have used either of those commercial products > that I am drawing a blank. I've searched the forums and web for a list > and came up with just Bob Muenchen's comparison of general procedures > and Patrick Burns' overview of the three. Neither of these give > concrete examples of statistical problems that are easily solved in R > but not the commercial packages. > > Can anyone more familiar with SAS or SPSS think of some examples of > problems that they couldn't do in one of those packages but that could > be done easily in R? Similarly, if there are any examples of the > converse I would also be interested to know. > > Best, > > Matt >Here is a simple thing that is easy to do in R or S-Plus but difficult in SAS or SPSS: Compute the number of subjects having age below the mean age sum(age < mean(age)) Here is something not quite so simple that is very difficult to do in SPSS or SAS. Show descriptive statistics for every variable in a data frame that is numeric and has at least 10 unique values. v <- sapply(mydata, function(x) is.numeric(x) && length(unique(x)) >= 10) summary(mydata[v]) -- Frank E Harrell Jr Professor and Chair School of Medicine Department of Biostatistics Vanderbilt University
Thomas Frööjd
2008-Jan-16 10:52 UTC
[R] things that are difficult/impossible to do in SAS or SPSS but simple in R
As far as i know mixture modelling (sums of exponentials) cant be done in SAS or SPSS. For R there is the Rmix package that while not very user friendly at least works. On Jan 15, 2008 8:45 PM, Matthew Keller <mckellercran at gmail.com> wrote:> Hi all, > > I'm giving a talk in a few days to a group of psychology faculty and > grad students re the R statistical language. Most people in my dept. > use SAS or SPSS. It occurred to me that it would be nice to have a few > concrete examples of things that are fairly straightforward to do in R > but that are difficult or impossible to do in SAS or SPSS. However, it > has been so long since I have used either of those commercial products > that I am drawing a blank. I've searched the forums and web for a list > and came up with just Bob Muenchen's comparison of general procedures > and Patrick Burns' overview of the three. Neither of these give > concrete examples of statistical problems that are easily solved in R > but not the commercial packages. > > Can anyone more familiar with SAS or SPSS think of some examples of > problems that they couldn't do in one of those packages but that could > be done easily in R? Similarly, if there are any examples of the > converse I would also be interested to know. > > Best, > > Matt > > -- > Matthew C Keller > Asst. Professor of Psychology > University of Colorado at Boulder > www.matthewckeller.com > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >
Jeffrey J. Hallman
2008-Jan-16 22:38 UTC
[R] things that are difficult/impossible to do in SAS or SPSS but simple in R
SAS has no facilities for date arithmetic and no easy way to build it yourself. In fact, that's the biggest problem with SAS: it stinks as a programming environment, so it's always much more difficult than it should be to do something new. As soon as you get away from the canned procs and have to write something of your own, SAS falls down. I don't know enough about SPSS to comment. -- Jeff
Matthew Keller
2008-Jan-21 19:08 UTC
[R] things that are difficult/impossible to do in SAS or SPSS but simple in R
Hello all, Thank you all very much for the many helpful suggestions. I think this discussion has been extremely informative. Rather than try to list all these examples in my talk, I sent out a link to everyone so that they could read the discussion for themselves. If you would like to access my powerpoint talk that I gave, it is here: http://matthewckeller.com/Lecture1.ppt Best, Matt -- Matthew C Keller Asst. Professor of Psychology University of Colorado at Boulder www.matthewckeller.com