Blog Archives

Resampling and permutation tests in SAS

November 21, 2014
By
Resampling and permutation tests in SAS

My colleagues at the SAS & R blog recently posted an example of how to program a permutation test in SAS and R. Their SAS implementation used Base SAS and was "relatively cumbersome" (their words) when compared with the R code. In today's post I implement the permutation test in […]

Read more »

What is the coefficient of variation?

November 19, 2014
By
What is the coefficient of variation?

I sometimes wonder whether some functions and options in SAS software ever get used. Last week I was reviewing new features that were added to SAS/IML 13.1. One of the new functions is the CV function, which computes the sample coefficient of variation for data. Maybe it is just me, […]

Read more »

The difference between RUN and CALL for SAS/IML subroutines

November 17, 2014
By
The difference between RUN and CALL for SAS/IML subroutines

Have you ever noticed that some SAS/IML programmers use the CALL statement to call a subroutine, whereas others use the RUN statement? Have you ever wondered why the SAS/IML language has two statements that do the same thing? It turns out that the CALL statement and the RUN statement do […]

Read more »

The distribution of Pythagorean triples

November 12, 2014
By
The distribution of Pythagorean triples

When I studied high school geometry, I noticed that many homework problems involved right triangles whose side lengths were integers. The canonical example is the 3-4-5 right triangle, which has legs of length 3 and 4 and a hypotenuse of length 5. The triple (3, 4, 5) is called a […]

Read more »

An efficient way to increment a matrix diagonal

November 10, 2014
By
An efficient way to increment a matrix diagonal

I was recently asked about how to use the SAS/IML language to efficiently add a constant to every element of a matrix diagonal. Mathematically, the task is to form the matrix sum A + kI, where A is an n x n matrix, k is a scalar value, and I is the […]

Read more »

The distribution of blood types by country

November 7, 2014
By
The distribution of blood types by country

My colleague Robert Allison has a knack for finding fascinating data. Last week he did it again by locating data about how blood types and Rh factors vary among countries. He produced a series of eight world maps, each showing the prevalence of a blood type (A+, A-, B+, B-, […]

Read more »

Binning data by quantiles? Beware of rounded data

November 5, 2014
By
Binning data by quantiles? Beware of rounded data

In my article about how to create a quantile plot, I chose not to discuss a theoretical issue that occasionally occurs. The issue is that for discrete data (which includes rounded values), it might be impossible to use quantile values to split the data into k groups where each group […]

Read more »

Recent additions to the SAS/IML file exchange

November 3, 2014
By
Recent additions to the SAS/IML file exchange

It has been three months since the introduction of the SAS/IML File Exchange, so I thought I'd give a short update on recent submissions and activity. The web site administrators have created an easy-to-remember shortcut to the File Exchange: http://communities.sas.com/sas-iml-file-exchange There have been eight new articles submitted to the File […]

Read more »

The next power of 2 and other tricks with logarithms

October 31, 2014
By
The next power of 2 and other tricks with logarithms

The other day I was doing some computations that caused me to wonder, "What is the smallest power of 2 that is greater than a given number?" The mathematics is straightforward. Given a number n, find the least value of k such that 2k ≥ n or, equivalently, k ≥ […]

Read more »

How to use frequency analysis to crack the Cryptoquote puzzle

October 29, 2014
By
How to use frequency analysis to crack the Cryptoquote puzzle

Many people enjoy solving word games such as the daily Cryptoquote puzzle, which uses a simple substitution cipher to disguise a witty or wise quote by a famous person. A common way to attack the puzzle is frequency analysis. In frequency analysis you identify letters and pairs of letters (bigrams) […]

Read more »


Subscribe

Email:

  Subscribe