calc_stat_scores: Compute test statistics for comparing actual and estimated ages
Description
Using these functions you can compute either a Kolmogorov-Smirnov (KS)
statistic or a Chi-squared test statistic to compare estimated ages to actual
ages. See details for how each test works and what is reported.
A numeric value for each level that was used in the model to assign
ages
Arguments
data
A data.frame containing estimated ages as returned by
assign_ages
summary_fun
Function used to compute summary statistics for
calc_ks_score for each age group (default is mean)
age_col
Character string specifying the name of the age column
suppress_warnings
Logical. Should any warnings from the function
call to ks.test or chisq.test be suppressed (TRUE, the default)
return_val
Character. The name of the object to return from the given
test
...
Additional arguments to pass to summary_fun
(calc_ks_score) or chisq.test (calc_chi_score)
Details
The KS test compares length distributions for each age class from known ages
against that of estimated ages computed by the assign_ages
function. The output is a summary value of the test statistics as specified
by summary_fun.
The calc_chi_score function performs a Chi-square test (using the
chisq.test function) on the number of estimated and
actual ages for each age group.