Posts Tagged ‘ Getting Started ’

Those tricky PERCENT formats

August 10, 2015
By
Those tricky PERCENT formats

When using SAS to format a number as a percentage, there is a little trick that you need to remember: the width of the formatted value must include room for the decimal point, the percent sign, and the possibility of two parentheses that indicate negative values. The field width must […] The post Those tricky PERCENT formats appeared first on The DO Loop.

Read more »

Convert a vector to a string

July 27, 2015
By
Convert a vector to a string

Base SAS contains many functions for processing strings, and you can call these functions from within a SAS/IML program. However, sometimes a SAS/IML programmer needs to process a vector of strings. No problem! You can call most Base SAS functions with a vector of parameters. I have previously written about […] The post Convert a vector to a string appeared first on The DO Loop.

Read more »

Create a density curve with shaded tails

July 20, 2015
By
Create a density curve with shaded tails

A SAS programmer wanted to plot the normal distribution and highlight the area under curve that corresponds to the tails of the distribution. For example, the following plot shows the lower decile shaded in blue and the upper decile shaded in red. An easy way to do this in SAS […] The post Create a density curve with shaded tails appeared first on The DO Loop.

Read more »

Compare the performance of algorithms in SAS

July 13, 2015
By
Compare the performance of algorithms in SAS

As my colleague Margaret Crevar recently wrote, it is useful to know how long SAS programs take to run. Margaret and others have written about how to use the SAS FULLSTIMER option to monitor the performance of the SAS system. In fact, SAS distributes a macro that enables you to […] The post Compare the performance of algorithms in SAS appeared first on The DO Loop.

Read more »

An easy way to use numbers for column headers

June 29, 2015
By
An easy way to use numbers for column headers

When I am computing with SAS/IML matrices and vectors, I often want to label the columns or rows so that I can better understand the data. The labels are called headers, and the COLNAME= and ROWNAME= options in the SAS/IML PRINT statement enable you to add headers for columns and […] The post An easy way to use numbers for column headers appeared first on The DO Loop.

Read more »

Everything you wanted to know about writing SAS/IML modules

June 17, 2015
By
Everything you wanted to know about writing SAS/IML modules

One of the fundamental principles of computer programming is to break a task into smaller subtasks and to modularize the program by encapsulating each subtask into its own function. I have written many blog posts over the years about how to define and use functions in the SAS/IML language. I […] The post Everything you wanted to know about writing SAS/IML modules appeared first on The DO Loop.

Read more »

SAS/IML functions that operate on columns of a matrix

June 1, 2015
By
SAS/IML functions that operate on columns of a matrix

A SAS programmer asked for a list of SAS/IML functions that operate on the columns of an n x p matrix and return a 1 x p row vector of results. The functions that behave this way tend to compute univariate descriptive statistics such as the mean, median, standard deviation, and quantiles. The following […] The post SAS/IML functions that operate on columns of a matrix appeared first on The DO Loop.

Read more »

Five reasons to use ODS EXCLUDE to suppress SAS output

May 28, 2015
By
Five reasons to use ODS EXCLUDE to suppress SAS output

I previously wrote about the best way to suppress output from SAS procedures. Suppressing output is necessary in simulation and bootstrap analyses, and it is useful in other contexts as well. In my previous article, I wrote, "many programmers use ODS _ALL_ CLOSE as a way to suppress output, but […] The post Five reasons to use ODS EXCLUDE to suppress SAS output appeared first on The DO Loop.

Read more »

Finding observations that satisfy multiple conditions: The LOC-ELEMENT technique

May 11, 2015
By
Finding observations that satisfy multiple conditions: The LOC-ELEMENT technique

A common task in data analysis is to locate observations that satisfy multiple criteria. For example, you might want to locate all zip codes in certain counties within specified states. The SAS DATA step contains the powerful WHERE statement, which enables you to extract a subset of data that satisfy […] The post Finding observations that satisfy multiple conditions: The LOC-ELEMENT technique appeared first on The DO Loop.

Read more »

An easy way to clear your SAS titles

May 4, 2015
By
An easy way to clear your SAS titles

Did you know that if you have set multiple titles in SAS, that there is an easy way to remove them? For example, suppose that you've written the following statements, which call the TITLE statement to set three titles: title "A Great Big Papa Title"; title2 "A Medium-sized Mama Title"; […] The post An easy way to clear your SAS titles appeared first on The DO Loop.

Read more »


Subscribe

Email:

  Subscribe