Fits a linear functional relationship model (M.S. Dhanoa & D.B. Baird).

### Options

`PRINT` = string token |
Controls printed output (`summary` , `estimates` , `fittedvalues` , `confidencelimits` , `grouptests` ); default `summ` , `esti` , `conf` , `grou` |
---|---|

`METHOD` = string tokens |
Specifies what methods to use to fit the regression (`bartlett` , `majoraxis` , `errorsinvariables` , `yonx` , `xony` , `reducedmajoraxis` , `standardmajoraxis` , `rangedmajoraxis` , `geometricmean` , `bisector` , `medyonx` , `medxony` , `qgeometricmean` , `qbisector` ); default `bart` |

`PLOT` = string tokens |
Controls what to plot (`fitted` , `residuals` , `bootestimates` , `confidencelimits` ); default `fitt` |

`TITLE` = text |
The title for the analysis; default title uses the `Y` and `X` identifiers |

`NBOOT` = scalar |
The number of samples to take for the bootstrap confidence limits; default 200 |

`SEED` = scalar |
Seed for bootstrap randomization; default 0 |

`CIPROBABILITY` = scalar |
Defines the size of the confidence interval; default 0.95 i.e. 95% |

`CIMETHOD` = string token |
Method for confidence limits (`parametric` , `bootstrap` ); default `boot` |

`GMETHOD` = string token |
Method for comparing slopes, elevations and locations between groups (`majoraxis` , `standardmajoraxis` ); default uses `standardmajoraxis` for `METHOD` settings `standardmajoraxis` , `reducedmajoraxis` , `rangedmajoraxis` , `geometricmean` or `bisector` , and `majoraxis` otherwise |

`VRATIO` = scalar |
Ratio between variance of `Y` and `X` variables for `METHOD=errorsinvariables` ; default 1 |

`YRANGEMETHOD` = string token |
Type of range used for `Y` when `METHOD=rangedmajoraxis` (`relative` , `interval` ); default `rela` |

`XRANGEMETHOD` = string token |
Type of range used for `X` when `METHOD=rangedmajoraxis` (`relative` , `interval` ); default `rela` |

`WINDOW` = scalar |
Graphics window to use for fitted-value plots; default 1 |

`KEYWINDOW` = scalar |
Graphics window to use for key; default 2 |

### Parameters

`Y` = variates |
Y-variate for each model |
---|---|

`X` = variates |
X-variate for each model |

`SLOPE` = scalars, variates or matrices |
Saves the estimated slopes |

`INTERCEPT` = scalars, variates or matrices |
Saves the estimated intercepts |

`GROUPS` = factors |
Defines groups of units |

`RESIDUALS` = variates, matrices or pointers |
Saves the residuals from the fitted models |

`FITTEDVALUES` = variates, matrices or pointers |
Saves the fitted values |

`ESTIMATES` = variates, matrices or pointers |
Saves the estimates |

`SE` = variates, matrices or pointers |
Saves the standard errors of the estimates |

`LOWER` = variates, matrices or pointers |
Saves lower values of confidence intervals for the estimates |

`UPPER` = variates, matrices or pointers |
Saves upper values of confidence intervals for the estimates |

`LOWFITTEDVALUES` = variates, matrices or pointers |
Saves the lower confidence limits from a bootstrap analysis of fitted values |

`UPPFITTEDVALUES` = variates, matrices or pointers |
Saves the upper confidence limits from a bootstrap analysis of fitted values |

`TESTPROBABILITIES` = pointers |
Saves the between-group test probabilities (in a symmetric matrix) for differences in slopes, elevations and locations |

### Description

`RLFUNCTIONAL`

can be used to estimate the slope and intercept of a linear equation describing the relationship between two variables, when the observations on both variables are subject to error variation. This contrasts with the situation in ordinary linear regression, where we assume that only the y-variate is subject to error (the x-variate is assumed to be observed exactly). If the variation in the x-values is not accounted for, the estimate of the slope will be biased towards zero. For further details see Sokal & Rohlf (1995, Section 14.13) and Bartlett (1949). `RLFUNCTIONAL`

can also fit standard linear regression models and quantile regression models so that these can be compared with the functional relationship models.

The y- and x-variates must be specified by the `Y`

and `X`

parameters respectively. The estimation methods to use are specified by the `METHOD`

option, using the following settings.

