Click here to see the SAS code.
Click here to see the example.

---------------------------------------------------------------

See my blog for more information about this graph!


The following web page does a good job of explaining how to come up
with the equations for Odds & Probabilities of winning the lottery:

http://www.durangobill.com/PowerballOdds.html



Below are the equations I use in the SAS language:

Note that I use the comb() function to calculate the number of combinations.
And, of course I use variables in the data set, rather than hard-coding 
the numbers.

 Jackpot_prob='1 in '||trim(left(put( (comb(59,5)*35) ,comma20.0)));

 Jackpot_odds='1:'||trim(left(put( (comb(59,5)*35)-1 ,comma20.0)));


Note that Wikipedia's table of values (as of Feb 4, 2013) 
showed the odds for all the rows (dates) except the last one,
and then they switched to showing the probability (although 
the column is labeled 'odds').

http://en.wikipedia.org/wiki/Powerball#Basic_game



I imagine that the table in the Wikipedia page is maintained by hand.
If it were created programmatically using SAS, then the calculated
values would be guaranteed calculated consistently in each row.


Back to Samples Index