This week I read an interesting blog post that led to a discussion about specifying the frequencies of observations in a regression model. In SAS software, many of the analysis procedures contain a FREQ statement for specifying frequencies and a WEIGHT statement for specifying weights in a weighted regression. Theis
Tag: Getting Started
Sometimes it is useful in the SAS/IML language to convert a character string into a vector of one-character values. For example, you might want to count the frequency distribution of characters, which is easy when each character is an element of a vector. The question of how to convert a
Recently I wrote about how to determine the age of your SAS release. Experienced SAS programmers know that you can programatically determine information about your SAS release by using certain automatic macro variables that SAS provides: SYSVER: contains the major and minor version of the SAS release SYSVLONG: contains the
Even the best programmers make mistakes. For most errors, SAS software displays the nature and location of the error, returns control to the programmer, and awaits further instructions. However, there are a handful of insidious errors that cause SAS to think that a statement or program is not finished. For
How old is your version of SAS software? The graph on the left shows the release dates for various releases of SAS software, beginning with SAS 8.0. The graph is based on a graph on Jiangtang Hu's blog that shows the major SAS releases. As this graph demonstrates, SAS software
One of my favorite features of SAS/IML 12.1 (released with 9.3m2) is that the USE and CLOSE statements support reading data set names that are specified in a SAS/IML matrix. The IMLPlus language in SAS/IML Studio has supported this syntax since the early 2000s, so I am pleased that this
There are many techniques for generating random variates from a specified probability distribution such as the normal, exponential, or gamma distribution. However, one technique stands out because of its generality and simplicity: the inverse CDF sampling technique. If you know the cumulative distribution function (CDF) of a probability distribution, then
It is often useful to partition observations for a continuous variable into a small number of intervals, called bins. This familiar process occurs every time that you create a histogram, such as the one on the left. In SAS you can create this histogram by calling the UNIVARIATE procedure. Optionally,
Every programming language has an IF-THEN statement that branches according to whether a Boolean expression is true or false. In SAS, the IF-THEN (or IF-THEN/ELSE) statement evaluates an expression and braches according to whether the expression is nonzero (true) or zero (false). The basic syntax is if numeric-expression then do-computation;
On the Web site for the book Statistical Programming with SAS/IML Software, I provide instructions on how to download the sample data sets and install them so that they can be used from within SAS/IML Studio. When I wrote the book I did not anticipate that SAS users might want