The DO Loop
Statistical programming in SAS with an emphasis on SAS/IML programs![Use simulation to estimate the power of a statistical test](https://blogs.sas.com/content/iml/files/2020/08/Stdize1-500x336.png)
A previous article about standardizing data in groups shows how to simulate data from two groups. One sample (with n1=20 observations) is simulated from an N(15, 5) distribution whereas a second (with n2=30 observations) is simulated from an N(16, 5) distribution. The sample means of the two groups are close
![4 ways to standardize data in SAS](https://blogs.sas.com/content/iml/files/2020/08/Stdize1-500x336.png)
A common operation in statistical data analysis is to center and scale a numerical variable. This operation is conceptually easy: you subtract the mean of the variable and divide by the variable's standard deviation. Recently, I wanted to perform a slight variation of the usual standardization: Perform a different standardization
![Submatrices of matrices](https://blogs.sas.com/content/iml/files/2020/08/submat1.png)
Have you ever seen the "brain teaser" for children that shows a 4 x 4 grid and asks "how many squares of any size are in this grid?" To solve this problem, the reader must recognize that there are sixteen 1 x 1 squares, nine 2 x 2 squares, four 3 x 3 squares, and one 4 x 4 square.
![Run tasks in parallel in SAS Viya](https://blogs.sas.com/content/iml/files/2020/07/ptfig-702x336.png)
The iml action was introduced in Viya 3.5. As shown in a previous article, the iml action supports ways to implement the map-reduce paradigm, which is a way to distribute a computation by using multiple threads. The map-reduce paradigm is ideal for “embarrassingly parallel” computations, which are composed of many
![Simulate regression models that incorporate CLASS parameterizations](https://blogs.sas.com/content/iml/files/2017/01/ProgrammingTips-2.png)
When you write a program that simulates data from a statistical model, you should always check that the simulation code is correct. One way to do this is to generate a large simulated sample, estimate the parameters in the simulated data, and make sure that the estimates are close to
![8 ways to use the Kronecker product](https://blogs.sas.com/content/iml/files/2020/07/kronecker.png)
The Kronecker product (also called the direct product) is a binary operation that combines two matrices to form a new matrix. The Kronecker product appears in textbooks about the design of experiments and multivariate statistics. The Kronecker product seems intimidating at first, but often one of the matrices in the