Learn R Programming

isogeochem (version 1.1.1)

york_plot: Regression confidence intervals

Description

york_plot() calculates and optionally plots the confidence intervals of an (error-considering) linear regression.

Usage

york_plot(
  x,
  slope,
  slope_se,
  intercept,
  intercept_se,
  cl = 0.95,
  weights = -1,
  add = FALSE,
  col = "black"
)

Value

A list with regression parameters:

  • slope and its standard error

  • intercept and its standard error

  • weights of the points (normalized to 1)

  • residual standard error (sigma)

  • R2

  • p-value (two-tailed t-test).

Arguments

x

x values of the data points.

slope

regression slope.

slope_se

Standard error of the slope.

intercept

regression intercept.

intercept_se

Standard error of the intercept.

cl

Confidence level. Default: 0.95.

weights

Weights of the data points. If given, mean & SD of x are computed with the weights. Has to be same the length as x. Optional.

add

Add graphics to an already existing plot? Default: FALSE.

col

Graphical parameter. Optional.

Contributors

Julian Tödter

Details

The algorithm is described in the appendix of Wacker et al. (2014).

References

Wacker, U., Fiebig, J., Tödter, J., Schöne, B. R., Bahr, A., Friedrich, O., et al. (2014). Empirical calibration of the clumped isotope paleothermometer using calcites of various origins. Geochimica et Cosmochimica Acta, 141, 127-144. tools:::Rd_expr_doi("10.1016/j.gca.2014.06.004")

Examples

Run this code
york_plot(
  x = c(1, 2, 3),
  slope = 1.06,
  slope_se = 1.60,
  intercept = -0.05,
  intercept_se = 0.34,
  cl = 0.98)

Run the code above in your browser using DataLab