The DO Loop
Statistical programming in SAS with an emphasis on SAS/IML programs![A continuous band plot for visualizing uncertainty in regression predictions](https://blogs.sas.com/content/iml/files/2020/10/GradConfBandPlot2-640x336.png)
A previous article discusses the confidence band for the mean predicted value in a regression model. The article shows a "graded confidence band plot," which I saw in Claus O. Wilke's online book, Fundamentals of Data Visualization (Section 16.3). It communicates uncertainty in the predictions. A graded band plot is
![Visualize uncertainty in regression predictions](https://blogs.sas.com/content/iml/files/2020/10/RegCLM3-640x336.png)
You've probably seen many graphs that are similar to the one at the right. This plot shows a regression line overlaid on a scatter plot of some data. Given a value for the independent variable (x), the regression line gives the best prediction for the mean of the response variable
![The Poisson-binomial distribution for hundreds of parameters](https://blogs.sas.com/content/iml/files/2020/10/PoisBinomRNA1-640x336.png)
A previous article shows how to use a recursive formula to compute exact probabilities for the Poisson-binomial distribution. The recursive formula is an O(N2) computation, where N is the number of parameters for the Poisson-binomial (PB) distribution. If you have a distribution that has hundreds (or even thousands) of parameters,
![Trap and map: Trapping invalid values](https://blogs.sas.com/content/iml/files/2017/01/ProgrammingTips-2.png)
Finite-precision computations can be tricky. You might know, mathematically, that a certain result must be non-negative or must be within a certain interval. However, when you actually compute that result on a computer that uses finite-precision, you might observe that the value is slightly negative or slightly outside of the
![Density, CDF, and quantiles for the Poisson-binomial distribution PDF of the Poisson-binomial distribution](https://blogs.sas.com/content/iml/files/2020/09/PoisBinomPDF4-640x336.png)
When working with a probability distribution, it is useful to know how to compute four essential quantities: a random sample, the density function, the cumulative distribution function (CDF), and quantiles. I recently discussed the Poisson-binomial distribution and showed how to generate a random sample. This article shows how to compute
![The Poisson-binomial distribution](https://blogs.sas.com/content/iml/files/2020/09/PoisBinom2-640x336.png)
The Poisson-binomial distribution is a generalization of the binomial distribution. For the binomial distribution, you carry out N independent and identical Bernoulli trials. Each trial has a probability, p, of success. The total number of successes, which can be between 0 and N, is a binomial random variable. The distribution