Since SAS 9.3, ODS Graphics was moved into Base SAS, which means the SAS/Graph license is not needed anymore to access ODS Graphics facilities. It’s definitely nice, but from customers’ point of view, it is not critical necessary: since the “minimum set of SAS system” in most SAS sessions includes the Base SAS, SAS/Stat...

Read more »

Tags: Base SAS, IML, Matrix, R, SAS, Statistics

Posted in SAS | Comments Off on Incorporate SAS/IML to Base SAS?

A colleague asked for help with randomly choosing a kid within a family. This is for a trial in which families are recruited at well-child visits, but in each family only one of the children having a well-child visit that day can be in the study. The...

Read more »

Tags: apply(), capture.output(), Matrix, methods(), proc freq, rand function, replicate(), sample(), SAS formats, SAS macro

Posted in SAS | Comments Off on Example 9.35: Discrete randomization and formatted output

In examples 9.30 and 9.31 we explored corrections for multiple testing and then extracting p-values adjusted by the Benjamini and Hochberg (or FDR) procedure. In this post we'll develop a simulation to explore the impact of "strong" and "weak" control...

Read more »

Tags: apply(), ifelse(), Matrix, p.adjust(), proc multtest, proc transpose, SAS macro, simulation studies

Posted in SAS | Comments Off on Example 9.32: Multiple testing simulation

To celebrate the beginning of the professional baseball season here in the US and Canada, we revisit a famous example of using baseball data to demonstrate statistical properties. In 1977, Bradley Efron and Carl Morris published a paper about the Jame...

Read more »

Tags: axis statement, baseball, James-Stein estimator, match() function, matlines(), matplot(), Matrix, pointlabel option, shrinkage estimator, sports statistics, Stein estimator, text(), title statement

Posted in SAS | Comments Off on Example 9.27: Baseball and shrinkage

The so-called birthday paradox or birthday problem is simply the counter-intutitive discovery that the probability of (at least) two people in a group sharing a birthday goes up surprisingly fast as the group size increases. If the group is only 23 peo...

Read more »

Tags: apply(), arrays, axis statement, ceiling(), for(), Matrix, mdy function, paste(), probability, range of variables, sapply(), symbol statement

Posted in SAS | Comments Off on Example 9.21: The birthday "problem" re-examined

The SAS/IML language provides two functions for solving a nonsingular nxn linear system A*x = c: The INV function numerically computes the inverse matrix, A-1. You can use this to solve for x: Ainv = inv(A); x = Ainv*c;. The SOLVE function numerically ...

Read more »

Tags: Efficiency, Getting Started, inverse, Matrix, Numerical Analysis, solve, Statistical Programming

Posted in SAS | Comments Off on Do you really need to compute that matrix inverse?

A matrix is an array of numbers or character strings. When I print a matrix, I usually want to see only the data. However, sometimes it is helpful to add row or column headings that indicate the names of variables or labels for rows. A simple example i...

Read more »

Tags: Getting Started, Matrix, print, SAS/IML, Uncategorized

Posted in SAS | Comments Off on Options for Printing a Matrix

Scatterplots can get very hard to interpret when displaying large datasets, as points inevitably overplot and can't be individually discerned. A number of approaches have been crafted to help with this problem. One approach uses binning. This approa...

Read more »

Tags: binning, heat map, hexagon, hexbin package, hexbin(), large datasets, MASS library, Matrix, multivariate normal, mvrnorm(), proc gmap, proc simnormal

Posted in SAS | Comments Off on Example 9.1: Scatterplots with binning for large datasets