View source: R/precision_functions.R
APE | R Documentation |
APE
calculates the average percent error (APE) for multiple age
determinations on the same fish. This function use the mean of the
observed ages as the basis for APE calculation.
APE(x)
x |
Numeric vector of independent age determinations from a single fish. |
The APE of the vector of ages x
from an individual fish.
Other APE functions:
APE.Med()
# Example giving an estimate with an APE of 0.0 APE(c(1, 1, 1)) # Example using missing data APE(c(1, NA, 2)) # Another example with missing data APE(c(3, 5, 3, 4, NA, 6)) #Example showing how APE.Med can be used to calculate mean APE for many fish w <- seq(1, 10, 1) x <- seq(2, 11, 1) y <- seq(3, 12, 1) z <- seq(4, 13, 1) df <- data.table::rbindlist(apply(data.frame(w, x, y, z), 1, APE)); df mean(data.frame(df)$APE) # Example with RedPorgy data data(RedPorgy) df <- data.table::rbindlist(apply(na.exclude(RedPorgy[, c(1, 2)]), 1, APE)) df mean(data.frame(df)$APE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.