50% off | Unlimited Data & AI Learning
Get 50% off unlimited learning

rgr (version 1.1.0)

gx.rma: Estimate the Coefficients of the Reduced Major Axis

Description

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).

Usage

gx.rma(xx1, xx2, x1lab = deparse(substitute(xx1)),
	x2lab = deparse(substitute(xx2)), log = FALSE)

Arguments

xx1
the name of the first independent variable.
xx2
the name of the second independent variable.
log
if a logarithmic transformation of the data is required to meet homogeneity of variance considerations (i.e. severe heteroscedasticity) set log = TRUE. This is also advisable if the range of the observations exceeds 1.5 orders of magnitude.
x1lab
a title for the first independent variable, the default is the variable name, deparse(substitute(xx1)). It is often desirable to replace the default title of the input variable name text string with a more informative title, e.g., x1l
x2lab
a title for the second independent variable, the default is the variable name, deparse(substitute(xx2)). It is often desirable to replace the default title of the input variable name text string with a more informative title, e.g., x2la

Value

  • A list comprising of:
  • alenthe data set size.
  • meana two-element vector with the means of x1 and x2.
  • sda two-element vector with the standard deviations of x1 and x2.
  • corrthe Pearson correlation coefficient for x1 and x2.
  • a0the intercept of the reduced major axis.
  • a1the slope of the reduced major axis.
  • sea0the standard error of the intercept estimate.
  • aea1the standard error of the slope estimate.

References

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.

See Also

ltdl.fix.df, remove.na

Examples

Run this code
## Make test available
data(ms.data1)
attach(ms.data1)

## Estimate RMA coefficients for duplicate measurements on rock samples
gx.rma(MS.1, MS.2, log = TRUE, 
	x1lab = "MS - 1", x2lab = "MS - 2")

## Display an x-y plot of the data and the RMA, ensuring a 
## square plot with similar x- and y-axis labelling and
## appropriate axis labelling 
save.rma <- gx.rma(MS.1, MS.2, log = TRUE,
	x1lab = "MS - 1", x2lab = "MS - 2")
oldpar <- par()
par(pty = "s", pch = 3)
plot(MS.1, MS.2, log = "xy", xlim = c(min(MS.1, MS.2), max(MS.1, MS.2)),
	ylim  = c(min(MS.1, MS.2), max(MS.1, MS.2)),
	xlab = "Magnetic Susceptibility - Measurement 1",
	ylab = "Magnetic Susceptibility - Measurement 2")
abline(save.rma$a0, save.rma$a1, lty = 3)
par <- oldpar	

## Clean-up and detach test data
rm(save.rma)
detach(ms.data1)

Run the code above in your browser using DataLab