york_plot: Regression confidence intervals

View source: R/york.R

york_plotR Documentation

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

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.

Details

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

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

Contributors

Julian Tödter

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. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.gca.2014.06.004")}

Examples

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


isogeochem documentation built on March 31, 2023, 8:30 p.m.