Posts Tagged ‘ simulation studies ’

Example 8.36: Quadratic equation with real roots

April 29, 2011
By
Example 8.36: Quadratic equation with real roots

We often simulate data in SAS or R to confirm analytical results. For example, consider the following problem from the excellent text by Rice:Let U1, U2, and U3 be independent random variables uniform on . What is the probability that the roots...

Read more »

Example 8.28: should we buy snowstorm insurance?

February 28, 2011
By
Example 8.28: should we buy snowstorm insurance?

It's been a long winter so far in New England, with many a snow storm. In this entry, we consider a simulation to complement the analytic solution for a probability problem concerning snow. Consider a company that buys a policy to insure its revenue ...

Read more »

Example 7.23: the Monty Hall problem

January 20, 2010
By
Example 7.23: the Monty Hall problem

The Monty Hall problem illustrates a simple setting where intuition often leads to a solution different from formal reasoning. The situation is based on the game show Let's Make a Deal. First, Monty puts a prize behind one of three doors. Then the player chooses a door. Next, (without moving the pize) Monty opens an...

Read more »

Example 7.21: Write a function to simulate categorical data

January 8, 2010
By
Example 7.21: Write a function to simulate categorical data

In example 7.20, we showed how to simulate categorical data. But we might anticipate needing to do that frequently. If a SAS function weren't built in and an equivalent R function not available in a package, we could build them from scratch.SASThe SAS code is particularly tortured, since we must parse the parameter string to extract the...

Read more »

Example 7.20: Simulate categorical data

January 4, 2010
By
Example 7.20: Simulate categorical data

Both SAS and R provide means of simulating categorical data (see section 1.10.4). Alternatively, it is trivial to write code to do this directly. In this entry, we show how to do it once. In a future entry, we'll demonstrate writing a SAS Macro (section A.8.1) and a function in R (section B.5.2) to do it...

Read more »

Example 7.17: The Smith College diploma problem

November 12, 2009
By
Example 7.17: The Smith College diploma problem

Smith College is a residential women's liberal arts college in Northampton, MA that is steeped in tradition. One such tradition is to give each student at graduation a diploma at random (or more accurately, in a haphazard fashion). At the end of the ceremony, a diploma circle is formed, and students pass the diplomas that they receive to...

Read more »