get.h.from.bias: Calculate Relationship Between "h" and Bias

View source: R/Francis_bomb_functions.R

get.h.from.biasR Documentation

Calculate Relationship Between "h" and Bias

Description

get.h.from.bias calculates the relationship between h and bias, returning a list with components hval and bias.conf.int

Usage

get.h.from.bias(
  ref,
  test,
  hdist,
  bias.step = 5,
  bias.range = NULL,
  ref.x = "x",
  ref.y = "y",
  age = "Fish.Age",
  cy = "Catch.Year",
  age.err = "SE.Age",
  s.age = "Sample.Age",
  test.x = "Sample.Year",
  test.y = "F14C"
)

Arguments

ref, test

dataframes representing reference and test data sets, respectively, as described in function calc.bias

hdist

simulated set of h values as generaed by function sim.hdist

bias.step, bias.range

the function calculates h for each value of bias in seq(bias.range[1], bias.range[2], bias.step). If bias .range == NULL, then bias.range is initially set to c(-100, 100) but then is truncated to be just wide enough to include the 95 interval for h.

ref.x, ref.y

character string giving the name of the x and y-values in the provided ref data set, respectively.

age, age.err, cy, s.age, test.x, test.y

character strings giving the names of the columns representing ages, age error estimates, capture year, sample ages, x-variable, and y-variable in the test dataframe.

Value

A list.

See Also

Other Bomb Radiocarbon Analyses: bias.plot.BR(), calc.bias(), calc.h(), closest.pt(), get.nearest(), get.ref.line(), sim.hdist()

Examples

data(snapper)
snapper.red <- snapper[snapper$C14year >= 1955 & snapper$C14year <= 1972, ]
data(bluenose)
bluenose.red <- bluenose[bluenose$C14year >= 1955 &
  bluenose$C14year <= 1972, ]
bluenose.red <- bluenose.red[bluenose.red$C14 >= -506 &
  bluenose.red$C14 <= 94.0, ]
ref <- get.ref.line(snapper.red$C14year, snapper.red$C14)
hdist <- sim.hdist(ref = snapper.red, test = bluenose.red, nsim = 5000,
   diag = 0)
get.h.from.bias(ref = ref, test = bluenose.red, hdist = hdist, bias.step = 5,
   bias.range = NULL, age = "age", cy = "catch.year", age.err = "age.err",
   s.age = "samp.age", test.x = "C14Year", test.y = "C14")

ballengerj/FishyR documentation built on June 17, 2022, 10:33 p.m.