The DO Loop
Statistical programming in SAS with an emphasis on SAS/IML programs![Construct normal data from summary statistics](https://blogs.sas.com/content/iml/files/2013/03/constructnormaldatatomatch.png)
Last week there was an interesting question posted to the "Stat-Math Statistics" group on LinkedIn. The original question was a little confusing, so I'll state it in a more general form: A population is normally distributed with a known mean and standard deviation. A sample of size N is drawn
![How to use PROC SGPLOT to display the slope and intercept of a regression line](https://blogs.sas.com/content/iml/files/2013/02/RegSlopeInt.png)
A SAS user asked an interesting question on the SAS/GRAPH and ODS Graphics Support Forum. The question is: Does PROC SGPLOT support a way to display the slope of the regression line that is computed by the REG statement? Recall that the REG statement in PROC SGPLOT fits and displays
![Initializing vectors by using repetition factors](https://blogs.sas.com/content/iml/files/2017/02/AdvancedAnalytics-4.png)
The SAS/IML language has a curious syntax that enables you to specify a "repetition factor" when you initialize a vector of literal values. Essentially, the language enables you to specify the frequency of an element. For example, suppose you want to define the following vector: proc iml; x = {1
![Empty subscripts: How to fill rows and columns of a matrix](https://blogs.sas.com/content/iml/files/2013/02/t_emptysubscript.png)
Suppose that you have a SAS/IML matrix and you want to set each element of a submatrix to zero (or any other value). There is a simple syntax that accomplishes this task. If you subscript a matrix and do not specify a row, it means "use all rows." So, for
![How to access any program or data set that appears in the SAS/STAT documentation](https://blogs.sas.com/content/iml/files/2017/01/AdvancedAnalytics-2.png)
If you are like me, you've experienced the following frustration. You are reading the SAS/STAT documentation, trying to understand some procedure or option, when you find an example that is very similar to what you need. "Great," you think, "this example will help me understand how the SAS procedure works!"
![How the J function got its name](https://blogs.sas.com/content/iml/files/2013/02/t_Jfunction.png)
In linear algebra, the I symbol is used to denote an n x n identity matrix. The symbol J (or sometimes 1) is used to denote an n x p matrix of ones. When the SAS/IML language was implemented, the I function was defined to generate the identity matrix. The J function was defined