Blog Archives

The arithmetic-geometric mean

August 23, 2017
By
The arithmetic-geometric mean

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 [...] The post The arithmetic-geometric mean appeared first on The DO Loop.

Read more »

6 tips for timing the performance of algorithms

August 21, 2017
By
6 tips for timing the performance of algorithms

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 [...] The post 6 tips for timing the performance of algorithms appeared first on The DO Loop.

Read more »

Use a bar chart to visualize pairwise correlations

August 16, 2017
By
Use a bar chart to visualize pairwise correlations

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 [...] The post Use a bar chart to visualize pairwise correlations appeared first on The DO Loop.

Read more »

What is rank correlation?

August 14, 2017
By
What is rank correlation?

When someone refers to the correlation between two variables, they are probably referring to the Pearson correlation, which is the standard statistic that is taught in elementary statistics courses. Elementary courses do not usually mention that there are other measures of correlation. Why would anyone want a different estimate of [...] The post What is rank correlation? appeared first on The DO Loop.

Read more »

Robust principal component analysis in SAS

August 9, 2017
By
Robust principal component analysis in SAS

Recently, I was asked whether SAS can perform a principal component analysis (PCA) that is robust to the presence of outliers in the data. A PCA requires a data matrix, an estimate for the center of the data, and an estimate for the variance/covariance of the variables. Classically, these estimates [...] The post Robust principal component analysis in SAS appeared first on The DO Loop.

Read more »

The curse of non-unique eigenvectors

August 7, 2017
By
The curse of non-unique eigenvectors

A SAS customer asked, "I computed the eigenvectors of a matrix in SAS and in another software package. I got different answers? How do I know which answer is correct?" I've been asked variations of this question dozens of times. The answer is usually "both answers are correct." The mathematical [...] The post The curse of non-unique eigenvectors appeared first on The DO Loop.

Read more »

Dimension reduction: Guidelines for retaining principal components

August 2, 2017
By
Dimension reduction: Guidelines for retaining principal components

Last week I blogged about the broken-stick problem in probability, which reminded me that the broken-stick model is one of the many techniques that have been proposed for choosing the number of principal components to retain during a principal component analysis. Recall that for a principal component analysis (PCA) of [...] The post Dimension reduction: Guidelines for retaining principal components appeared first on The DO Loop.

Read more »

Flip it. Flip it good.

July 31, 2017
By
Flip it. Flip it good.

A SAS user needed to convert a program from MATLAB into the SAS/IML matrix language and asked whether there is a SAS/IML equivalent to the fliplr and flipud functions in MATLAB. These functions flip the columns or rows (respectively) of a matrix; "LR" stands for "left-right" and "UD" stands for [...] The post Flip it. Flip it good. appeared first on The DO Loop.

Read more »

Random segments and broken sticks

July 26, 2017
By
Random segments and broken sticks

A classical problem in elementary probability asks for the expected lengths of line segments that result from randomly selecting k points along a segment of unit length. It is both fun and instructive to simulate such problems. This article uses simulation in the SAS/IML language to estimate solutions to the [...] The post Random segments and broken sticks appeared first on The DO Loop.

Read more »

Difference operators as matrices

July 24, 2017
By
Difference operators as matrices

For a time series { y1, y2, ..., yN }, the difference operator computes the difference between two observations. The kth-order difference is the series { yk+1 - y1, ..., yN - yN-k }. In SAS, the DIF function in the DATA step computes differences between observations. The DIF function [...] The post Difference operators as matrices appeared first on The DO Loop.

Read more »


Subscribe

Email:

  Subscribe