The DO Loop
Statistical programming in SAS with an emphasis on SAS/IML programs![The running median as a time series smoother](https://blogs.sas.com/content/iml/files/2021/05/timesmooth3-600x336.png)
When data contain outliers, medians estimate the center of the data better than means do. In general, robust estimates of location and sale are preferred over classical moment-based estimates when the data contain outliers or are from a heavy-tailed distribution. Thus, instead of using the mean and standard deviation of
![How to quickly find documentation for a SAS procedure](https://blogs.sas.com/content/iml/files/2021/05/findDoc1-517x336.png)
I refer to the SAS documentation every day. Usually, I want information about SAS syntax and the statistical formulas and algorithms for various options and statements. Although I have bookmarked common documentation books and chapters, sometimes it is easier to perform an internet search to find information. I've discovered a
![Implement a product function in SAS](https://blogs.sas.com/content/iml/files/2017/01/ProgrammingTips-2.png)
A SAS programmer noticed that there is not a built-in function in the SAS DATA step that computes the product for each row across a specified set of variables. There are built-in functions for various statistics such as the SUM, MAX, MIN, MEAN, and MEDIAN functions. But no DATA step
![Standardized regression coefficients in PROC GLIMMIX](https://blogs.sas.com/content/iml/files/2017/01/ProgrammingTips-2.png)
I previously wrote about how to understand standardized regression coefficients in PROC REG in SAS. You can obtain the standardized estimates by using the STB option on the MODEL statement in PROC REG. Several readers have written to ask whether I could write a similar article about the STDCOEF option
![Nonstandard ways to standardize variables](https://blogs.sas.com/content/iml/files/2017/01/ProgrammingTips-2.png)
You can standardize a numerical variable by subtracting a location parameter from each observation and then dividing by a scale parameter. Often, the parameters depend on the data that you are standardizing. For example, the most common way to standardize a variable is to subtract the sample mean and divide
![Odani's truism for fractions that are near each other](https://blogs.sas.com/content/iml/files/2021/05/Odani2-640x336.png)
Odani's truism is a mathematical result that says that if you want to compare the fractions a/b and c/d, it often is sufficient to compare the sums (a+d) and (b+c) rather than the products a*d and b*c. (All of the integers a, b, c, and d are positive.) If you