# Posts Tagged ‘ Matrix Computations ’

## Matrix multiplication with missing values in SAS

March 11, 2015
By

Sometimes I get contacted by SAS/IML programmers who discover that the SAS/IML language does not provide built-in support for multiplication of matrices that have missing values. (SAS/IML does support elementwise operations with missing values.) I usually respond by asking what they are trying to accomplish, because mathematically matrix multiplication with

Tags: , ,
Posted in SAS | Comments Off

## Ways to multiply in the SAS/IML language

May 20, 2013
By

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

Tags: , ,
Posted in SAS | Comments Off

## How to compute the distance between observations in SAS

March 27, 2013
By

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

Tags: , , ,
Posted in SAS | Comments Off

## Got Matrix? Reach for the SAS/IML language

March 20, 2013
By

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

Tags: , , ,
Posted in SAS | Comments Off

## Computing the nearest correlation matrix

November 28, 2012
By

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

Tags: , ,
Posted in SAS | Comments Off

## When is a correlation matrix not a correlation matrix?

September 12, 2012
By

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

Tags: , ,
Posted in SAS | Comments Off

## Construct a magic square of any size

August 29, 2012
By

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

Tags: , ,
Posted in SAS | Comments Off

## Extract the lower triangular elements of a matrix

August 16, 2012
By

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

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.

## Recent Posts

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.