The DO Loop
Statistical programming in SAS with an emphasis on SAS/IML programs![The partition problem: An optimization approach](https://blogs.sas.com/content/iml/files/2017/01/ProgrammingTips-2.png)
I previously wrote about one way to solve the partition problem in SAS. In the partition problem, you divide (or partition) a set of N items into two groups of size k and N-k such that the sum of the items' weights is the same in each group. For example,
![The partition problem](https://blogs.sas.com/content/iml/files/2017/01/ProgrammingTips-2.png)
The partition problem has many variations, but recently I encountered it as an interactive puzzle on a computer. (Try a similar game yourself!) The player is presented with an old-fashioned pan-balance scale and a set of objects of different weights. The challenge is to divide (or partition) the objects into
![Simulate proportions for groups](https://blogs.sas.com/content/iml/files/2021/09/simProportion4-640x336.png)
A statistical programmer asked how to simulate event-trials data for groups. The subjects in each group have a different probability of experiencing the event. This article describes one way to simulate this scenario. The simulation is similar to simulating from a mixture distribution. This article also shows three different ways
![Remaking a panel of dynamite plots](https://blogs.sas.com/content/iml/files/2021/09/PanelDynamite1-480x336.png)
A colleague spent a lot of time creating a panel of graphs to summarize some data. She did not use SAS software to create the graph, but I used SAS to create a simplified version of her graph, which is shown to the right. (The colors are from her graph.)
![On the number of bootstrap samples](https://blogs.sas.com/content/iml/files/2021/08/BootAllDist2-640x336.png)
The number of possible bootstrap samples for a sample of size N is big. Really big. Recall that the bootstrap method is a powerful way to analyze the variation in a statistic. To implement the standard bootstrap method, you generate B random bootstrap samples. A bootstrap sample is a sample
![Bootstrap correlation coefficients in SAS](https://blogs.sas.com/content/iml/files/2021/08/BootCorr3-640x336.png)
You can use the bootstrap method to estimate confidence intervals. Unlike formulas, which assume that the data are drawn from a specified distribution (usually the normal distribution), the bootstrap method does not assume a distribution for the data. There are many articles about how to use SAS to bootstrap statistics