`bartlett` |
uses Bartlett’s three-group method (default). |
---|---|

`majoraxis` |
takes the major axis from a principal component analysis (this assumes that `X` and `Y` are equally variable). |

`errorsinvariables` |
This fits a model that assumes the errors in `Y` and `X` are in proportion to the value specified by the `VRATIO` option. When `VRATIO` is one, this gives the same estimates as `majoraxis` (but not the same parametric confidence limits). |

`yonx` |
uses ordinary least squares with the dependent variable Y and independent variable `X` . |

`xony` |
uses ordinary least squares but with the dependent variable `X` and independent variable `Y` . |

`reducedmajoraxis` |
estimates the slope as the geometric mean of the regression coefficients from regressions of `Y` on `X` and `X` on `Y` . |

`standardmajoraxis` |
takes the geometric mean of the ordinary regression slopes (`Y` on `X` and `X` on `Y` ). This is the same as reduced major axis regression, except that a different parametric estimator is used for the confidence limits. |

`rangedmajoraxis` |
This scales the `Y` and `X` variables before fitting a major axis regression. The scalings are controlled by the `YRANGEMETHOD` and `XRANGEMETHOD` options, respectively. The `relative` setting scales the variable by its maximum, while the `interval` setting uses its range. With the `relative` setting, the values of the variable should all be positive. |

`geometricmean` |
takes the geometric mean of the ordinary regression slopes (`Y` on `X` and `X` on `Y` ). This is the same the reduced major axis regression, except that a different parametric estimator is used for the confidence limits. |

`bisector` |
estimates the slope as the bisector of the ordinary regression slopes (`Y` on `X` and `X` on `Y` ). |

`medyonx` |
fits the median (50% quantile) regression of `Y` on `X` . |

`medxony` |
fits the median (50% quantile) regression of `X` on `Y` . |

`qgeometricmean` |
takes the geometric mean of the median regression slopes (`Y` on `X` and `X` on `Y` ). |

`qbisector` |
estimates the slope as the bisector of the median regression slopes (`Y` on `X` and `X` on `Y` ). |

The `GROUPS`

parameter allows a factor to be specified to define groupings of the data units, so that separate relationships can be investigated for each group. The probabilities of

differences in slopes, elevations (assuming a common slope) and locations (assuming a common slope and intercept for each group) between groups can be printed, or saved in a pointer using the `TESTPROBABILITIES`

parameter. The pointer has three elements (labelled `'slopes'`

, `'elevations'`

and `'locations'`

) which save symmetric matrices. The element on the diagonal of each symmetric matrix contains the overall probability that all groups have the same estimates, and the lower triangle contains the pairwise probabilities that two groups have the same estimates. The `GMETHOD`

option allows you to specify whether the `majoraxis`

or `standardmajoraxis`

method is used to calculate these tests; the default is to use `standardmajoraxis`

for `METHOD`

settings `standardmajoraxis`

, `reducedmajoraxis`

, `rangedmajoraxis`

, `geometricmean`

or `bisector`

, and `majoraxis`

for the other `METHOD`

settings. For details of the tests see Wharton *et al.* (2006).

The `PRINT`

option controls printed output, with settings:

`summary` |
summary of the analyses, |
---|---|

`estimates` |
estimated slopes and intercepts with standard errors, |

`fittedvalues` |
fitted values and residuals, |

`confidencelimits` |
includes confidence intervals with the estimates, |

`grouptests` |
tests of slopes, elevations and locations between groups. |

The default is `PRINT=summ,esti,conf,grou`

.

The `PLOT`

option controls what graphs are printed, with settings:

`fitted` |
creates a graph showing the observed data and the lines fitted by the various methods (all on a single graph), |
---|---|

`residuals` |
uses the `DRESIDUALS` procedure to display diagnostic plots of the residuals from each method, |

`bootestimates` |
creates a histogram with a kernel-density smooth of the estimates from the bootstrap analysis for each method, and |

`confidencelimits` |
plot the fitted model for each method, with lower and upper confidence limits. |

The `TITLE`

option can supply a title for these plots. When there are no groups, the `WINDOW`

option specifies the window to use for the `fitted`

plot and `each confidence`

plot, and the `KEYWINDOW`

specifies the window to use for their keys. If there are groups, these graphs are plotted in a trellis arrangement to show all results from every group simultaneously.

