Posts Tagged ‘ simulation ’

Simulate data from the beta-binomial distribution in SAS

November 20, 2017
By
Simulate data from the beta-binomial distribution in SAS

This article shows how to simulate beta-binomial data in SAS and how to compute the density function (PDF). The beta-binomial distribution is a discrete compound distribution. The "binomial" part of the name means that the discrete random variable X follows a binomial distribution with parameters N (number of trials) and

The post Read more »

Tags: , ,
Posted in SAS | Comments Off on Simulate data from the beta-binomial distribution in SAS

Simulate correlations by using the Wishart distribution

October 11, 2017
By
Simulate correlations by using the Wishart distribution

The article "Fisher's transformation of the correlation coefficient" featured a Monte Carlo simulation that generated sample correlations from bivariate normal data. The simulation used three steps: Simulate B samples of size N from a bivariate normal distribution with correlation ρ. Use PROC CORR to compute the sample correlation matrix for

The post Read more »

Tags: ,
Posted in SAS | Comments Off on Simulate correlations by using the Wishart distribution

Data-driven simulation

September 27, 2017
By
Data-driven simulation

In a large simulation study, it can be convenient to have a "control file" that contains the parameters for the study. My recent article about how to simulate multivariate normal clusters demonstrates a simple example of this technique. The simulation in that article uses an input data set that contains

The post Read more »

Tags: , , ,
Posted in SAS | Comments Off on Data-driven simulation

Simulate multivariate normal data in SAS by using PROC SIMNORMAL

September 25, 2017
By
Simulate multivariate normal data in SAS by using PROC SIMNORMAL

My article about Fisher's transformation of the Pearson correlation contained a simulation. The simulation uses the RANDNORMAL function in SAS/IML software to simulate multivariate normal data. If you are a SAS programmer who does not have access to SAS/IML software, you can use the SIMNORMAL procedure in SAS/STAT software to

The post Read more »

Tags: ,
Posted in SAS | Comments Off on Simulate multivariate normal data in SAS by using PROC SIMNORMAL

Simulate multivariate clusters in SAS

September 13, 2017
By

This article shows how to simulate data from a mixture of multivariate normal distributions, which is also called a Gaussian mixture. You can use this simulation to generate clustered data. The adjacent graph shows three clusters, each simulated from a four-dimensional normal distribution. Each cluster has its own within-cluster covariance,

The post Read more »

Tags: ,
Posted in SAS | Comments Off on Simulate multivariate clusters in SAS

Random segments and broken sticks

July 26, 2017
By

A classical problem in elementary probability asks for the expected lengths of line segments that result from randomly selecting k points along a segment of unit length. It is both fun and instructive to simulate such problems. This article uses simulation in the SAS/IML language to estimate solutions to the

The post Read more »

Tags: ,
Posted in SAS | Comments Off on Random segments and broken sticks

Runs in coin tosses; patterns in random seating

June 5, 2017
By

If you toss a coin 28 times, you would not be surprised to see three heads in a row, such as ...THHHTH.... But what about eight heads in a row? Would a sequence such as THHHHHHHHTH... be a rare event? This question popped into my head last weekend as I

The post Read more »

Tags: , ,
Posted in SAS | Comments Off on Runs in coin tosses; patterns in random seating

How to choose a seed for generating random numbers in SAS

June 1, 2017
By

Last week I was asked a simple question: "How do I choose a seed for the random number functions in SAS?" The answer might surprise you: use any seed you like. Each seed of a well-designed random number generator is likely to give rise to a stream of random numbers,

The post Read more »

Tags: , ,
Posted in SAS | Comments Off on How to choose a seed for generating random numbers in SAS

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.