# Posts Tagged ‘ simulation ’

## Fast simulation of multivariate normal data with an AR(1) correlation structure

October 3, 2018
By

It is sometimes necessary for researchers to simulate data with thousands of variables. It is easy to simulate thousands of uncorrelated variables, but more difficult to simulate thousands of correlated variables. For that, you can generate a correlation matrix that has special properties, such as a Toeplitz matrix or a

Tags: , , ,
Posted in SAS | Comments Off on Fast simulation of multivariate normal data with an AR(1) correlation structure

## The probability that two random chords of a circle intersect

July 11, 2018
By

In a previous article, I showed how to find the intersection (if it exists) between two line segments in the plane. There are some fun problems in probability theory that involve intersections of line segments. One is "What is the probability that two randomly chosen chords of a circle intersect?"

Tags: , ,
Posted in SAS | Comments Off on The probability that two random chords of a circle intersect

## Video: New random number generators in SAS

June 15, 2018
By

My 2018 SAS Global Forum paper was about "how to use the random-number generators (RNGs) in SAS." You can read the paper for details, but I recently recorded a short video that summarizes the main ideas in the paper. In particular, the video gives an overview of the new RNGs

Tags: , , ,
Posted in SAS | Comments Off on Video: New random number generators in SAS

## Sample and obtain the results in random order

June 6, 2018
By

The SURVEYSELECT procedure in SAS 9.4M5 supports the OUTRANDOM option, which causes the selected items in a simple random sample to be randomly permuted after they are selected. This article describes several statistical tasks that benefit from this option, including simulating card games, randomly permuting observations in a DATA step,

Tags: , ,
Posted in SAS | Comments Off on Sample and obtain the results in random order

## Independent streams of random numbers in SAS

May 9, 2018
By

In a previous blog post, I discussed ways to produce statistically independent samples from a random number generator (RNG). The best way is to generate all samples from one stream. However, if your program uses two or more SAS DATA steps to simulate the data, you cannot use the same

Tags: , ,
Posted in SAS | Comments Off on Independent streams of random numbers in SAS

## Independence and overlap in streams of random numbers

May 7, 2018
By

Simulation studies require both randomness and reproducibility, two qualities that are sometimes at odds with each other. A Monte Carlo simulation might need to generate millions of random samples, where each sample contains dozens of continuous variables and many thousands of observations. In simulation studies, the researcher wants each sample

Tags: , ,
Posted in SAS | Comments Off on Independence and overlap in streams of random numbers

## Random permutations without duplicates

April 16, 2018
By

A colleague and I recently discussed how to generate random permutations without encountering duplicates. Given a set of n items, there are n! permutations My colleague wants to generate k unique permutations at random from among the total of n!. Said differently, he wants to sample without replacement from the

Tags: , ,
Posted in SAS | Comments Off on Random permutations without duplicates

## A zipper plot for visualizing coverage probability in simulation studies

March 26, 2018
By

Simulation studies are used for many purposes, one of which is to examine how distributional assumptions affect the coverage probability of a confidence interval. This article describes the "zipper plot," which enables you to compare the coverage probability of a confidence interval when the data do or do not follow

Tags: , ,
Posted in SAS | Comments Off on A zipper plot for visualizing coverage probability in simulation studies

## 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.