The DO Loop
Statistical programming in SAS with an emphasis on SAS/IML programs![Quantile definitions in SAS Visualization of percentile definitions in SAS](https://blogs.sas.com/content/iml/files/2017/05/pctldef4-640x336.png)
In last week's article about the Flint water crisis, I computed the 90th percentile of a small data set. Although I didn't mention it, the value that I reported is different from the the 90th percentile that is reported in Significance magazine. That is not unusual. The data only had
![Quantiles and the Flint water crisis Distribution of Lead Levels in Flint, Michigan, in 71 Water Samples](https://blogs.sas.com/content/iml/files/2017/05/FlintQuantiles-702x336.png)
The April 2017 issue of Significance magazine features a cover story by Robert Langkjaer-Bain about the Flint (Michigan) water crisis. For those who don't know, the Flint water crisis started in 2014 when the impoverished city began using the Flint River as a source of city water. The water was
![INTCK and INTNX: Two essential functions for computing intervals between dates in SAS](https://blogs.sas.com/content/iml/files/2017/05/LivingPresidents3.png)
Last week I showed a timeline of living US presidents. The number of living presidents is constant during the time interval between inaugurations and deaths of presidents. The data was taken from a Wikipedia table (shown below) that shows the number of years and days between events. This article shows
![Simulate lognormal data in SAS](https://blogs.sas.com/content/iml/files/2017/05/lognormalsim1-640x336.png)
A SAS customer asked how to simulate data from a three-parameter lognormal distribution as specified in the PROC UNIVARIATE documentation. In particular, he wanted to incorporate a threshold parameter into the simulation. Simulating lognormal data is easy if you remember an important fact: if X is lognormally distributed, then Y=log(X)
![Timeline of living US presidents](https://blogs.sas.com/content/iml/files/2017/05/LivingPresidents-702x250.png)
Quick! What is the next term in the numerical sequence 1, 2, 1, 2, 3, 4, 5, 4, 3, 4, ...? If you said '3', then you must be an American history expert, because that sequence represents the number of living US presidents beginning with Washington's inauguration on 30APR1789 and
![Perceptions of probability Perceived probabilities for word phrases](https://blogs.sas.com/content/iml/files/2017/04/boxjitter3-500x336.png)
If a financial analyst says it is "likely" that a company will be profitable next year, what probability would you ascribe to that statement? If an intelligence report claims that there is "little chance" of a terrorist attack against an embassy, should the ambassador interpret this as a one-in-a-hundred chance,