Posts Tagged ‘ simulation ’

Simulate data for a regression model with categorical and continuous variables

January 28, 2019
By
Simulate data for a regression model with categorical and continuous variables

This article shows how to use SAS to simulate data that fits a linear regression model that has categorical regressors (also called explanatory or CLASS variables). Simulating data is a useful skill for both researchers and statistical programmers. You can use simulation for answering research questions, but you can also

The post Read more »

Tags: , ,
Posted in SAS | Comments Off on Simulate data for a regression model with categorical and continuous variables

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

October 3, 2018
By
Fast simulation of multivariate normal data with an AR(1) correlation structure

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

The post Read more »

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
The probability that two random chords of a circle intersect

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?"

The post Read more »

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

The post Read more »

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
Sample and obtain the results in random order

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,

The post Read more »

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
Independent streams of random numbers in SAS

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

The post Read more »

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
Independence and overlap in streams of random numbers

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

The post Read more »

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

Random permutations without duplicates

April 16, 2018
By
Random permutations without duplicates

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

The post Read more »

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

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.

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: tal.galili@gmail.com
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.