Granato, G.E., 2006, Kendall-Theil Robust Line (KTRLine--version 1.0)—A visual basic program for calculating and graphing robust nonparametric estimates of linear-regression coefficients between two continuous variables: Techniques and Methods of the U.S. Geological Survey, book 4, chap. A7, 31 p. Report On-Line Compiled Software On-Line
The Kendall-Theil Robust Line software (KTRLine—version 1.0) is a Visual Basic program that may be used with the Microsoft Windows operating system to calculate parameters for robust, nonparametric estimates of linear-regression coefficients between two continuous variables. The KTRLine software was developed by the U.S. Geological Survey, in cooperation with the Federal Highway Administration, for use in stochastic data modeling with local, regional, and national hydrologic data sets to develop planning-level estimates of potential effects of highway runoff on the quality of receiving waters. The Kendall-Theil robust line was selected because this robust nonparametric method is resistant to the effects of outliers and nonnormality in residuals that commonly characterize hydrologic data sets. The slope of the line is calculated as the median of all possible pairwise slopes between points. The intercept is calculated so that the line will run through the median of input data. A single-line model or a multisegment model may be specified.
The program was developed to provide regression equations with an error component for stochastic data generation because nonparametric multisegment regression tools are not available with the software that is commonly used to develop regression models. The Kendall-Theil robust line is a median line and, therefore, may underestimate total mass, volume, or loads unless the error component or a bias correction factor is incorporated into the estimate. Regression statistics such as the median error, the median absolute deviation, the prediction error sum of squares, the root mean square error, the confidence interval for the slope, and the bias correction factor for median estimates are calculated by use of nonparametric methods. These statistics, however, may be used to formulate estimates of mass, volume, or total loads.
The program is used to read a two- or three-column tab-delimited input file with variable names in the first row and data in subsequent rows. The user may choose the columns that contain the independent (X) and dependent (Y) variable. A third column, if present, may contain metadata such as the sample-collection location and date. The program screens the input files and plots the data. The KTRLine software is a graphical tool that facilitates development of regression models by use of graphs of the regression line with data, the regression residuals (with X or Y), and percentile plots of the cumulative frequency of the X variable, Y variable, and the regression residuals. The user may individually transform the independent and dependent variables to reduce heteroscedasticity and to linearize data. The program plots the data and the regression line. The program also prints model specifications and regression statistics to the screen. The user may save and print the regression results. The program can accept data sets that contain up to about 15,000 XY data points, but because the program must sort the array of all pairwise slopes, the program may be perceptibly slow with data sets that contain more than about 1,000 points.
KTRLine version 1.0 - Initial release. October 1, 2006
The KTRLine program is written in Visual Basic 6.0 and therefore use is limited to Microsoft Windows operating systems. The graphical display forms require a screen resolution exceeding 1024 x 768 pixels.
The KTRLine program uses a two- or three-column tab-delimited text file with an independent (X) variable, dependent (Y) variable, and a meta-data column. The user may specify the X and Y columns when the file is loaded. The X and Y data can have a heading line, but all the other values must be numbers. The metadata column can be in any format; these data will be displayed on the graph when the user right-clicks on a data point.
The program creates an output file with the regression statistics. The user also can print the graphing and model-specification form.
Support for this software includes on-line training modules, limited software support, and compilation of suggested improvements. Only limited assistance can be provided for applying KTRLine to specific problems, but the on-line training modules should be sufficient for most users.
The on-line training modules are in the executable Captivate-Multimedia file format in two screen resolutions. The medium resolution version is for screens greater than 800X600 pixels and the high resolution version is for screens greater than 1024 by 768 pixels. You must have the Adobe Flash player to use these files. The training modules explain the theory and application of the software.
Limited support is provided for correcting bugs and clarification of how the code is intended to work. For a current list of known bugs and suggestions for improvement click here. For support or to provide feedback or suggestions for improvement, contact:
Gregory E. Granato
U.S. Geological Survey
10 Bearfoot Road
Northborough, MA 01532
This software and related material (data and documentation) are made available by the USGS to be used in the public interest and the advancement of science. You may, without any fee or cost, use, copy, modify, or distribute this software, and any derivative works thereof, and its supporting documentation, subject to the USGS Software User Rights Notice.