# Posts Tagged ‘ Efficiency ’

## The intersection of multiple sets

October 8, 2018
By

This article compares several ways to find the elements that are common to multiple sets. I test which method is the fastest in the SAS/IML language. However, all algorithms are intrinsically fast, which raises an important question: when is it worth the time and effort to optimize an algorithm? The

The post Read more »

Tags: , ,
Posted in SAS | Comments Off on The intersection of multiple sets

## Radial basis functions and Gaussian kernels in SAS

September 26, 2018
By

A radial basis function is a scalar function that depends on the distance to some point, called the center point, c. One popular radial basis function is the Gaussian kernel φ(x; c) = exp(-||x – c||2 / (2 σ2)), which uses the squared distance from a vector x to the

The post Read more »

Tags: , ,
Posted in SAS | Comments Off on Radial basis functions and Gaussian kernels in SAS

## 6 tips for timing the performance of algorithms

August 21, 2017
By

When you implement a statistical algorithm in a vector-matrix language such as SAS/IML, R, or MATLAB, you should measure the performance of your implementation, which means that you should time how long a program takes to analyze data of varying sizes and characteristics. There are some general tips that can

The post Read more »

Tags: , ,
Posted in SAS | Comments Off on 6 tips for timing the performance of algorithms

## Compare the performance of algorithms in SAS

July 13, 2015
By

As my colleague Margaret Crevar recently wrote, it is useful to know how long SAS programs take to run. Margaret and others have written about how to use the SAS FULLSTIMER option to monitor the performance of the SAS system. In fact, SAS distributes a macro that enables you to

The post Read more »

Tags: , ,
Posted in SAS | Comments Off on Compare the performance of algorithms in SAS

## Finding observations that match a target value

March 18, 2015
By

Imagine that you have one million rows of numerical data and you want to determine if a particular "target" value occurs. How might you find where the value occurs? For univariate data, this is an easy problem. In the SAS DATA step you can use a WHERE clause or a

The post Read more »

Tags: , ,
Posted in SAS | Comments Off on Finding observations that match a target value

## Count the number of unique rows in a matrix

June 24, 2013
By

How do you count the number of unique rows in a matrix? The simplest algorithm is to sort the data and then iterate down the rows, comparing each row with the previous row. However, this algorithm has two shortcomings: it physically sorts the data (which means that the original locations

Tags: , ,
Posted in SAS | Comments Off on Count the number of unique rows in a matrix

## Using simulation to estimate the power of a statistical test

May 30, 2013
By

The power of a statistical test measures the test's ability to detect a specific alternate hypothesis. For example, educational researchers might want to compare the mean scores of boys and girls on a standardized test. They plan to use the well-known two-sample t test. The null hypothesis is that the

Tags: , , ,
Posted in SAS | Comments Off on Using simulation to estimate the power of a statistical test

## How to vectorize computations in a matrix language

May 15, 2013
By

Last week someone posted an interesting question to the SAS/IML Support Community. The problem involved four nested DO loops and took hours to run. By transforming several nested DO loops into an equivalent matrix operation, I was able to reduce the run time to about one second. The process of

Tags: , ,
Posted in SAS | Comments Off on How to vectorize computations in a matrix language

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