# SAS

Blogs on the SAS software

## %SVD macro with BY-Processing

December 18, 2014
By

For the Regularized Discriminant Analysis Cross Validation, we need to compute SVD for each pair of $$(\lambda, \gamma)$$, and the factorization result will be feed to the downdating algorithm to obtain leave one out variance-covariance matrix \(\hat{\...

## Self-similar structures from Kronecker products

December 17, 2014
By

I recently posted an article about self-similar structures that arise in Pascal's triangle. Did you know that the Kronecker product (or direct product) can be used to create matrices that have self-similar structure? The basic idea is to start with a 0/1 matrix and compute a sequence of direct products […]

## Learning R: Live Webinar, Interactive Self-Paced, or Site Visit?

December 15, 2014
By

My recent blog post, Why R is Hard to Learn, must have hit a nerve as it was read by over 6,000 people in its first two days online.  If you’re using R to augment your work in SAS, SPSS … Continue reading →

## Elementwise minimum and maximum operators

December 15, 2014
By

Like most programming languages, the SAS/IML language has many functions. However, the SAS/IML language also has quite a few operators. Operators can act on a matrix or on rows or columns of a matrix. They are less intuitive, but can be quite powerful because they enable you perform computations without […]

## Experient downdating algorithm for Leave-One-Out CV in RDA

December 15, 2014
By

In this post, I want to demonstrate a piece of experiment code for downdating algorithm for Leave-One-Out (LOO) Cross Validation in Regularized Discriminant Analysis [1]. In LOO CV, the program needs to calculate the inverse of \(\hat{\Sigma}_{k\v}(\la...

## Control Excel via SAS DDE & Python win32com

December 15, 2014
By

Excel is probably the most used interface between human and data. Whenever you are dealing with business people, Excel is the de facto means for all things about data processing. I used to only use SAS and Python for number crunching but in one of my r...

## A Christmas tree from Pascal’s triangle

December 10, 2014
By

O Christmas tree, O Christmas tree, One year a fractal made thee! O Christmas tree, O Christmas tree, A heat map can display thee! From Pascal's matrix we define! Reflect across, divide by nine. O Christmas tree, O Christmas tree, Self-similar and so divine! Eventually I will run out of […]

## Updated: Why R is Hard to Learn

December 10, 2014
By

I’ve updated one of my most widely read blog posts, Why R is Hard to Learn. It focuses on the aspects of R which tend to trip up beginners. The new version is over twice as long as the original … Continue reading →

## The direct product (Kronecker product) in SAS

December 8, 2014
By

There are many ways to multiply scalars, vectors, and matrices, but the Kronecker product (also called the direct product) is multiplication on steroids. The Kronecker product looks scary, but it is actually simple. The Kronecker product is merely a way to pack multiples of a matrix B into a block […]

## A matrix computation on Pascal’s triangle

December 5, 2014
By

A colleague asked me a question regarding my recent post about the Pascal triangle matrix. While responding to his question, I discovered a program that I had written in 1999 that computed with a Pascal triangle matrix. Wow, I've been computing with Pascal's triangle for 15 years! I don't know […]