The DO Loop
Statistical programming in SAS with an emphasis on SAS/IML programs![Compute the geometric mean, geometric standard deviation, and geometric CV in SAS](https://blogs.sas.com/content/iml/files/2019/09/geomean3-640x336.png)
I frequently see questions on SAS discussion forums about how to compute the geometric mean and related quantities in SAS. Unfortunately, the answers to these questions are sometimes confusing or even wrong. In addition, some published papers and web sites that claim to show how to calculate the geometric mean
![What is a geometric mean?](https://blogs.sas.com/content/iml/files/2019/09/geomean2.png)
There are several different kinds of means. They all try to find an average value from among a set of numbers. Although the most popular mean is the arithmetic mean, the geometric mean can be useful for problems in statistics, finance, and biology. A common application of the geometric mean
![Solve many optimization problems](https://blogs.sas.com/content/iml/files/2019/09/optimmult1-640x336.png)
One of the strengths of the SAS/IML language is its flexibility. Recently, a SAS programmer asked how to generalize a program in a previous article. The original program solved one optimization problem. The reader said that she wants to solve this type of problem 300 times, each time using a
![Use the SHORT option in Base SAS procedures to reduce output](https://blogs.sas.com/content/iml/files/2017/01/ProgrammingTips-2.png)
Although I do not typically blog about undocumented SAS options, I'll make an exception this time. For many years, I have known that the CONTENTS and COMPARE procedures support the BRIEF and SHORT options, but I always forget which option goes with which procedure. For the record, here are the
![4 ways to visualize the density of bivariate data](https://blogs.sas.com/content/iml/files/2019/09/DensityPlot1-640x336.png)
In a scatter plot that displays many points, it can be important to visualize the density of the points. Scatter plots (indeed, all plots that show individual markers) can suffer from overplotting, which means that the graph does not indicate how many observations are at a specific (x, y) location.
![The Hull moving average: Implement a custom time series smoother in SAS](https://blogs.sas.com/content/iml/files/2019/10/HullMovingAvg3-702x300.png)
A moving average is a statistical technique that is used to smooth a time series. My colleague, Cindy Wang, wrote an article about the Hull moving average (HMA), which is a time series smoother that is sometimes used as a technical indicator by stock market traders. Cindy showed how to