The DO Loop
Statistical programming in SAS with an emphasis on SAS/IML programs![Balanced bootstrap resampling in SAS](https://blogs.sas.com/content/iml/files/2018/07/balancedBoot1-640x336.png)
This article shows how to implement balanced bootstrap sampling in SAS. The basic bootstrap samples with replacement from the original data (N observations) to obtain B new samples. This is called "uniform" resampling because each observation has a uniform probability of 1/N of being selected at each step of the
![Offset regions: Find all points within a specified distance from a polygon](https://blogs.sas.com/content/iml/files/2018/07/offsetregion2-702x336.png)
My colleague Robert Allison recently blogged about using the diameter of Texas as a unit of measurement. The largest distance across Texas is about 801 miles, so Robert wanted to find the set of all points such that the distance from the point to Texas is less than or equal
![The probability that two random chords of a circle intersect](https://blogs.sas.com/content/iml/files/2018/07/IntersectCircle1.png)
In a previous article, I showed how to find the intersection (if it exists) between two line segments in the plane. There are some fun problems in probability theory that involve intersections of line segments. One is "What is the probability that two randomly chosen chords of a circle intersect?"
![The intersection of two line segments](https://blogs.sas.com/content/iml/files/2018/07/IntersectSegments1.png)
Back in high school, you probably learned to find the intersection of two lines in the plane. The intersection requires solving a system of two linear equations. There are three cases: (1) the lines intersect in a unique point, (2) the lines are parallel and do not intersect, or (3)
![Compute derivatives for nonparametric regression models](https://blogs.sas.com/content/iml/files/2018/07/NonparmDeriv1-640x336.png)
SAS enables you to evaluate a regression model at any location within the range of the data. However, sometimes you might be interested in how the predicted response is increasing or decreasing at specified locations. You can use finite differences to compute the slope (first derivative) of a regression model.
![Ranking US presidents](https://blogs.sas.com/content/iml/files/2018/06/PresGreat1-640x336.png)
Which president of the United States is ranked the greatest by presidential historians? This article visualizes the results of the 2018 Presidential Greatness Survey, which was created and administered by B. Rottinghaus and J. Vaughn. They analyzed 166 responses from experts in political science who ranked the 44 US presidents