Posts Tagged ‘ Statistical Programming ’

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 »

How to create a string of a specified length in SAS/IML

May 12, 2014
By
How to create a string of a specified length in SAS/IML

In my recent post on how to understand character vectors in SAS/IML, I left out an important topic: How can you allocate a character vector of a specified length? In this article, "length" means the maximum number of characters in an element, not the number of elements in a vector. […]

Read more »

This article is actually fastidious: How spammers generate random comments for blogs

May 7, 2014
By
This article is actually fastidious: How spammers generate random comments for blogs

Last week Chris Hemedinger posted an article about spam that is sent to SAS blogs and discussed how anti-spam software helps to block spam. No algorithm can be 100% accurate at distinguishing spam from valid comments because of the inherent trade-off between specificity and sensitivity in any statistical test. Therefore, […]

Read more »

Blanks and lengths: Understanding SAS/IML character vectors

May 5, 2014
By
Blanks and lengths: Understanding SAS/IML character vectors

SAS programmers are probably familiar with how SAS stores a character variable in a data set, but how is a character vector stored in the SAS/IML language? Recall that a character variable is stored by using a fixed-width storage structure. In the SAS DATA step, the maximum number of characters […]

Read more »

Local functions (not!) in the SAS/IML language

April 21, 2014
By
Local functions (not!) in the SAS/IML language

I have previously written about the scope of local and global variables in the SAS/IML language. You might wonder whether SAS/IML modules can also have local scope. The answer is no. All SAS/IML modules are known globally and can be called by any other modules. Some object-oriented programming languages support […]

Read more »


Subscribe

Email:

  Subscribe