Posts Tagged ‘ Statistical Programming ’

Elementwise minimum and maximum operators

December 15, 2014
By
Elementwise minimum and maximum operators

Like most programming languages, the SAS/IML language has many functions. However, the SAS/IML language also has quite a few operators. Operators can act on a matrix or on rows or columns of a matrix. They are less intuitive, but can be quite powerful because they enable you perform computations without […]

Read more »

Compute maximum and minimum values for rows and columns in SAS

December 1, 2014
By
Compute maximum and minimum values for rows and columns in SAS

A common question on SAS discussion forums is how to compute the minimum and maximum values across several variables. It is easy to compute statistics across rows by using the DATA step. This article shows how to compute the minimum and maximum values for each observation (across variables) and, for […]

Read more »

The name of a parameter in the parent environment

October 8, 2014
By
The name of a parameter in the parent environment

SAS/IML 13.1 includes a handy function for programmers who write a lot of modules. The PARENTNAME function obtains the name of the symbol that was passed in as a parameter to a user-defined module. How is this useful? Well, suppose that you want to create a SAS/IML module that prints […]

Read more »

Lexicographic combinations in SAS

July 28, 2014
By
Lexicographic combinations in SAS

In a previous blog post, I described how to generate combinations in SAS by using the ALLCOMB function in SAS/IML software. The ALLCOMB function in Base SAS is the equivalent function for DATA step programmers. Recall that a combination is a unique arrangement of k elements chosen from a set […]

Read more »

The SAS/IML File Exchange is open

July 16, 2014
By
The SAS/IML File Exchange is open

Have you written a SAS/IML program that you think is particularly clever? Are you the proud author of SAS/IML functions that extend the functionality of SAS software? You've worked hard to develop, debug, and test your program, so why not share it with others? There is now a central location […]

Read more »

A log transformation of positive and negative values

July 14, 2014
By
A log transformation of positive and negative values

In my four years of blogging, the post that has generated the most comments is "How to handle negative values in log transformations." Many people have written to describe data that contain negative values and to ask for advice about how to log-transform the data. Today I describe a transformation […]

Read more »

Approximating a distribution from published quantiles

June 18, 2014
By
Approximating a distribution from published quantiles

A colleague asked me an interesting question: I have a journal article that includes sample quantiles for a variable. Given a new data value, I want to approximate its quantile. I also want to simulate data from the distribution of the published data. Is that possible? This situation is common. […]

Read more »

Geometry, sensitivity, and parameters of the lognormal distribution

June 13, 2014
By
Geometry, sensitivity, and parameters of the lognormal distribution

Today is my 500th blog post for The DO Loop. I decided to celebrate by doing what I always do: discuss a statistical problem and show how to solve it by writing a program in SAS. Two ways to parameterize the lognormal distribution I recently blogged about the relationship between […]

Read more »

How to generate a grid of points in SAS

June 9, 2014
By
How to generate a grid of points in SAS

In many areas of statistics, it is convenient to be able to easily construct a uniform grid of points. You can use a grid of parameter values to visualize functions and to get a rough feel for how an objective function in an optimization problem depends on the parameters. And […]

Read more »

Simulate lognormal data with specified mean and variance

June 4, 2014
By
Simulate lognormal data with specified mean and variance

In my book Simulating Data with SAS, I specify how to generate lognormal data with a shape and scale parameter. The method is simple: you use the RAND function to generate X ~ N(μ, σ), then compute Y = exp(X). The random variable Y is lognormally distributed with parameters μ […]

Read more »


Subscribe

Email:

  Subscribe