Skip to contents

Function for residual diagnostics. Outputs a runs test table that gives runs test p-values, if the runs test passed (p-value > 0.05, residuals are random) or failed (p-value < 0.05, residuals are not random), the 3x sigma limits for indices or mean age or length and the type of input data (cpue, length comp, age comp, size comp, or conditional age-at-length).

Usage

SSrunstest(
  ss3rep,
  mixing = "less",
  quants = c("cpue", "len", "age", "con")[1],
  indexselect = NULL,
  verbose = TRUE
)

Arguments

ss3rep

Stock Synthesis output as read by r4ss::SS_output()

mixing

c("less","greater","two.sided"). Default less is checking for positive autocorrelation only

quants

optional use of c("cpue","len","age","con"), default uses "cpue".

  • "cpue" Index of abundance data

  • "len" Length composition data

  • "age" Age composition data

  • "con" Conditional age-at-length data

indexselect

Vector of fleet numbers for each model for which to compare

verbose

Report progress to R GUI?

Value

a dataframe with runs test p-value, if the test has passed or failed, 3x sigma high and low limits, and the type of data used. Rows are for each fleet. Note, runs test passed if p-value > 0.05 (residuals are random) and failed if p-value < 0.5 (residuals are not random)

Author

Henning Winker (JRC-EC) and Laurance Kell (Sea++)