Posts Tagged ‘ Tips and Techniques ’

Compute a moving average in SAS

January 27, 2016
By
Compute a moving average in SAS

A common question on SAS discussion forums is how to compute a moving average in SAS. This article shows how to use PROC EXPAND and contains links to articles that use the DATA step or macros to compute moving averages in SAS. In a previous post, I explained how to

The post Read more »

Tags: , ,
Posted in SAS | Comments Off on Compute a moving average in SAS

Arrange matrices and graphs in a gridded layout

December 2, 2015
By
Arrange matrices and graphs in a gridded layout

Last week my colleague Chris Hemedinger published a blog post that described how to use the ODS LAYOUT GRIDDED statement to arrange tables and graphs in a panel. The statement was introduced in SAS 9.4m1 (December 2013). Gridded layout is supported for HTML, POWERPOINT, and the PRINTER family of destinations

The post Read more »

Tags: , ,
Posted in SAS | Comments Off on Arrange matrices and graphs in a gridded layout

Trap and cap: Avoid division-by-zero and domain errors when evaluating functions

November 4, 2015
By
Trap and cap: Avoid division-by-zero and domain errors when evaluating functions

Statistical programmers often need to evaluate complicated expressions that contain square roots, logarithms, and other functions whose domain is restricted. Similarly, you might need to evaluate a rational expression in which the denominator of the expression can be zero. In these cases, it is important to avoid evaluating a function

The post Read more »

Tags: , , ,
Posted in SAS | Comments Off on Trap and cap: Avoid division-by-zero and domain errors when evaluating functions

The CUSUM-LAG trick in SAS/IML

October 30, 2015
By
The CUSUM-LAG trick in SAS/IML

Every year near Halloween I write a trick-and-treat article in which I demonstrate a simple programming trick that is a real treat to use. This year's trick features two of my favorite functions, the CUSUM function and the LAG function. By using these function, you can compute the rows of

The post Read more »

Tags: , ,
Posted in SAS | Comments Off on The CUSUM-LAG trick in SAS/IML

Generate evenly spaced points in an interval

September 14, 2015
By

I've previously written about how to generate a sequence of evenly spaced points in an interval. Evenly spaced data is useful for scoring a regression model on an interval. In the previous articles the endpoints of the interval were hard-coded. However, it is common to want to evaluate a function

The post Read more »

Tags: , ,
Posted in SAS | Comments Off on Generate evenly spaced points in an interval

Find the ODS table names produced by any SAS procedure

September 8, 2015
By

Statistical programmers often have to use the results from one SAS procedure as the input to another SAS procedure. Because ODS enables you to you to create a SAS data set from any ODS table or graph, it is easy to obtain a data set that contains the value of

The post Read more »

Tags: , ,
Posted in SAS | Comments Off on Find the ODS table names produced by any SAS procedure

Compute the number of digits in an integer

August 31, 2015
By

The title of this blog post might seem strange, but I occasionally need to compute the number of digits in a number, usually because I am trying to stuff an integer value into a string. Each time, I have to derive the formula from scratch, so I am writing this

The post Read more »

Tags: ,
Posted in SAS | Comments Off on Compute the number of digits in an integer

Ten tips for simulating data with SAS

August 24, 2015
By

One of my presentations at SAS Global Forum 2015 was titled "Ten Tips for Simulating Data with SAS". The paper was published in the conference proceedings several months ago, but I recently recorded a short video that gives an overview of the 10 tips: If your browser does not support

The post Read more »

Tags: , , , ,
Posted in SAS | Comments Off on Ten tips for simulating data with SAS

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



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.