The DO Loop
Statistical programming in SAS with an emphasis on SAS/IML programs![The HighLow plot: When a stacked bar chart is not enough](https://blogs.sas.com/content/iml/files/2020/08/HighLowStack1-640x336.png)
The HighLow plot often enables you to create many custom plots without resorting to annotation. Although it is designed to create a candlestick chart for stocks, it is incredibly versatile. Recently, a SAS programmer wanted to create a patient-profile graph that looked like a stacked bar chart but had repeated
![The best way to generate dummy variables in SAS](https://blogs.sas.com/content/iml/files/2020/08/dummyBest2.png)
On discussion forums, many SAS programmers ask about the best way to generate dummy variables for categorical variables. Well-meaning responders offer all sorts of advice, including writing your own DATA step program, sometimes mixed with macro programming. This article shows that the simplest and easiest way to generate dummy variables
![Rewinding random number streams: An application](https://blogs.sas.com/content/iml/files/2020/08/TFA1.png)
In the paper "Tips and Techniques for Using the Random-Number Generators in SAS" (Sarle and Wicklin, 2018), I discussed an example that uses the new STREAMREWIND subroutine in Base SAS 9.4M5. As its name implies, the STREAMREWIND subroutine rewinds a random number stream, essentially resetting the stream to the beginning.
![How does PROC FCMP store functions?](https://blogs.sas.com/content/iml/files/2020/08/FCMPStore1-480x336.png)
I got a lot of feedback about my recent article about how to find roots of nonlinear functions by using the SOLVE function in PROC FCMP. A colleague asked how the FCMP procedure stores the functions. Specifically, why the OUTLIB= option on the PROC FCMP statement use a three-level syntax:
![Find the root of a function by using the SAS DATA step](https://blogs.sas.com/content/iml/files/2020/08/FCMPSolve3-640x336.png)
Finding the root (or zero) of a nonlinear function is an important computational task. In the case of a one-variable function, you can use the SOLVE function in PROC FCMP to find roots of nonlinear functions in the DATA step. This article shows how to use the SOLVE function to
![Estimate a power curve in parallel in SAS Viya](https://blogs.sas.com/content/iml/files/2020/08/powersim5-640x336.png)
I recently showed how to use simulation to estimate the power of a statistical hypothesis test. The example (a two-sample t test for the difference of means) is a simple SAS/IML module that is very fast. Fast is good because often you want to perform a sequence of simulations over