The DO Loop
Statistical programming in SAS with an emphasis on SAS/IML programs![Comedy vs. Drama: A comparative histogram of TV's top earners](https://blogs.sas.com/content/iml/files/2011/08/actorpay.png)
The Flowing Data blog posted some data about how much TV actors get paid per episode. About a dozen folks have created various visualizations of the data (see the comments in the Flowing Data blog), several of them very glitzy and fancy. One variable in the data is a categorical
![Converting matrix subscripts to indices](https://blogs.sas.com/content/iml/files/2011/08/t_sub2ind.png)
Suppose that you want to create a matrix in SAS/IML software that has a special structure, such as a tridiagonal matrix. How do you do it? Or suppose that you want to find elements of a matrix A such that A[i,j] satisfies a certain condition. How do you get the
![A parametric view of love](https://blogs.sas.com/content/iml/files/2011/08/heart.png)
If you tell my wife that she's married to a statistical geek, she'll nod knowingly. She is used to hearing sweet words of affection such as You are more beautiful than Euler's identity. or My love for you is like the exponential function: increasing, unbounded, and transcendental. But those are
![Scratch-off lottery Games: One way to design them](https://blogs.sas.com/content/iml/files/2011/08/t_scratch.png)
In a previous blog post, I described the rules for a tic-tac-toe scratch-off lottery game and showed that it is a bad idea to generate the game tickets by using a scheme that uses equal probabilities. Instead, cells that yield large cash awards must be assigned a small probability of
![Scratch-off lottery games: How NOT to design them](https://blogs.sas.com/content/iml/files/2011/08/scratchoffprob.png)
Because of this week's story about a geostatistician, Mohan Srivastava, who figured out how predict winning tickets in a scratch-off lottery, I've been thinking about scratch-off games. He discovered how to predict winners when he began to "wonder how they make these [games]." Each ticket has a set of "lucky
![Super Bowl pools and Roman numerals](https://blogs.sas.com/content/iml/files/2011/08/t_romannumbers.png)
I enjoyed the Dataists' data-driven blog on the best numbers to choose in a Super Bowl betting pool. It reminded me of my recent investigation of which initials are most common. Because the Dataists' blog featured an R function that converts Arabic numerals into Roman numerals, the blog post also