SSMethod.Cond.TA1.8: Apply Francis composition weighting method TA1.8 for...

Description Usage Arguments Details Author(s) References See Also

View source: R/SSMethod.Cond.TA1.8.R


Uses an extension of method TA1.8 (described in Appendix A of Francis, 2011) to do stage-2 weighting of conditional age at length composition data from a Stock Synthesis model.


SSMethod.Cond.TA1.8(fit, fleet, part = 0:2, seas = NULL,
  plotit = TRUE, printit = TRUE, datonly = FALSE,
  plotadj = !datonly, maxpanel = 1000, FullDiagOut = FALSE,
  ShowVersionB = FALSE, fleetnames = NULL)



Stock Synthesis output as read by r4SS function SS_output


vector of one or more fleet numbers whose data are to be analysed simultaneously (the output N multiplier applies to all fleets combined)


vector of one or more partition values; analysis is restricted to composition data with one of these partition values. Default is to include all partition values (0, 1, 2).


string indicating how to treat data from multiple seasons 'comb' - combine seasonal data for each year and plot against Yr 'sep' - treat seasons separately, plotting against Yr.S If is.null(seas) it is assumed that there is only one season in the selected data (a warning is output if this is not true) and option 'comb' is used.


if TRUE, make an illustrative plot like one or more panels of Fig. 4 in Francis (2011).


if TRUE, print results to R console.


if TRUE, don't show the model expectations


if TRUE, plot the confidence intervals associated with the adjusted sample sizes (TRUE by default unless datonly = TRUE)


maximum number of panels within a plot


Print full diagnostics?


Report the Version B value in addition to the default?


Vector of alternative fleet names to draw from for plot titles and captions. It should have length equal to the number of fleets in the model, not the number of fleets considered in this function.


The function outputs a multiplier, w, (with bootstrap 95% confidence intervals) so that N2i = w x N1i, where N1i and N2i are the stage-1 and stage-2 multinomial sample sizes for the ith composition. Optionally makes a plot of observed and expected mean ages, with two alternative sets of confidence limits - based on N1i (thin lines) and N2i (thick lines) - for the observed values.

This function formerly reported two versions of w differ according to whether the calculated mean ages are indexed by year (version A) or by year and length bin (version B). However, research by Punt (2015) found Version A to perform better and version B is no longer recommended and is only reported if requested by the user.

CAUTIONARY/EXPLANATORY NOTE. The large number of options available in SS makes it very difficult to be sure that what this function does is appropriate for all combinations of options. The following notes (for version A) might help anyone wanting to check or correct the code.

  1. The code first removes un-needed rows from database condbase.

  2. The remaining rows of the database are grouped (indexed by vector indx) and relevant statistics (e.g., observed and expected mean age), and ancillary data, are calculated for each group (these are stored in pldat - one row per group).

  3. If the data are to be plotted they are further grouped by fleet, with one panel of the plot per fleet.

  4. A single multiplier, w, is calculated to apply to all the selected data.


Chris Francis, Andre Punt, Ian Taylor


Francis, R.I.C.C. (2011). Data weighting in statistical fisheries stock assessment models. Can. J. Fish. Aquat. Sci. 68: 1124-1138.

Punt, A.E. (2015). Some insights into data weighting in integrated stock assessments. Fish. Res.

See Also


r4ss documentation built on Oct. 30, 2019, 11:25 a.m.