The DO Loop
Statistical programming in SAS with an emphasis on SAS/IML programs![Estimate a proportion and a confidence interval in SAS](https://blogs.sas.com/content/iml/files/2024/04/BinomProp2.png)
A SAS programmer wanted to estimate a proportion and a confidence interval (CI), but didn't know which SAS procedure to call. He knows a formula for the CI from an elementary statistics textbook. If x is the observed count of events in a random sample of size n, then the
![Bimodal and unimodal beta distributions](https://blogs.sas.com/content/iml/files/2024/04/skBeta6-640x336.png)
In a recent article, I graphed the PDF of a few Beta distributions that had a variety of skewness and kurtosis values. I thought that I had chosen the parameter values to represent a wide variety of Beta shapes. However, I was surprised to see that the distributions were all
![Use the moment-ratio diagram to visualize the sampling distribution of skewness and kurtosis](https://blogs.sas.com/content/iml/files/2024/04/skBeta4-640x336.png)
The moment-ratio diagram is a tool that is useful when choosing a distribution that models a sample of univariate data. As I show in my book (Simulating Data with SAS, Wicklin, 2013), you first plot the skewness and kurtosis of the sample on the moment-ratio diagram to see what common
![Distributions with specified skewness and kurtosis](https://blogs.sas.com/content/iml/files/2024/04/skBeta3-640x336.png)
A SAS programmer wanted to simulate samples from a family of Beta(a,b) distributions for a simulation study. (Recall that a Beta random variable is bounded with values in the range [0,1].) She wanted to choose the parameters such that the skewness and kurtosis of the distributions varied over range of
![Improve the Federal Reserve's dot plot](https://blogs.sas.com/content/iml/files/2024/04/FedDot4-480x336.png)
A dot plot is a standard statistical graphic that displays a statistic (often a mean) and the uncertainty of the statistic for one or more groups. Statisticians and data scientists use it in the analysis of group data. In late 2023, I started noticing headlines about "dot plots" in the
![Add a second axis to a SAS graph](https://blogs.sas.com/content/iml/files/2024/03/dupAxes3-400x336.png)
Recently, I saw a scatter plot that displayed the ticks, values, and labels for a vertical axis on the right side of a graph. In the SGPLOT procedure in SAS, you can use the Y2AXIS option to move an axis on the right side of a graph. Similarly, you can