The DO Loop
Statistical programming in SAS with an emphasis on SAS/IML programs![Order variables in a heat map or scatter plot matrix](https://blogs.sas.com/content/iml/files/2018/05/ReorderSingleLinkCluster2-640x336.png)
Order matters. When you create a graph that has a categorical axis (such as a bar chart), it is important to consider the order in which the categories appear. Most software defaults to alphabetical order, which typically gives no insight into how the categories relate to each other. Alphabetical order
![Assign colors in heat maps: A study of married couples and college majors](https://blogs.sas.com/content/iml/files/2018/04/MarryMajors3-640x336.png)
Some say that opposites attract. Others say that birds of a feather flock together. Which is it? Phillip N. Cohen, a professor of sociology at the University of Maryland, recently posted an interesting visualization that indicates that married couples who are college graduates tend to be birds of a feather.
![An easier way to run thousands of regressions](https://blogs.sas.com/content/iml/files/2018/04/ManyRegressionsSweep2-640x336.png)
SAS programmers on SAS discussion forums sometimes ask how to run thousands of regressions of the form Y = B0 + B1*X_i, where i=1,2,.... A similar question asks how to solve thousands of regressions of the form Y_i = B0 + B1*X for thousands of response variables. I have previously
![The 80-20 rule for blogs](https://blogs.sas.com/content/iml/files/2018/04/ParetoBlog3-640x336.png)
You've probably heard about the "80-20 Rule," which describes many natural and manmade phenomena. This rule is sometimes called the "Pareto Principle" because it was discovered by Vilfredo Pareto (1848–1923) who used it to describe the unequal distribution of wealth. Specifically, in his study, 80% of the wealth was held
![The sweep operator: A fundamental operation in regression](https://blogs.sas.com/content/iml/files/2018/04/sweep2.png)
The sweep operator performs elementary row operations on a system of linear equations. The sweep operator enables you to build regression models by "sweeping in" or "sweeping out" particular rows of the X`X matrix. As you do so, the estimates for the regression coefficients, the error sum of squares, and
![Random permutations without duplicates](https://blogs.sas.com/content/iml/files/2017/01/ProgrammingTips-2.png)
A colleague and I recently discussed how to generate random permutations without encountering duplicates. Given a set of n items, there are n! permutations My colleague wants to generate k unique permutations at random from among the total of n!. Said differently, he wants to sample without replacement from the