The DO Loop
Statistical programming in SAS with an emphasis on SAS/IML programs![Working with recurrence relations in SAS](https://blogs.sas.com/content/iml/files/2017/01/ProgrammingTips-2.png)
Many textbooks and research papers present formulas that involve recurrence relations. Familiar examples include: The factorial function: Set Fact(0)=1 and define Fact(n) = n*Fact(n-1) for n > 0. The Fibonacci numbers: Set Fib(0)=1 and Fib(1)=1 and define Fib(n) = Fib(n-1) + Fib(n-2) for n > 1. The binomial coefficients (combinations
![Regression with inequality constraints on parameters](https://blogs.sas.com/content/iml/files/2020/09/restrictedReg3-614x336.png)
A previous article discussed how to solve regression problems in which the parameters are constrained to be a specified constant (such as B1 = 1) or are restricted to obey a linear equation such as B4 = –2*B2. In SAS, you can use the RESTRICT statement in PROC REG to
![Restricted least squares regression in SAS](https://blogs.sas.com/content/iml/files/2020/09/restrictedReg3-614x336.png)
A data analyst recently asked a question about restricted least square regression in SAS. Recall that a restricted regression puts linear constraints on the coefficients in the model. Examples include forcing a coefficient to be 1 or forcing two coefficients to equal each other. Each of these problems can be
![Video: How to Write a Custom Parallel Program in SAS Viya](https://blogs.sas.com/content/iml/files/2020/09/actionvideo-702x336.png)
My 2020 SAS Global Forum paper was about how to write custom parallel programs by using the iml action in SAS Viya 3.5. My conference presentation was canceled because of the coronavirus pandemic, but I recently recorded a 15-minute video that summarizes the main ideas in the paper. One of
![Iterative proportional fitting in SAS](https://blogs.sas.com/content/iml/files/2020/09/RAS1.png)
I previously wrote about the RAS algorithm, which is a simple algorithm that performs matrix balancing. Matrix balancing refers to adjusting the cells of a frequency table to match known values of the row and column sums. Ideally, the balanced matrix will reflect the structural relationships in the original matrix.
![Matrix balancing: Update matrix cells to match row and column sums](https://blogs.sas.com/content/iml/files/2020/09/RAS1.png)
Matrix balancing is an interesting problem that has a long history. Matrix balancing refers to adjusting the cells of a frequency table to match known values of the row and column sums. One of the early algorithms for matrix balancing is known as the RAS algorithm, but it is also