The DO Loop
Statistical programming in SAS with an emphasis on SAS/IML programs![5 reasons to use PROC FORMAT to recode variables in SAS](https://blogs.sas.com/content/iml/files/2019/06/FormatRecode4.png)
Recoding variables can be tedious, but it is often a necessary part of data analysis. Almost every SAS programmer has written a DATA step that uses IF-THEN/ELSE logic or the SELECT-WHEN statements to recode variables. Although creating a new variable is effective, it is also inefficient because you have to
![Plot a family of curves in SAS](https://blogs.sas.com/content/iml/files/2019/06/FamilyXform1-400x336.png)
A family of curves is generated by an equation that has one or more parameters. To visualize the family, you might want to display a graph that overlays four of five curves that have different parameter values, as shown to the right. The graph shows members of a family of
![Graph wide data and long data in SAS](https://blogs.sas.com/content/iml/files/2019/06/WideLong3-640x336.png)
Statistical programmers and analysts often use two kinds of rectangular data sets, popularly known as wide data and long data. Some analytical procedures require that the data be in wide form; others require long form. (The "long format" is sometimes called "narrow" or "tall" data.) Fortunately, the statistical graphics procedures
![Visualize interaction effects in regression models](https://blogs.sas.com/content/iml/files/2019/05/VizInteract2-640x336.png)
Knowing how to visualize a regression model is a valuable skill. A good visualization can help you to interpret a model and understand how its predictions depend on explanatory factors in the model. Visualization is especially important in understanding interactions between factors. Recently I read about work by Jacob A.
![The Theil-Sen robust estimator for simple linear regression](https://blogs.sas.com/content/iml/files/2019/05/Theil3-640x336.png)
Modern statistical software provides many options for computing robust statistics. For example, SAS can compute robust univariate statistics by using PROC UNIVARIATE, robust linear regression by using PROC ROBUSTREG, and robust multivariate statistics such as robust principal component analysis. Much of the research on robust regression was conducted in the
![Gershgorin discs and the location of eigenvalues](https://blogs.sas.com/content/iml/files/2019/05/Gershgorin4-640x336.png)
The eigenvalues of a matrix are not easy to compute. It is remarkable, therefore, that with relatively simple mental arithmetic, you can obtain bounds for the eigenvalues of a matrix of any size. The bounds are provided by using a marvelous mathematical result known as Gershgorin's Disc Theorem. For certain