Tag: Getting Started

Learn SAS
Rick Wicklin 2
Beware the naked LOC

The LOC function is one of the most important functions in the SAS/IML language. The LOC function finds elements of a vector or matrix that satisfy some condition. For example, if you are going to apply a logarithmic transform to data, you can use the LOC function to find all

Rick Wicklin 3
Inverse hyperbolic functions in SAS

I was recently asked, "Does SAS support computing inverse hyperbolic trigonometric functions?" I was pretty sure that I had used the inverse hyperbolic trig functions in SAS, so I was surprised when I read the next sentence: "I ask because I saw a Usage Note that says these functions are

Rick Wicklin 0
Generate uniform data in a simplex

It is easy to simulate data that is uniformly distributed in the unit cube for any dimension. However, it is less obvious how to generate data in the unit simplex. The simplex is the set of points (x1,x2,...,xd) such that Σi xi = 1 and 0 ≤ xi ≤ 1

Rick Wicklin 7
Access rows or columns of a matrix by names

Did you know that you can index into SAS/IML matrices by using unique strings that you assign via the MATTRIB statement? The MATTRIB statement associates various attributes to a matrix. Usually, these attributes are only used for printing, but you can also use the ROWNAME= and COLNAME= attributes to subset

Rick Wicklin 7
The MOD function and negative values

When I studied math in school, I learned that the expression a (mod n) is always an integer between 0 and q – 1 for integer values of a and q. It's a nice convention, but SAS and many other computer languages allow the result to be negative if a (or q) is

1 11 12 13 14 15 22