The slope and intercept can be saved individually using the `SLOPE`

and `INTERCEPT`

parameters, or together using the `ESTIMATES`

parameter. Their standard errors can be saved using the `SE`

parameter. Residuals and fitted values can be saved using the `FITTEDVALUES`

and `RESIDUALS`

parameters. Lower and upper values from a confidence interval for the estimates can be saved using the `LOWER`

and `UPPER`

parameters. The probability for the confidence interval is specified by the `CIPROBABILITY`

option (default 0.95 i.e. 95%). The type of confidence interval (`parametric`

or `bootstrap`

) is controlled by the `CIMETHOD`

option. The randomization seed for `CIMETHOD=bootstrap`

is specified by the `SEED`

option; the default of zero continues an existing sequence of random numbers if any have already been used in the current Genstat job, or obtains a random seed using system clock if none have been used already. The number of bootstrap samples is specified by the `NBOOT`

option (default 200). When bootstrap confidence intervals are used, the upper and lower confidence interval for the fitted values can be saved using the `LOWFITTEDVALUES`

and `UPPFITTEDVALUES`

parameters.

If there are no groups and a single method, `SLOPE`

and `INTERCEPT`

save their estimates in scalars, while `ESTIMATES`

, `SE`

, `FITTEDVALUES`

, `RESIDUALS`

, `LOWER`

and `UPPER`

save variates. Alternatively, if there are groups and a single method, `SLOPE`

and `INTERCEPT`

save their estimates in variates, while `ESTIMATES`

, `SE`

, `FITTEDVALUES`

, `RESIDUALS`

, `LOWER`

and `UPPER`

save matrices with a column for each group. If there are several methods, each of these parameters saves a pointer with elements labelled by the relevant `METHOD`

setting. The pointer elements are scalars, variates or matrices according to what is being saved and whether there are groups (as defined above).

Options: `PRINT`

, `METHOD`

, `PLOT`

, `TITLE`

, `NBOOT`

, `SEED`

, `CIPROBABILITY`

, `CIMETHOD`

, `GMETHOD`

, `VRATIO`

, `YRANGEMETHOD`

, `XRANGEMETHOD`

, `WINDOW`

, `KEYWINDOW`

.

Parameters: `Y`

, `X`

, `SLOPE`

, `INTERCEPT`

, `GROUPS`

, `RESIDUALS`

, `FITTEDVALUES`

, `ESTIMATES`

, `SE`

, `LOWER`

, `UPPER`

, `LOWFITTEDVALUES`

, `UPPFITTEDVALUES`

, `TESTPROBABILITIES`

.

### Method

`RLFUNCTIONAL`

uses the methods described in Section 14.13 of Sokal & Rohlf (1995) and Wharton *et al.* (2006). For further information, see *Dhanoa et al.* (2011).

### Action with `RESTRICT`

If either the `Y`

or `X`

variates is restricted, the model is estimated using only the units not excluded by the restriction.

### References

Bartlett, M.S. (1949). Fitting a straight line when both variables are subject to error. *Biometrics*, 5, 207-212.

Dhanoa, M.S., Sanderson, R., Lopez, S., Dijkstra, E., Kebreab, E. & France, J. (2011). Regression procedures for relationships between random variables. In: *Modelling nutrient digestion and utilization in farm animals* (ed. D. Sauvant, J. Van Milgen, P. Faverdin & N. Friggens), 31-39. Wageningen Academic Publishers, Wageningen.

Sokal, R.R. & Rohlf, F.J. (1995). *Biometry (3rd edition)*. W.H. Freeman & Company, New York.

Wharton, D.I., Wright, I.J., Falster, D.S. & Westoby, M. (2006). Bivariate line-fitting methods for allometry. *Biological Reviews*, 81, 259-291.

### See also

Directive: `PCP`

.

Commands for: Regression analysis, Multivariate and cluster analysis.

### Example

CAPTION 'RLFUNCTIONAL example',\ 'Data from Sokal & Sneath, 1995, Biometry, page 546.';\ STYLE=meta,plain VARIATE [VALUES=14,17,24,25,27,33,34,37,40,41,42] Weight & [VALUES=61,37,65,69,54,93,87,89,100,90,97] Eggs RLFUNCTIONAL [METHOD=Bartlett,majoraxis,reducedmajoraxis] Eggs; Weight