Fits a length weight relationship for use in catch expansion

fit_length_weight(
  lengthWeightData,
  speciesName,
  speciesRules,
  outputDir = NULL,
  logfile = NULL,
  suppressMessages = F
)

Arguments

lengthWeightData

Data frame. length-weight pairs. Each row represents an individual fish

speciesName

Character string. Common name for species

speciesRules

List. Obtained from get_species_object

outputDir

Character string. Path to output directory (Default = NULL, no output written)

logfile

Character string. Specify the name for the log file generated describing all decisions made. (Default = NULL, no output written)

suppressMessages

Boolean. Suppress all messages

Value

List of model fit objects

commonSlope

lm object. Fit for single slope (beta)

seasonalSlope

lm object. Fit for seasonal slopes

Notes on model fitting

The Weight-Length relationship is defined as

$$W_{ij} = \alpha L_{ij}^{\beta_j} e^{z_{ij}}$$

where,

\(W_{ij}\) = Weight of fish i in season j, \(i = 1, ..., n, j = 1, ... J\)

\(L_{ij}\) = Length of fish i in season j,

\(z_{ij}\) ~ \(N(0,\sigma^2)\),

and \(\beta_j\) is effect of season j

On the more familiar log scale the model is

$$log(W_{ij}) = log(\alpha) + \beta_j log(L_{ij}) + {z_{ij}}$$

To test for a seasonal effect, we test the Null hypothesis:

$${H_0}: \beta_j = \beta$$

against the alternative,

$${H_1}: \beta_j \neq \beta$$

The test statistic is the standard F statistic

$$F = \frac{(RSS_{H_0}-RSS_{H_1})/(J-1)}{RSS_{H_1}/(n-J-1)}$$

which will have an F distribution with (J-1, n-J-1) degrees of freedom

where RSS= Residual Sum of Square s