Implements the unified regression algorithm of York et al. (2004) which, although based on least squares, yields results that are consistent with maximum likelihood estimates of Titterington and Halliday (1979).
york(x, alpha = 0.05)
a 4 or 5-column matrix with the X-values, the analytical uncertainties of the X-values, the Y-values, the analytical uncertainties of the Y-values, and (optionally) the correlation coefficients of the X- and Y-values.
cutoff value for confidence intervals
Given n pairs of (approximately) collinear measurements X_i
and Y_i (for 1 ≤q i ≤q n), their uncertainties
s[X_i] and s[Y_i], and their covariances
york function finds the best fitting
straight line using the least-squares algorithm of York et
al. (2004). This algorithm is modified from an earlier method
developed by York (1968) to be consistent with the maximum
likelihood approach of Titterington and Halliday (1979). It
computes the MSWD as a measure of under/overdispersion.
Overdispersed datasets (MSWD>1) can be dealt with in the same three
ways that are described in the documentation of the
A seven-element list of vectors containing:
the intercept of the straight line fit and its standard error
the slope of the fit and its standard error
the covariance of the slope and intercept
the mean square of the residuals (a.k.a ‘reduced Chi-square’) statistic
degrees of freedom of the linear fit (n-2)
p-value of a Chi-square value with
degrees of freedom
the value of the eponymous input argument
Titterington, D.M. and Halliday, A.N., 1979. On the fitting of parallel isochrons and the method of maximum likelihood. Chemical Geology, 26(3), pp.183-195.
York, Derek, et al., 2004. Unified equations for the slope, intercept, and standard errors of the best straight line. American Journal of Physics 72.3, pp.367-375.
1 2 3 4 5 6 7 8 9 10 11
X <- c(1.550,12.395,20.445,20.435,20.610,24.900, 28.530,50.540,51.595,86.51,106.40,157.35) Y <- c(.7268,.7849,.8200,.8156,.8160,.8322, .8642,.9584,.9617,1.135,1.230,1.490) n <- length(X) sX <- X*0.01 sY <- Y*0.005 rXY <- rep(0.8,n) dat <- cbind(X,sX,Y,sY,rXY) fit <- york(dat) scatterplot(dat,fit=fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.