The DO Loop
Statistical programming in SAS with an emphasis on SAS/IML programs![Using colors to visualize groups in a bar chart in SAS](https://blogs.sas.com/content/iml/files/2024/02/barColors4-640x336.png)
I sometimes see analysts overuse colors in statistical graphics. My rule of thumb is that you do not need to use color to represent a variable that is already represented in a graph. For example, it is redundant to use a continuous color ramp to represent the lengths of bars
![On using flexible distributions to fit data](https://blogs.sas.com/content/iml/files/2024/02/fitFlex2-640x336.png)
With four parameters I can fit an elephant. With five I can make his trunk wiggle. — John von Neumann Ever since the dawn of statistics, researchers have searched for the Holy Grail of statistical modeling. Namely, a flexible distribution that can model any continuous univariate data. As the quote
![On using the range to estimate the variability of small samples](https://blogs.sas.com/content/iml/files/2024/02/d2stat6-640x336.png)
In statistical quality control, practitioners often estimate the variability of products that are being produced in a manufacturing plant. It is important to estimate the variability as soon as possible, which means trying to obtain an estimate from a small sample. Samples of size five or less are not uncommon
![The linear distribution on an interval](https://blogs.sas.com/content/iml/files/2024/02/linearDistrib3-640x336.png)
In a recent Monte Carlo project, I needed to simulate numbers on an interval by using a continuous linear probability density function (PDF). An example is shown to the right. In this example, the linear density function is decreasing on the interval, but the function could also be constant or
![An exact formula for the sampling distribution of the correlation coefficient](https://blogs.sas.com/content/iml/files/2024/02/CorrDist1-640x336.png)
I read a journal article in which a researcher used a formula for the probability density function (PDF) of the sample correlation coefficient. The formula was rather complicated, and presented with no citation, so I was curious to learn more. I found the distribution for the correlation coefficient in the
![The elliptical heart](https://blogs.sas.com/content/iml/files/2024/02/EllipseHeart5-640x336.png)
Some hearts are famous. For example, there is the "Heart of Gold" (Neil Young), the "Heart of Glass" (Blondie), and the Heart of Darkness (Joseph Conrad). But have you heard of the "Heart of Ellipses"? No? Well, in 2023, Ted Conway published an amusingly titled article, "Total Ellipse of the