The DO Loop
Statistical programming in SAS with an emphasis on SAS/IML programs![7 ways to view correlation](https://blogs.sas.com/content/iml/files/2017/08/corrcoef5.png)
Correlation is a fundamental statistical concept that measures the linear association between two variables. There are multiple ways to think about correlation: geometrically, algebraically, with matrices, with vectors, with regression, and more. To paraphrase the great songwriter Paul Simon, there must be 50 ways to view your correlation! But don't
![The singular value decomposition and low-rank approximations](https://blogs.sas.com/content/iml/files/2017/08/svdrank5.png)
A previous article discussed the mathematical properties of the singular value decomposition (SVD) and showed how to use the SVD subroutine in SAS/IML software. This article uses the SVD to construct a low-rank approximation to an image. Applications include image compression and denoising an image. Construct a grayscale image The
![The singular value decomposition: A fundamental technique in multivariate data analysis Geometric interpretation of the singular value decomposition (SVD) as the product of a rotation/reflection, followed by a scaling, followed by another rotation/reflection.](https://blogs.sas.com/content/iml/files/2017/08/svd1.png)
The singular value decomposition (SVD) could be called the "billion-dollar algorithm" since it provides the mathematical basis for many modern algorithms in data science, including text mining, recommender systems (think Netflix and Amazon), image processing, and classification problems. Although the SVD was mathematically discovered in the late 1800s, computers have
![The arithmetic-geometric mean](https://blogs.sas.com/content/iml/files/2017/08/arithGeoMean2-640x336.png)
All statisticians are familiar with the classical arithmetic mean. Some statisticians are also familiar with the geometric mean. Whereas the arithmetic mean of n numbers is the sum divided by n, the geometric mean of n nonnegative numbers is the n_th root of the product of the numbers. The geometric
![6 tips for timing the performance of algorithms](https://blogs.sas.com/content/iml/files/2017/08/timingperf2-640x336.png)
When you implement a statistical algorithm in a vector-matrix language such as SAS/IML, R, or MATLAB, you should measure the performance of your implementation, which means that you should time how long a program takes to analyze data of varying sizes and characteristics. There are some general tips that can
![Use a bar chart to visualize pairwise correlations Bar chart of pairwise correlations between variables](https://blogs.sas.com/content/iml/files/2017/08/corrbarchart2-600x336.png)
Visualizing the correlations between variables often provides insight into the relationships between variables. I've previously written about how to use a heat map to visualize a correlation matrix in SAS/IML, and Chris Hemedinger showed how to use Base SAS to visualize correlations between variables. Recently a SAS programmer asked how