Posts Tagged ‘ Matrix Computations ’

Ways to multiply in the SAS/IML language

May 20, 2013
By
Ways to multiply in the SAS/IML language

For programmers who are learning the SAS/IML language, it is sometimes confusing that there are two kinds of multiplication operators, whereas in the SAS DATA step there is only scalar multiplication. This article describes the multiplication operators in the SAS/IML language and how to use them to perform common tasks
Read more »

Tags: , ,
Posted in SAS | Comments Off

How to compute the distance between observations in SAS

March 27, 2013
By
How to compute the distance between observations in SAS

In statistics, distances between observations are used to form clusters, to identify outliers, and to estimate distributions. Distances are used in spatial statistics and in other application areas. There are many ways to define the distance between observations. I have previously written an article that explains Mahalanobis distance, which is
Read more »

Tags: , , ,
Posted in SAS | Comments Off

Got Matrix? Reach for the SAS/IML language

March 20, 2013
By
Got Matrix? Reach for the SAS/IML language

Someone recently asked a question on the SAS Support Communities about estimating parameters in ridge regression. I answered the question by pointing to a matrix formula in the SAS documentation. One of the advantages of the SAS/IML language is that you can implement matrix formulas in a natural way. The
Read more »

Tags: , , ,
Posted in SAS | Comments Off

Computing the nearest correlation matrix

November 28, 2012
By
Computing the nearest correlation matrix

Frequently someone will post a question to the SAS Support Community that says something like this: I am trying to do and SAS issues an error and reports that my correlation matrix is not positive definite. What is going on and how can I complete ? The
Read more »

Tags: , ,
Posted in SAS | Comments Off

When is a correlation matrix not a correlation matrix?

September 12, 2012
By
When is a correlation matrix not a correlation matrix?

This article is an excerpt from my forthcoming book Simulating Data with SAS. Not every matrix with 1 on the diagonal and off-diagonal elements in the range is a valid correlation matrix. A correlation matrix has a special property known as positive semidefiniteness. All correlation matrices are positive
Read more »

Tags: , ,
Posted in SAS | Comments Off

Construct a magic square of any size

August 29, 2012
By
Construct a magic square of any size

Magic squares are cool. Algorithms that create magic squares are even cooler. You probably remember magic squares from your childhood: they are n x n matrices that contain the numbers 1,2,...,n2 and for which the row sum, column sum, and the sum of both diagonals are the same value. There are many
Read more »

Tags: , ,
Posted in SAS | Comments Off

Extract the lower triangular elements of a matrix

August 16, 2012
By
Extract the lower triangular elements of a matrix

It is common to want to extract the lower or upper triangular elements of a matrix. For example, if you have a correlation matrix, the lower triangular elements are the nontrivial correlations between variables in your data. As I've written before, you can use the VECH function to extract the
Read more »

Tags: , , ,
Posted in SAS | Comments Off

The power operators: Powers of matrices and matrix elements

July 30, 2012
By
The power operators: Powers of matrices and matrix elements

I received the following question: In the DATA step I always use the ** operator to raise a values to a power, like this: x**2. But on your blog I you use the ## operator to raise values to a power in SAS/IML programs. Does SAS/IML not support the **
Read more »

Tags: , ,
Posted in SAS | Comments Off

Proc-x is looking for sponsors!

Dear readers, proc-x is looking for sponsors who would be willing to support the site in exchange for banner ads in the right sidebar of the site. If you are interested, please e-mail me at: [email protected]

Welcome!

SAS-X.com offers news and tutorials about the various SAS® software packages, contributed by bloggers. You are welcome to subscribe to e-mail updates, or add your SAS-blog to the site.

SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration.