Fits two-straight-line (broken-stick) models to data (A.W.A. Murray & J.T. Wood).
|What to print (
||What to plot (
||Forces either the left- the or right-hand line to be horizontal (
||Sets the probability level of the confidence interval about the
||Specifies the maximum number of grid lines; default 30|
||Additional x-variates to include in the model; default none|
||Response variates to be modelled|
||Explanatory variable for each response variate|
||Title to use on the graphs for each response variate|
||Saves fitted values|
||Saves standardized residuals|
||Saves estimates from each model (i.e. intersection coordinates and slopes of the fitted lines)|
||Saves standard errors of the estimates|
||Saves the intercepts|
||Saves the lower bound of the confidence interval about the x-value at the intersection|
||Saves the upper bound of the confidence interval about the x-value at the intersection|
||Saves the partial likelihood and grid values for partial likelihood plots|
R2LINES fits a model consisting of two straight line segments (a broken-stick or split-line model) to the data. The
HORIZONTAL option can be set to
right to force either the left- or the right-hand line to be horizontal. A check is made to ensure that the overall best intersection point is used for the two lines. The
NGRIDPOINTS option controls the number of grid points used in the initial search for the best point; default 30.
The response variate is specified by the
Y parameter, and the explanatory variate by the
X parameter. You can also use the
TERMS option to include additional x-variates in the model.
Information can be saved from the analysis by using the
SE parameters, in the usual way. The
UPPER parameters can save the lower and upper values of a confidence interval for the x location of the intersection (or breakpoint) of the lines. The
INTERCEPTS parameter can save a variate containing the intercept with the y-axis and of the two lines with the x-axis. The probability for the interval is specified by the
CIPROBABILITY option, with default 0.95 (i.e. 95%).
Printed output is controlled by the
fittedvalues operate as in ordinary regression. The
estimates setting produces the parameter estimates as usual, and also the confidence interval for the x-value of the intersection of the lines. There is also a setting
intercepts, which prints the values at which the model intercepts the x-axis and y-axis.
PLOT option has settings to produce the following plots:
||displays a partial likelihood plot, displaying the approximate F ratio for the model for a range of positions of the breakpoint between the two lines;|
||plots the fitted lines;|
||produces the four standard model-checking plots of residuals – histograms, Normal and half-Normal plots, and plots of residuals against fitted values.|
TITLE parameter can supply a title for the plots; the default is to use the identifier of the
Y variate. The
PARTIALLIKELIHOOD parameter can save the points used for the breakpoint plot, as a pointer storing a variate with the y-coordinates as its first element, and a variate with the x-coordinates as its second element.
A model consisting of two straight line segments is fitted by least squares. This is done by defining variables,
Slope_1 = (X - Breakpoint_X) * (X < Breakpoint_X)
Slope_2 = (X - Breakpoint_X) * (X > Breakpoint_X)
X is the explanatory variable, and
Breakpoint_X is the value of the explanatory variable where the two segments join. The response variable is then regressed on
Slope_2. The slopes of the lines are the regression coefficients for
Breakpoint_X is known, there is no problem. However, if it is not known, care is needed because the residual mean square may have local minima. If one of the straight lines is assumed to be horizontal, then only one slope is fitted and the other is set to zero.
The values of
X are sorted into increasing order, and a sequence of trial values for
Breakpoint_X is formed, consisting of the original values
NGRIDPOINTS-1 equally spaced values between each consecutive pair of
X‘s. The regression of
Slope_2 is fitted for each of these trial values. The one giving the smallest residual sum of squares is then chosen as a starting value for
Breakpoint_X, and the model is fitted as a nonlinear model using
Suppose that at the true value of
Breakpoint_X the residual sum of squares is
Rt, and that at the fitted value of
Breakpoint_X the residual sum of squares is
Rf and the residual mean square is
Sf. If we assume that the observations are independently and normally distributed with common variance, the distribution of (
Sf can be approximated by an F-distribution with degrees of freedom one and number of observations minus four. Hence the set of values for
Breakpoint_X for which (
Sf is less than the 95th percentile of the F-distribution defines a 95% confidence region. It is possible for this region to consist of more than one distinct interval. The confidence interval will contain the minimum and maximum values of
Breakpoint_X in the region. The calculated variance ratios and the trial values of
Breakpoint_X are returned in
Y are obeyed.
Commands for: Regression analysis.
CAPTION 'R2LINES example'; STYLE=meta VARIATE X,Y; VALUES=\ !(-3.12,-1.74,4.36,7.27,7.90,9.05,11.01,18.51,18.96,\ 24.38,27.42,33.58,38.61,42.79,44.86,48.21,61.60,75.25),\ !(0.14,0.69,0.43,1.00,0.81,0.70,0.19,1.06,0.57,\ 3.16,1.75,12.54,1.81,5.46,7.86,10.39,22.43,39.35) R2LINES [PRINT=model,summary,estimates,fittedvalues,intercepts;\ PLOT=breakpoint,lines,residuals] Y; X & [HORIZONTAL=left] Y; X