The DO Loop
Statistical programming in SAS with an emphasis on SAS/IML programs![Create a SAS macro variable that contains a list of values](https://blogs.sas.com/content/iml/files/2017/01/AdvancedAnalytics-2.png)
Parameters in SAS procedures are specified a list of values that you manually type into the procedure syntax. For example, if you want to specify a list of percentile values in PROC UNIVARIATE, you need to type the values into the PCTLPTS= option as follows: proc univariate data=sashelp.cars noprint; var
![Twelve posts from 2015 that deserve a second look](https://blogs.sas.com/content/iml/files/2017/01/AdvancedAnalytics-2.png)
I began 2016 by compiling a list of popular articles from my blog in 2015. This "People's Choice" list contains many interesting articles, but some of my personal favorites did not make the list. Today I present the "Editor's Choice" list of articles that deserve a second look. I've grouped
![Compute a weighted mean in SAS](https://blogs.sas.com/content/iml/files/2015/12/weightedmean2.png)
Weighted averages are all around us. Teachers use weighted averages to assign a test more weight than a quiz. Schools use weighted averages to compute grade-point averages. Financial companies compute the return on a portfolio as a weighted average of the component assets. Financial charts show (linearly) weighted moving averages
![Extracting elements from a matrix: rows, columns, submatrices, and indices](https://blogs.sas.com/content/iml/files/2015/11/t_extract.png)
A matrix is a convenient way to store an array of numbers. However, often you need to extract certain elements from a matrix. The SAS/IML language supports two ways to extract elements: by using subscripts or by using indices. Use subscripts when you are extracting a rectangular portion of a
![Can't find that data? Search all variables in all data sets](https://blogs.sas.com/content/iml/files/2015/10/findvariables.png)
Sometimes I can't remember where I put things. If I lose my glasses or garden tools, I am out of luck. But when I can't remember where I put some data, I have SAS to help me find it. When I can remember the name of the data set, my
![Exact tests in PROC FREQ: What, when, and how](https://blogs.sas.com/content/iml/files/2017/01/AdvancedAnalytics-2.png)
Did you know that the FREQ procedure in SAS can compute exact p-values for more than 20 statistical tests and statistics that are associated with contingency table? Mamma mia! That's a veritable smorgasbord of options! Some of the tests are specifically for one-way tables or 2 x 2 tables, but many apply