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

Description Usage Arguments Value Note Author(s) References See Also Examples

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). Function will also prepare a Youden plot.

Usage

1
2
gx.rma(xx1, xx2, x1lab = NULL, x2lab = NULL, log = FALSE, ifplot = FALSE,
ifrma = FALSE, ifcoeffs = FALSE, ifform = FALSE, iftest = FALSE, ...)

Arguments

xx1

the name of the first independent variable, or a n by 2 matrix of independent variables, for instance from alts2dups.

xx2

the name of the second independent variable, omit if xx1 is a matrix.

x1lab

a title for the first independent variable, the default is the variable name,
deparse(substitute(xx1)) or the name from the first column of the n by 2 matrix. It is often desirable to replace the default title of the input variable name text string with a more informative title, e.g.,
x1lab = "Magnetic Susceptibility - Measurement 1".

x2lab

a title for the second independent variable, the default is the variable name, deparse(substitute(xx2)) or the name from the second column of the n by 2 matrix. It is often desirable to replace the default title of the input variable name text string with a more informative title, e.g.,
x2lab = "Magnetic Susceptibility - Measurement 2".

log

if a logarithmic transformation (base 10) 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.

ifplot

if a x-y plot of the independent variables is required set if.plot = TRUE. The plot is equi-scaled and the 1:1 line is added. If ifrma = TRUE ifplot will be set to TRUE.

ifrma

if the Reduced Major Axis is to be added to the plot set ifrma = TRUE.

ifcoeffs

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 ifcoeffs = TRUE. The cursor will be activated, and the upper left corner of the text block may be placed where most appropriate, then ‘left button’ the pointing device.

ifform

if the formula, equation, for the Reduced Major Axis the daya set size and fit are to be displayed on the plot, set ifform = TRUE. The cursor will be activated, and the upper left corner of the text block may be placed where most appropriate, then ‘left button’ the pointing device.

iftest

if the result of the test for the RMA being (0,1) are to be displayed on the plot below the formula, equation, set iftest = TRUE.

...

further arguments to be passed to methods concerning the plot. For example, if it is required to add a title, add main = "Youden Plot".

Value

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.

Note

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

Author(s)

Robert G. Garrett

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

 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, 
	ifplot = TRUE, ifrma = TRUE)

## Detach test data
detach(ms.data1)

## Using function alts2dups
data(ms.data3)
attach(ms.data3)
gx.rma(alts2dups(MS, ifalt = TRUE), log = TRUE, ifplot = TRUE,
	ifrma = TRUE)

## Detach test data
detach(ms.data3)

Example output

Loading required package: MASS
Loading required package: fastICA

 Reduced Major Axis for MS - 1 and MS - 2
 Data have been Log10 transformed

 Means =	 1.008 		 1.005 
 SDs =		 1.12 		 1.11 

 Corr =		 0.9987 
 N =		 16 
 Fit = 		 99.7% 
				   SE			95% CLs 
 Slope =	 0.9912 	 0.01281 	   0.9639 <-> 1.019 
 Intercept =	 0.006118 	 0.0192985 	   -0.03502 <-> 0.04725 

 Accept hypothesis that RMA is (0,1)


 Reduced Major Axis for MS - 1 and MS - 2
 Data have been Log10 transformed

 Means =	 1.008 		 1.005 
 SDs =		 1.12 		 1.11 

 Corr =		 0.9987 
 N =		 16 
 Fit = 		 99.7% 
				   SE			95% CLs 
 Slope =	 0.9912 	 0.01281 	   0.9639 <-> 1.019 
 Intercept =	 0.006118 	 0.0192985 	   -0.03502 <-> 0.04725 

 Accept hypothesis that RMA is (0,1)


 Reduced Major Axis for MS.1 and MS.2
 Data have been Log10 transformed

 Means =	 1.008 		 1.005 
 SDs =		 1.12 		 1.11 

 Corr =		 0.9987 
 N =		 16 
 Fit = 		 99.7% 
				   SE			95% CLs 
 Slope =	 0.9912 	 0.01281 	   0.9639 <-> 1.019 
 Intercept =	 0.006118 	 0.0192985 	   -0.03502 <-> 0.04725 

 Accept hypothesis that RMA is (0,1)

rgr documentation built on May 2, 2019, 6:09 a.m.

Related to gx.rma in rgr...