Posts Tagged ‘ Sampling and Simulation ’

Alternate ways to simulate multinomial data

August 7, 2013
By
Alternate ways to simulate multinomial data

My previous post described the multinomial distribution and showed how to generate random data from the multinomial distribution in SAS by using the RANDMULTINOMIAL function in SAS/IML software. The RANDMULTINOMIAL function is simple to use and implements an efficient algorithm called the sequential conditional marginal method (see Gentle (2003), p.
Read more »

Tags: ,
Posted in SAS | Comments Off

Simulate from the multinomial distribution in SAS

August 5, 2013
By
Simulate from the multinomial distribution in SAS

This article describes how to generate random samples from the multinomial distribution in SAS. The content is taken from Chapter 8 of my book Simulating Data with SAS. The multinomial distribution is a discrete multivariate distribution. Suppose there are k different types of items in a box, such as a
Read more »

Tags: ,
Posted in SAS | Comments Off

Implement the truncated normal distribution in SAS

July 24, 2013
By
Implement the truncated normal distribution in SAS

This article describes how to implement the truncated normal distribution in SAS. Although the implementation in this article uses the SAS/IML language, you can also implement the ideas and formulas by using the DATA step and PROC FCMP. For reference, I recommend the Wikipedia article on the truncated normal distribution.
Read more »

Tags: ,
Posted in SAS | Comments Off

The inverse CDF method for simulating from a distribution

July 22, 2013
By
The inverse CDF method for simulating from a distribution

There are many techniques for generating random variates from a specified probability distribution such as the normal, exponential, or gamma distribution. However, one technique stands out because of its generality and simplicity: the inverse CDF sampling technique. If you know the cumulative distribution function (CDF) of a probability distribution, then
Read more »

Tags: , ,
Posted in SAS | Comments Off

Six reasons you should stop using the RANUNI function to generate random numbers

July 10, 2013
By
Six reasons you should stop using the RANUNI function to generate random numbers

Are you still using the old RANUNI, RANNOR, RANBIN, and other "RANXXX" functions to generate random numbers in SAS? If so, here are six reasons why you should switch from these older (1970s) algorithms to the newer (late 1990s) Mersenne-Twister algorithm, which is implemented in the RAND function. The newer
Read more »

Tags: , ,
Posted in SAS | Comments Off

Duplicate values in a stream of random numbers

July 3, 2013
By
Duplicate values in a stream of random numbers

As I wrote in my previous post, a SAS customer noticed that he was getting some duplicate values when he used the RAND function to generate a large number of random uniform values on the interval . He wanted to know if this result indicates a bug in the RAND
Read more »

Tags: , , ,
Posted in SAS | Comments Off

Duplicate values in random numbers: Tossing dice and sharing birthdays

July 1, 2013
By

Tossing dice is a simple and familiar process, yet it can illustrate deep and counterintuitive aspects of random numbers. For example, if you toss four identical six-sided dice, what is the probability that the faces are all distinct, as shown to the left? Many people would guess that the probability
Read more »

Tags: , ,
Posted in SAS | Comments Off

Using simulation to compute a power curve

June 5, 2013
By
Using simulation to compute a power curve

Last week I showed how to use simulation to estimate the power of a statistical test. I used the two-sample t test to illustrate the technique. In my example, the difference between the means of two groups was 1.2, and the simulation estimated a probability of 0.72 that the t
Read more »

Tags: , ,
Posted in SAS | Comments Off

Proc-x is looking for sponsors!

Dear readers, proc-x is looking for sponsors who would be willing to support the site in exchange for banner ads in the right sidebar of the site. If you are interested, please e-mail me at: [email protected]

Welcome!

SAS-X.com offers news and tutorials about the various SAS® software packages, contributed by bloggers. You are welcome to subscribe to e-mail updates, or add your SAS-blog to the site.

SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration.