Learn R Programming

IsoplotR (version 0.17)

weightedmean: Calculate the weighted mean age

Description

Models the data as a Normal distribution with two sources of variance. Estimates the mean and 'overdispersion' using the method of Maximum Likelihood. Computes the MSWD of a Normal fit without overdispersion. Implements Chauvenet's Criterion to detect and reject outliers. Only propagates the analytical uncertainty associated with decay constants and J-factors after computing the weighted mean isotopic composition.

Usage

weightedmean(x, ...)

# S3 method for default weightedmean(x, detect.outliers = TRUE, plot = TRUE, rect.col = rgb(0, 1, 0, 0.5), outlier.col = rgb(0, 1, 1, 0.5), sigdig = 2, alpha = 0.05, ...)

# S3 method for UPb weightedmean(x, detect.outliers = TRUE, plot = TRUE, rect.col = rgb(0, 1, 0, 0.5), outlier.col = rgb(0, 1, 1, 0.5), sigdig = 2, type = 4, cutoff.76 = 1100, cutoff.disc = c(-15, 5), alpha = 0.05, exterr = TRUE, common.Pb = 0, ...)

# S3 method for PbPb weightedmean(x, detect.outliers = TRUE, plot = TRUE, rect.col = rgb(0, 1, 0, 0.5), outlier.col = rgb(0, 1, 1, 0.5), sigdig = 2, alpha = 0.05, exterr = TRUE, i2i = FALSE, ...)

# S3 method for ThU weightedmean(x, detect.outliers = TRUE, plot = TRUE, rect.col = rgb(0, 1, 0, 0.5), outlier.col = rgb(0, 1, 1, 0.5), sigdig = 2, alpha = 0.05, i2i = TRUE, ...)

# S3 method for ArAr weightedmean(x, detect.outliers = TRUE, plot = TRUE, rect.col = rgb(0, 1, 0, 0.5), outlier.col = rgb(0, 1, 1, 0.5), sigdig = 2, alpha = 0.05, exterr = TRUE, i2i = FALSE, ...)

# S3 method for ReOs weightedmean(x, detect.outliers = TRUE, plot = TRUE, rect.col = rgb(0, 1, 0, 0.5), outlier.col = rgb(0, 1, 1, 0.5), sigdig = 2, alpha = 0.05, exterr = TRUE, i2i = TRUE, ...)

# S3 method for SmNd weightedmean(x, detect.outliers = TRUE, plot = TRUE, rect.col = rgb(0, 1, 0, 0.5), outlier.col = rgb(0, 1, 1, 0.5), sigdig = 2, alpha = 0.05, exterr = TRUE, i2i = TRUE, ...)

# S3 method for RbSr weightedmean(x, detect.outliers = TRUE, plot = TRUE, rect.col = rgb(0, 1, 0, 0.5), outlier.col = rgb(0, 1, 1, 0.5), sigdig = 2, alpha = 0.05, exterr = TRUE, i2i = TRUE, ...)

# S3 method for LuHf weightedmean(x, detect.outliers = TRUE, plot = TRUE, rect.col = rgb(0, 1, 0, 0.5), outlier.col = rgb(0, 1, 1, 0.5), sigdig = 2, alpha = 0.05, exterr = TRUE, i2i = TRUE, ...)

# S3 method for UThHe weightedmean(x, detect.outliers = TRUE, plot = TRUE, rect.col = rgb(0, 1, 0, 0.5), outlier.col = rgb(0, 1, 1, 0.5), sigdig = 2, alpha = 0.05, exterr = TRUE, ...)

# S3 method for fissiontracks weightedmean(x, detect.outliers = TRUE, plot = TRUE, rect.col = rgb(0, 1, 0, 0.5), outlier.col = rgb(0, 1, 1, 0.5), sigdig = 2, alpha = 0.05, exterr = TRUE, ...)

Arguments

x

a two column matrix of values (first column) and their standard errors (second column) OR an object of class UPb, PbPb, ArAr, ReOs, SmNd, RbSr, LuHf, ThU, fissiontracks or UThHe

...

optional arguments

detect.outliers

logical flag indicating whether outliers should be detected and rejected using Chauvenet's Criterion.

plot

logical flag indicating whether the function should produce graphical output or return numerical values to the user.

rect.col

the fill colour of the rectangles used to show the measurements or age estimates.

outlier.col

if detect.outliers=TRUE, the outliers are given a different colour.

sigdig

the number of significant digits of the numerical values reported in the title of the graphical output.

alpha

the confidence limits of the error bars/rectangles.

type

scalar indicating whether to plot the \(^{207}\)Pb/\(^{235}\)U age (type=1), the \(^{206}\)Pb/\(^{238}\)U age (type=2), the \(^{207}\)Pb/\(^{206}\)Pb age (type=3), the \(^{207}\)Pb/\(^{206}\)Pb-\(^{206}\)Pb/\(^{238}\)U age (type=4), or the (Wetherill) concordia age (type=5)

cutoff.76

the age (in Ma) below which the \(^{206}\)Pb/\(^{238}\)U age and above which the \(^{207}\)Pb/\(^{206}\)Pb age is used. This parameter is only used if type=4.

cutoff.disc

two element vector with the maximum and minimum percentage discordance allowed between the \(^{207}\)Pb/\(^{235}\)U and \(^{206}\)Pb/\(^{238}\)U age (if \(^{206}\)Pb/\(^{238}\)U < cutoff.76) or between the \(^{206}\)Pb/\(^{238}\)U and \(^{207}\)Pb/\(^{206}\)Pb age (if \(^{206}\)Pb/\(^{238}\)U > cutoff.76). Set cutoff.disc=NA if you do not want to use this filter.

exterr

propagate decay constant uncertainty?

common.Pb

apply a common lead correction using one of three methods:

1: use the isochron intercept as the initial Pb-composition

2: use the Stacey-Kramer two-stage model to infer the initial Pb-composition

3: use the Pb-composition stored in settings('iratio','Pb206Pb204') and settings('iratio','Pb207Pb204')

i2i

`isochron to intercept': calculates the initial (aka `inherited', `excess', or `common') \(^{40}\)Ar/\(^{36}\)Ar, \(^{207}\)Pb/\(^{204}\)Pb, \(^{87}\)Sr/\(^{86}\)Sr, \(^{143}\)Nd/\(^{144}\)Nd, \(^{187}\)Os/\(^{188}\)Os or \(^{176}\)Hf/\(^{177}\)Hf ratio from an isochron fit. Setting i2i to FALSE uses the default values stored in settings('iratio',...) or zero (for the Pb-Pb method). When applied to data of class ThU, setting i2i to TRUE applies a detrital Th-correction.

Value

if PLOT=FALSE, returns a list with the following items:

mean

a two element vector with the weighted mean and its standard error.

disp

a two element vector with the (over)dispersion and its standard error.

mswd

the Mean Square of the Weighted Deviates (a.k.a. `reduced Chi-square' statistic)

p.value

the p-value of a Chi-square test with n-1 degrees of freedom, testing the null hypothesis that the underlying population is not overdispersed.

valid

vector of logical flags indicating which steps are included into the weighted mean calculation

Examples

Run this code
# NOT RUN {
ages <- c(251.9,251.59,251.47,251.35,251.1,251.04,250.79,250.73,251.22,228.43)
errs <- c(0.28,0.28,0.63,0.34,0.28,0.63,0.28,0.4,0.28,0.33)
weightedmean(cbind(ages,errs))
data(examples)
weightedmean(examples$ArAr)
# }

Run the code above in your browser using DataLab