# Posts Tagged ‘ Statistical Programming ’

## When is a histogram not a histogram? When it’s a table!

December 5, 2018
By

Recently a SAS programmer wanted to obtain a table of counts that was based on a histogram. I showed him how you can use the OUTHIST= option on the HISTOGRAM statement in PROC UNIVARIATE to obtain that information. For example, the following call to PROC UNIVARIATE creates a histogram for

The post Read more »

Tags: , ,
Posted in SAS | Comments Off on When is a histogram not a histogram? When it’s a table!

## Fast simulation of multivariate normal data with an AR(1) correlation structure

October 3, 2018
By

It is sometimes necessary for researchers to simulate data with thousands of variables. It is easy to simulate thousands of uncorrelated variables, but more difficult to simulate thousands of correlated variables. For that, you can generate a correlation matrix that has special properties, such as a Toeplitz matrix or a

The post Read more »

Tags: , , ,
Posted in SAS | Comments Off on Fast simulation of multivariate normal data with an AR(1) correlation structure

## Radial basis functions and Gaussian kernels in SAS

September 26, 2018
By

A radial basis function is a scalar function that depends on the distance to some point, called the center point, c. One popular radial basis function is the Gaussian kernel φ(x; c) = exp(-||x – c||2 / (2 σ2)), which uses the squared distance from a vector x to the

The post Read more »

Tags: , ,
Posted in SAS | Comments Off on Radial basis functions and Gaussian kernels in SAS

## Shuffling smackdown: Overhand shuffle versus riffle shuffle

September 19, 2018
By

Every day I’m shufflin'. Shufflin', shufflin'.       -- "Party Rock Anthem," LMFAO The most popular way to mix a deck of cards is the riffle shuffle, which separates the deck into two pieces and interleaves the cards from each piece. Besides being popular with card players, the riffle shuffle is

The post Read more »

Tags: ,
Posted in SAS | Comments Off on Shuffling smackdown: Overhand shuffle versus riffle shuffle

## Two interfaces for typing text by using a TV remote control

September 12, 2018
By

Have you ever tried to type a movie title by using a TV remote control? Both Netflix and Amazon Video provide an interface (a virtual keyboard) that enables you to use the four arrow keys of a standard remote control to type letters. The letters are arranged in a regular

The post Read more »

Tags: , ,
Posted in SAS | Comments Off on Two interfaces for typing text by using a TV remote control

## Distances on rectangular grids

September 10, 2018
By

Given a rectangular grid with unit spacing, what is the expected distance between two random vertices, where distance is measured in the L1 metric? (Here "random" means "uniformly at random.") I recently needed this answer for some small grids, such as the one to the right, which is a 7 x 6

The post Read more »

Tags: , , ,
Posted in SAS | Comments Off on Distances on rectangular grids

## Store vectors of different lengths in a matrix

September 4, 2018
By

In the SAS/IML language, you can only concatenate vectors that have conforming dimensions. For example, to horizontally concatenate two vectors X and Y, the symbols X and Y must have the same number of rows. If not, the statement Z = X || Y will produce an error: ERROR: Matrices

The post Read more »

Tags: ,
Posted in SAS | Comments Off on Store vectors of different lengths in a matrix

## Kernel regression in SAS

August 29, 2018
By

A SAS programmer recently asked me how to compute a kernel regression in SAS. He had read my blog posts "What is loess regression" and "Loess regression in SAS/IML" and was trying to implement a kernel regression in SAS/IML as part of a larger analysis. This article explains how to

The post Read more »

Tags: ,
Posted in SAS | Comments Off on Kernel regression in SAS

## 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.

## 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: tal.galili@gmail.com

## 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.