Skip to contents

Compute approximate sampling parameters for the selection of individuals from a haul. Design parameters are inferred from data provided in ~StoxBioticData, and specify how a set of individuals recorded on the Individual table were selected for observation/measurement from a Haul (the table Haul in StoxBioticData).

Usage

ComputeIndividualSamplingParameters(
  StoxBioticData,
  DefinitionMethod = c("SRS", "Stratified", "LengthStratified"),
  Parameters = character(),
  LengthInterval = numeric(),
  StratificationColumns = character()
)

Arguments

StoxBioticData

Data to define individual sampling parameters for

DefinitionMethod

Method to infer sampling parameters, 'SRS', 'Stratified' or 'LengthStratified'. See details.

Parameters

Measurements / observations of individuals included in the design specification. Must all be columns on the Individual-table of StoxBioticData.

LengthInterval

width of length strata in cm. Specifies left closed intervals used for Length Stratified selection (DefinitionMethod 'Stratified'). A value of 5 indicates that observation are selected stratified on length groups [0 cm,5 cm>, [5 cm, 10 cm>, and so on.

StratificationColumns

names of columns in the Individual table of StoxBioticData that identify strata for Stratified selection (DefinitionMethod 'Stratified').

Value

IndividualSamplingParametersData where SampleId refers to the variable 'Haul' on the 'Haul' table in StoxBioticData, and IndividualId refers to the variable 'Individual' on the 'Individual' table of StoxBioticData.

Details

StoxBioticData represents sorting of species as a separate level in the hierarchy (SpeciesCategory) and Samples are selected stratified by the species categories. This represent sampling stratified on taxons in addition to some additional stratification criteria in the cases where more than one sample is present for a species-category in a Haul. The exact criteria for stratification is not important for the calculation of sampling parameters, but only clearly encoded criteria can be used in subsequent analysis, so sampling parameters are reported stratified only on SpeciesCategory. Any other stratification has been incorporated into selection or inclusion probabilities.

Sampling parameters are approximately inferred, assuming that all selected individuals are recorded, and based on some user-controllable assumptions about the selection process, specified by the appropriate 'DefinitionMethod'.

Individuals with a non-missing value for any of the parameters in 'Parameters' are treated as selected for observation, and their sampling probabilities are calculated in accordance with assumptions encoded in 'DefinitionMethod'. In this way selection of individuals may be specified differently for different parameters. One could for instance compute one IndividualSamplingParametersData reflecting the probability of selecting individuals for length-measurment, and another for selecting more detailed measurements, e.g. weight, age, sex, and maturity. The individual is identified as selected for measurement if ANY of the parameters in 'Parameters' has a value. This allows for approximate inference of missing observations; as long as one of the variables selected for observation is recorded, missing values in any of the other is inferred. An assumption that a certain variable is missing at random can be encoded by only specifying this variable in 'Parameters'. For instance for catch-at-age estimation, if only the variable 'IndividualAge' is specified in 'Parameters', individuals with missing ages will not be assigned sampling parameters, and implicitly be assumed to be missing at random. Subsequent analysis will then not have NA-age groups or NAs in mean age estimates.

The sample size 'n' is in all cases inferred by counting the total number of fish in the sample that meets the selection criteria (non-missing value for at least one of the 'Parameters') The total number of fish in the catch sampled, 'N' is the CatchFractionNumber in StoxBioticData. When fish selection is stratified by fish-properties (e.g. DefinitionMethod 'Stratified' or 'LengthStratified), the fraction in the stratum, 'f' is estimated by the fraction of fish in that stratum in the sample.

Inclusion probabilities are then set to n*f/N, and Normalized Horvitz-Thompson sampling weights are calculated (see IndividualSamplingParametersData).

The available DefinitionMethods specifies how Individuals are selected from a Sample, and are:

SRS

Simple Random Selection. Individuals are selected for measurment by simple random selection without replacement from each Sample.

Stratified

Stratified Selection. Individuals are selected for measurement by stratified random selection without replacement from each Sample. Strata are specified as the combination of columns provided in 'StratificationColumns'. The number of fish in each stratum is estimated by the total in sample and the proportion of measured fish in each stratum.

LengthStratified

Length stratified selection. Individuals are selected for measurement by stratified random selection without replacement from each Sample. Strata are length groups, specified by the left closed intervals starting with [0,'LengthInterval'>.