[R] Inefficiency of SAS Programming
Gerard M. Keogh
GMKeogh at justice.ie
Mon Mar 2 11:22:13 CET 2009
but if you're buying SAS they'll throw in IML pretty cheaply - SAS think
it's only for a few nerds out there who wan to do funny stuff.
<Greg.Snow at imail.
Sent by: "Gerard M. Keogh"
r-help-bounces at r- <GMKeogh at justice.ie>, Frank E
project.org Harrell Jr
<f.harrell at vanderbilt.edu>
27/02/2009 19:05 "r-help-bounces at r-project.org"
<r-help-bounces at r-project.org>, R
list <r-help at stat.math.ethz.ch>
Re: [R] Inefficiency of SAS
But SAS/IML is not part of base SAS, it costs extra, so there is a good
chance that a user that has SAS will not be able to run code that uses
I have known of SAS programmers who know IML well that still write
matrix/vector tools using macros or proc transpose so that a user without
IML can still use the code (the fact that the code that started this thread
was found on a website, suggests that it was meant for general use rather
than something only used internally where you know what add-ons will be
Just another way that R makes life easier for both programmer and user.
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
greg.snow at imail.org
> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of Gerard M. Keogh
> Sent: Friday, February 27, 2009 7:19 AM
> To: Frank E Harrell Jr
> Cc: r-help-bounces at r-project.org; R list
> Subject: Re: [R] Inefficiency of SAS Programming
> Yes Frank, I accept your point but nevertheless IML is the proper place
> matrix work in SAS - mixing macro-level logic and computation is
> question - R is certainly more seemless in this respect.
> Frank E Harrell
> <f.harrell at vander
> bilt.edu> "Gerard M. Keogh"
> <GMKeogh at justice.ie>
> 27/02/2009 13:55
> R list <r-
> help at stat.math.ethz.ch>,
> r-help-bounces at r-project.org
> Re: [R] Inefficiency of SAS
> Gerard M. Keogh wrote:
> > Frank,
> > I can't see the code you mention - Web marshall at work - but I don't
> > you should be too quick to run down SAS - it's a powerful and
> > language but unfortunately very expensive.
> > Your example mentions doing a vector product in the macro language -
> > only suggest to me that those people writing the code need a crash
> > in SAS/IML (the matrix language). SAS is designed to work on records
> > is inapproprorriate for matrices - macros are only an efficient code
> > copying device. Doing matrix computations in this way is pretty mad
> > code would be impossible never mind the memory problems.
> > SAS recognise that but a lot of SAS users remain familiar with IML.
> > In IML by contrast there are inner, cross and outer products and a
> > other useful methods for matrix work that R users would be familiar
> > OLS for example is one line:
> > b = solve(X`X, X`y) ;
> > rss = sqrt(ssq(y - Xb)) ;
> > And to give you a flavour of IML's capabilities I implemented a SAS
> > of the MARS program in it about 6 or 7 years ago.
> > BTW SPSS also has a matrix language.
> > Gerard
> But try this:
> PROC IML;
> ... some custom user code ...
> ... loop over j=1 to 10 ...
> ... PROC GENMOD, output results back to IML
> IML is only a partial solution since it is not integrated with the PROC
> > Frank E Harrell
> > Jr
> > <f.harrell at vander
> > bilt.edu> R list <r-
> help at stat.math.ethz.ch>
> > Sent by:
> > r-help-bounces at r-
> > project.org
> > [R] Inefficiency of SAS
> > 26/02/2009 22:57
> > If anyone wants to see a prime example of how inefficient it is to
> > program in SAS, take a look at the SAS programs provided by the US
> > Agency for Healthcare Research and Quality for risk adjusting and
> > reporting for hospital outcomes at
> > http://www.qualityindicators.ahrq.gov/software.htm . The PSSASP3.SAS
> > program is a prime example. Look at how you do a vector product in
> > SAS macro language to evaluate predictions from a logistic regression
> > model. I estimate that using R would easily cut the programming time
> > this set of programs by a factor of 4.
> > Frank
> > --
> > Frank E Harrell Jr Professor and Chair School of Medicine
> > Department of Biostatistics Vanderbilt
> > ______________________________________________
> > 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.
> > The information transmitted is intended only for the person or entity
> which it is addressed and may contain confidential and/or privileged
> material. Any review, retransmission, dissemination or other use of, or
> taking of any action in reliance upon, this information by persons or
> entities other than the intended recipient is prohibited. If you
> this in error, please contact the sender and delete the material from
> computer. It is the policy of the Department of Justice, Equality and
> Reform and the Agencies and Offices using its IT services to disallow
> sending of offensive material.
> > Should you consider that the material contained in this message is
> offensive you should contact the sender immediately and also
> > Is le haghaidh an duine nó an eintitis ar a bhfuil sí dírithe, agus
> haghaidh an duine nó an eintitis sin amháin, a bheartaítear an
> fhaisnéis a
> tarchuireadh agus féadfaidh sé go bhfuil ábhar faoi rún agus/nó faoi
> phribhléid inti. Toirmisctear aon athbhreithniú, atarchur nó leathadh a
> dhéanamh ar an bhfaisnéis seo, aon úsáid eile a bhaint aisti nó aon
> a dhéanamh ar a hiontaoibh, ag daoine nó ag eintitis seachas an
> beartaithe. Má fuair tú é seo trí dhearmad, téigh i dteagmháil leis an
> seoltóir, le do thoil, agus scrios an t-ábhar as aon ríomhaire. Is é
> beartas na Roinne Dlí agus Cirt, Comhionannais agus Athchóirithe Dlí,
> na nOifígí agus na nGníomhaireachtaí a úsáideann seirbhísí TF na
> seoladh ábhair cholúil a dhícheadú.
> > Más rud é go measann tú gur ábhar colúil atá san ábhar atá sa
> teachtaireacht seo is ceart duit dul i dteagmháil leis an seoltóir
> láithreach agus le mailminder[ag]justice.ie chomh maith.
> Frank E Harrell Jr Professor and Chair School of Medicine
> Department of Biostatistics Vanderbilt
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-
> and provide commented, minimal, self-contained, reproducible code.
R-help at r-project.org mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
More information about the R-help