The DO Loop
Statistical programming in SAS with an emphasis on SAS/IML programs![A trick to plot groups in PROC SGPLOT](https://blogs.sas.com/content/iml/files/2018/10/GroupFreq3-640x336.png)
A useful feature in PROC SGPLOT is the ability to easily visualize subgroups of data. Most statements in the SGPLOT procedure support a GROUP= option that enables you to overlay plots of subgroups. When you use the GROUP= option, observations are assigned attributes (colors, line patterns, symbols, ...) that indicate
![Bootstrap regression estimates: Residual resampling](https://blogs.sas.com/content/iml/files/2018/10/BootResid2-640x336.png)
If you want to bootstrap the parameters in a statistical regression model, you have two primary choices. The first, case resampling, is discussed in a previous article. This article describes the second choice, which is resampling residuals (also called model-based resampling). This article shows how to implement residual resampling in
![Bootstrap regression estimates: Case resampling](https://blogs.sas.com/content/iml/files/2018/10/bootCase2-640x336.png)
If you want to bootstrap the parameters in a statistical regression model, you have two primary choices. The first is case resampling, which is also called resampling observations or resampling pairs. In case resampling, you create the bootstrap sample by randomly selecting observations (with replacement) from the original data. The
![Transpose blocks to reshape data](https://blogs.sas.com/content/iml/files/2018/10/blocktranspose1b.png)
A SAS programmer asked how to rearrange elements of a matrix. The rearrangement he wanted was rather complicated: certain blocks of data needed to move relative to other blocks, but the values within each block were to remain unchanged. It turned out that the mathematical operation he needed is called
![Parameter estimates for different parameterizations](https://blogs.sas.com/content/iml/files/2018/10/estparams1-640x336.png)
In a recent article about nonlinear least squares, I wrote, "you can often fit one model and use the ESTIMATE statement to estimate the parameters in a different parameterization." This article expands on that statement. It shows how to fit a model for one set of parameters and use the
![Get the unique values of a variable in data order](https://blogs.sas.com/content/iml/files/2017/01/ProgrammingTips-2.png)
There are several ways to use SAS to get the unique values for a data variable. In Base SAS, you can use the TABLES statement in PROC FREQ to generate a table of unique values (and the counts). You can also use the DISTINCT function in PROC SQL to get