SAS

Blogs on the SAS software

Do you write unnecessary SAS statements?

July 20, 2016
By
Do you write unnecessary SAS statements?

I'm addicted to you. You're a hard habit to break. Such a hard habit to break. —  Chicago, "Hard Habit To Break" Habits are hard to break. For more than 20 years I've been putting semicolons at the end of programming statements in SAS, C/C++, and Java/Javascript. But lately I've been […] The post Do you write unnecessary SAS statements? appeared first on The DO Loop.

Read more »

Color markers in a scatter plot by a third variable in SAS

July 18, 2016
By
Color markers in a scatter plot by a third variable in SAS

One of my favorite new features in PROC SGPLOT in SAS 9.4m2 is addition of the COLORRESPONSE= and COLORMODEL= options to the SCATTER statement. By using these options, it is easy to color markers in a scatter plot so that the colors indicate the values of a continuous third variable. […] The post Color markers in a scatter plot by a third variable in SAS appeared first on The DO…

Read more »

Absorbing Markov chains in SAS

July 13, 2016
By
Absorbing Markov chains in SAS

Last week I showed how to represent a Markov transition matrix in the SAS/IML matrix language. I also showed how to use matrix multiplication to iterate a state vector, thereby producing a discrete-time forecast of the state of the Markov chain system. This article shows that the expected behavior of […] The post Absorbing Markov chains in SAS appeared first on The DO Loop.

Read more »

Break a sentence into words in SAS

July 11, 2016
By
Break a sentence into words in SAS

Two of my favorite string-manipulation functions in the SAS DATA step are the COUNTW function and the SCAN function. The COUNTW function counts the number of words in a long string of text. Here "word" means a substring that is delimited by special characters, such as a space character, a […] The post Break a sentence into words in SAS appeared first on The DO Loop.

Read more »

Markov transition matrices in SAS/IML

July 7, 2016
By
Markov transition matrices in SAS/IML

Many computations in elementary probability assume that the probability of an event is independent of previous trials. For example, if you toss a coin twice, the probability of observing "heads" on the second toss does not depend on the result of the first toss. However, there are situations in which […] The post Markov transition matrices in SAS/IML appeared first on The DO Loop.

Read more »

Cantor sets, the devil’s staircase, and probability

July 5, 2016
By
Cantor sets, the devil’s staircase, and probability

Last week I blogged about how to draw the Cantor function in SAS. The Cantor function is used in mathematics as a pathological example of a function that is constant almost everywhere yet somehow manages to "climb upwards," thus earning the nickname "the devil's staircase." The Cantor function has three […] The post Cantor sets, the devil's staircase, and probability appeared first on The DO Loop.

Read more »

Visualize the Cantor function in SAS

June 29, 2016
By
Visualize the Cantor function in SAS

I was a freshman in college the first time I saw the Cantor middle-thirds set and the related Cantor "Devil's staircase" function. (Shown at left.) These constructions expanded my mind and led me to study fractals, real analysis, topology, and other mathematical areas. The Cantor function and the Cantor middle-thirds […] The post Visualize the Cantor function in SAS appeared first on The DO Loop.

Read more »

In praise of simple graphics

June 27, 2016
By
In praise of simple graphics

'Tis a gift to be simple. -- Shaker hymn In June 2015 I published a short article for Significance, a magazine that features statistical and data-related articles that are of general interest to a wide a range of scientists. The title of my article is "In Praise of Simple Graphics." […] The post In praise of simple graphics appeared first on The DO Loop.

Read more »

Use the EFFECTPLOT statement to visualize regression models in SAS

June 22, 2016
By
Use the EFFECTPLOT statement to visualize regression models in SAS

Graphs enable you to visualize how the predicted values for a regression model depend on the model effects. You can gain an intuitive understanding of a model by using the EFFECTPLOT statement in SAS to create graphs like the one shown at the top of this article. Many SAS regression […] The post Use the EFFECTPLOT statement to visualize regression models in SAS appeared first on The DO Loop.

Read more »

The SELECT statement in the SAS DATA step

June 20, 2016
By
The SELECT statement in the SAS DATA step

Every beginning SAS programmer learns the simple IF-THEN/ELSE statement for conditional processing in the SAS DATA step. The basic If-THEN statement handles two cases: if a condition is true, the program does one thing, otherwise the program does something else. Of course, you can handle more cases by using multiple […] The post The SELECT statement in the SAS DATA step appeared first on The DO Loop.

Read more »


Subscribe

Email:

  Subscribe