Posts Tagged ‘ Efficiency ’

Simulation in SAS: The slow way or the BY way

July 18, 2012
By
Simulation in SAS: The slow way or the BY way

Over the past few years, and especially since I posted my article on eight tips to make your simulation run faster, I have received many emails (often with attached SAS programs) from SAS users who ask, beg, and—in one case—even offer to pay for advice about how to speed up
Read more »

Tags: , , ,
Posted in SAS | Comments Off

Indexing a SAS data set to improve processing categories in SAS/IML

July 16, 2012
By

I have blogged about three different SAS/IML techniques that iterate over categories and process the observations in each category. The three techniques are as follows: Use a WHERE clause on the READ statement to read only the observations in the ith category. This is described in the article "BY-group processing
Read more »

Tags: , ,
Posted in SAS | Comments Off

Eight tips to make your simulation run faster

June 6, 2012
By

"Help! My simulation is taking too long to run! How can I make it go faster?" I frequently talk with statistical programmers who claim that their "simulations are too slow" (by which they mean, "they take too long"). They suspect that their program is inefficient, but they aren't sure why.
Read more »

Tags: , ,
Posted in SAS | Comments Off

Compute statistics for each row by using subscript operators

May 23, 2012
By

In a previous blog, I showed how to use SAS/IML subscript reduction operators to compute the location of the maximum values for each row of a matrix. The subscript reduction operators are useful for computing simple statistics for each row (or column) of a numerical matrix. If x is a
Read more »

Tags: , , ,
Posted in SAS | Comments Off

Vectorized computations and the birthday matching problem

April 9, 2012
By
Vectorized computations and the birthday matching problem

The birthday matching problem is a classic problem in probability theory. The part of it that people tend to remember is that in a room of 23 people, there is greater than 50% chance that two people in the room share a birthday. But the birthday matching problem is also
Read more »

Tags: , , , ,
Posted in SAS | Comments Off

Defining banded and triangular matrices: Another approach

February 29, 2012
By
Defining banded and triangular matrices: Another approach

Sometimes in matrix computations you need to obtain the values of certain submatrices such as the diagonal elements or the super- or subdiagonal elements. About a year ago, I showed one way to do that: convert subscripts to indices and vice-versa. However, a tip from @RLangTip on Twitter got me
Read more »

Tags: , , ,
Posted in SAS | Comments Off

How to compute Mahalanobis distance in SAS

February 22, 2012
By
How to compute Mahalanobis distance in SAS

I recently blogged about Mahalanobis distance and what it means geometrically. I also previously showed how Mahalanobis distance can be used to compute outliers in multivariate data. But how do you compute Mahalanobis distance in SAS? Computing Mahalanobis distance with built-in SAS procedures and functions There are several ways to
Read more »

Tags: , , ,
Posted in SAS | Comments Off

Avoid unnecessary IF-THEN statements in loops

February 13, 2012
By
Avoid unnecessary IF-THEN statements in loops

Way back when I learned to program, I remember a computer instructor explaining that an IF-THEN statement can be a relatively slow operation. He said "If a multiplication takes one unit of time, an IF statement requires about 70 units." I don't know where his numbers came from, or even
Read more »

Tags: , , ,
Posted in SAS | Comments Off

Welcome!

SAS-X.com offers news and tutorials about the various SAS® software packages, contributed by bloggers. You are welcome to subscribe to e-mail updates, or add your SAS-blog to the site.

SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration.