SPF-R Online – Making Performance Function Development Easier and More Accessible

Since its release, the Highway Safety Manual (HSM) has facilitated the adoption of new approaches by safety professionals to address highway safety.

By Eric Green, Ph.D., and Paul Ross, Kentucky Transportation Center at the University of Kentucky, and Sarah Weissman, FHWA Office of Safety

SPF-R web interface. (Source: KTC)

Highway safety has traditionally been measured using number of crashes, crash rates, crash costs, or a combination of those metrics. High-crash locations are selected based on a somewhat arbitrary ranking, or by comparison of crash rates to a critical rate factor. All methods have demonstrable disadvantages, particularly in network screening. Most notable, none of these methods account for regression-to-the-mean or selection bias. When observed in crash data, these biases can produce misleading results when not corrected for. Traditional crash analysis relies on crashes normalized by exposure—typically traffic volume—to create a rate. However, the use of rates erroneously assumes a linear relationship between crashes and volume. Most Safety Performance Functions (SPFs) exhibit an exponential relationship between crashes and exposure. SPFs are models used to predict crashes based on traffic volume and other factors.

Network screening using HSM’s methodology addresses many of the disadvantages of the traditional methods. SPFs are developed to better characterize the relationship between crashes and traffic volumes as well as other variables. Empirical Bayes addresses regression-to-the-mean bias by using actual crash data and the overdispersion parameter to adjust the expected crash experience at a site. This adjusted value is a more realistic measure of a site’s safety performance. More important, it describes the magnitude of crash reduction that could potentially be achieved. In Kentucky, this is referred to as excess expected crashes. Other States use “potential for safety improvement” synonymously.

SPFs had to be developed manually in Kentucky until 2017, when the Kentucky Transportation Center (KTC) at the University of Kentucky (UK) introduced a way to do so using the free, open-source statistical software, R. Using methods outlined in the HSM, code was created in R to automate SPF development to improve regression models. The original tool, known as SPF-R, allowed States that hadn’t adopted newer methodologies—due to difficulties related to SPF development—the ability to create SPFs. SPF-R provided immediate feedback in SPF development, including goodness-of-fit measures and depictions of the model. SPF-R was added to the FHWA Safety Toolbox in 2018 and was available on UK’s website. However, it required the user to have a working knowledge of R code and an application downloaded to a computer to run. Recognizing that downloaded programs and running code may be a barrier for some, KTC updated SPF-R in 2022 to run the program entirely online. A new web interface was developed so SPFs could be developed through a user’s web browser by uploading a comma-separated values file containing certain predefined parameters. All of the R code runs online, and in place of scripting and code execution, users can now interact with a simple-to-use web interface. Users of this new tool will have fewer technical challenges getting SPF-R working, as the mechanics are all handled online. For advanced users, the R code is still available to download to modify, demonstrate the mechanics, and use for citation.

SPF-R online is still free and open source, and in this current form is more accessible than before. It may be accessed by visiting https://spfr.uky.edu.

The original SPF-R is available through the FHWA Safety Toolbox at https://safety.fhwa.dot.gov/rsdp/toolbox-content.aspx?toolid=210.

For more information, please contact Eric Green at Eric.Green@uky.edu.