Function to estimate the coefficients and their standard errors of the Reduced Major Axis, the case of orthogonal regression, and also known as total least squares or errors in variables regression. The procedure is based on the methodology described in Miller and Kahn (1962). Function will also prepare a Youden plot.

1 2 |

`xx1` |
the name of the first independent variable, or a n by 2 matrix of independent variables, for instance from |

`xx2` |
the name of the second independent variable, omit if |

`x1lab` |
a title for the first independent variable, the default is the variable name, |

`x2lab` |
a title for the second independent variable, the default is the variable name, |

`log` |
if a logarithmic transformation (base 10) of the data is required to meet homogeneity of variance considerations (i.e. severe heteroscedasticity) set |

`if.plot` |
if a x-y plot of the independent variables is required set |

`if.rma` |
if the Reduced Major Axis is to be added to the plot set |

`if.coeffs` |
if the coefficients of the Reduced Major Axis and the result of the test for the RMA being (0,1) are to be displayed on the plot, set |

`...` |
further arguments to be passed to methods concerning the plot. For example, if it is required to add a title, add |

A list comprising of:

`alen` |
the data set size. |

`mean` |
a two-element vector with the means of x1 and x2. |

`sd` |
a two-element vector with the standard deviations of x1 and x2. |

`corr` |
the Pearson correlation coefficient for x1 and x2. |

`a0` |
the intercept of the reduced major axis. |

`a1` |
the slope of the reduced major axis. |

`sea0` |
the standard error of the intercept estimate. |

`aea1` |
the standard error of the slope estimate. |

Any less than detection limit values represented by negative values, or zeros or other numeric codes representing blanks in the data, must be removed prior to executing this function, see `ltdl.fix.df`

.

Any data pairs, `xx1,xx2`

, containing any `NA`

s are omitted from the calculations.

If a log transformation is undertaken and any less than or equal to zero values occur in the data the function will halt with a warning to that effect.

The coefficients may be used to plot the RMA on a x-y plot of the two measures, see example below.

Robert G. Garrett

Miller, R.L. and Kahn, J.S., 1962. Statistical Analysis in the Geological Sciences, John Wiley & Sons, New York, U.S.A., 483 p. Specifically pp. 204-209.

`ltdl.fix.df`

, `remove.na`

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ```
## Make test available
data(ms.data1)
attach(ms.data1)
## Estimate RMA coefficients for duplicate measurements on rock samples
gx.rma(MS.1, MS.2, x1lab = "MS - 1", x2lab = "MS - 2", log = TRUE)
## Display an x-y plot of the data and the RMA
gx.rma(MS.1, MS.2, x1lab = "MS - 1", x2lab = "MS - 2", log = TRUE,
if.plot = TRUE, if.rma = TRUE)
## Detach test data
detach(ms.data1)
## Using function alts2dups
data(ms.data3)
attach(ms.data3)
gx.rma(alts2dups(MS, ifalt = TRUE), log = TRUE, if.plot = TRUE,
if.rma = TRUE)
## Detach test data
detach(ms.data3)
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

All documentation is copyright its authors; we didn't write any of that.