bias.plot: Bias Plot

View source: R/precision_functions.R

bias.plotR Documentation

Bias Plot

Description

bias.plot creates a bias plot (see Campana 2001) that helps the researcher assess whether bias is present between two sets of age reads on the same individual fish. The plot is constructed using lattice graphics.

Usage

bias.plot(
  Data,
  R1.label = "Reader 1",
  R2.label = "Reader 2",
  a = 0,
  b = 1,
  pch = 16,
  col.points = "black",
  lty.ab = 2,
  lty.col = "black",
  err.col = "black"
)

Arguments

Data

Numeric data frame having columns titled the following

Age

numeric vector representing the unique ages assigned to indvidual fish by Reader 1

Avg

numeric vector representing the average age given by Reader 2 for fish aged "x' by Reader 1

CI

numeric vector representing the confidence interval of ages given by Reader 2 for fish aged "x" by Reader 1

Other columns may be present in the data frame.

R1.label

Text label for the x-axis (defaults to Reader 1) for the resultant plot

R2.label

Text label for the y-axis (defaults to Reader 2) for the resultant plot

a

numeric; y-axis intercept for comparison line

b

numeric; slope estimate for comparison line

pch

see pch; symbol for points used in plot

col.points

A specification for the plotting color of the points. See description of Color Specificaiton in the par for more information.

lty.ab

specify line type for the "ab" line. See description of lty in the par for more information

lty.col

specify the line color for the "ab" line. See description of Color Specificaiton in the par for more information.

err.col

specify the line color for the error bars. See description of Color Specificaiton in the par for more information.

Value

A xyplot using the package lattice depicting the bias plot between Reader 2 and Reader 1 ages.

See Also

Other Bias Plot Functions: dist.plot()

Examples

# Example with RedPorgy data
data(RedPorgy)
df <- with(RedPorgy, aggregate(R4.Age ~ R1.Age, FUN = describe, digits = 4 ))
df <- cbind(df[-ncol(df)], df[[ncol(df)]])
colnames(df) <- c("Age" ,"n", "Avg", "StDev", "StErr", "CI", "CV","RSE",
   "RMSD", "MAE")
bias.plot(Data = df)

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