growth: Fitting Growth Curves to Length- or Weight-at-Age Data

Description Usage Arguments Details Value Author(s) References Examples

View source: R/growth.R

Description

Fits three growth models to length and weight-at-age data.

Usage

1
2
3
growth(intype=1,unit=1,size=NULL,age=NULL,calctype=1,wgtby=1,s2=NULL,error=1, 
      specwgt=0.0001,Sinf=NULL,K=NULL,t0=NULL,B=3,graph=TRUE,
         control=list(maxiter=10000,minFactor=1/1024,tol=1e-5))

Arguments

intype

the input format: 1= individual size data; 2 = mean size data. Default intype=1.

unit

the size unit: 1= length; 2 = weight. Default unit=1.

size

the vector of size (length or weight) data.

age

the vector of ages associated with the size vector.

calctype

if intype=1, 1 = use individual size data; 2 = calculate mean size from individual size data. Default calctype=1.

wgtby

weighting scheme: 1 = no weighting; 2 = weight means by inverse variance. Weighting of individual data points is not allowed. Default wgtby=1.

s2

if intype=2 and wgtby=2, specify vector of sample variances associated with mean size-at-age data.

error

the error structure: 1 = additive; 2 = multiplicative. Default error=1.

specwgt

if intype=1 and wgtby=2, the weight value to use for cases where var=0 or only one individual is available at a given age.

Sinf

the starting value for L-infinity or W-infinity of the growth models. Required.

K

the starting value for K of the growth models.

t0

the starting value for t0 of the growth models.

B

the length-weight equation exponent used in the von Bertalanffy growth model for weight. Default B=3.

graph

logical value specifying if fit and residual plots should be drawn. Default graph = TRUE.

control

see function nls.

Details

Three growth models (von Bertalanffy, Gompert and logistic) are fitted to length- or weight-at-age data using nonlinear least-squares (function nls). If individual data are provided, mean size data can be calculated by specifying calctype=2. When fitting mean size data, observations can be weighted by the inverse sample variance(wgtby=2), resulting in weighted nonlinear least squares. Additive or multiplicative error structures are specified via error. See page 135 in Quinn and Deriso (1999) for more information on error structures.

If unit is weight, the exponent for the von Bertalanffy growth in weight model is not estimated and must be specified (B).

Plots of model fit and residuals are generated unless graph=FALSE.

Value

List containing list elements of the equation/structure and nls output for each model. Information from nls output can be extracted using standard functions (e.g., summary()).

Author(s)

Gary A. Nelson, Massachusetts Division of Marine Fisheries [email protected]

References

Quinn, T. J. and R. B. Deriso. 1999. Quantitative fish dynamics. Oxford University Press. 542 pages.

Examples

1
2
3
data(pinfish)
growth(intype=1,unit=1,size=pinfish$sl,age=pinfish$age,
        calctype=1,wgtby=1,error=1,Sinf=200,K=0.3,t0=-1)

Example output

Loading required package: MASS
Loading required package: boot
Loading required package: bootstrap
Loading required package: lme4
Loading required package: Matrix
Loading required package: numDeriv
$vonbert
[1] "Model: Sinf*(1-exp(-K*(t-t0)))+e" "Response: Individual Length"     
[3] "Least Squares: Unweighted"       

$vout
Nonlinear regression model
  model: size ~ Sinf * (1 - exp(-(K * (age - t0))))
   data: x
    Sinf        K       t0 
211.7875   0.3781  -0.9156 
 residual sum-of-squares: 356005

Number of iterations to convergence: 4 
Achieved convergence tolerance: 9.288e-06

$gompertz
[1] "Model: Sinf*exp(-exp(-K*(age-t0)))+e"
[2] "Response: Individual Length"         
[3] "Least Squares: Unweighted"           

$gout
Nonlinear regression model
  model: size ~ Sinf * exp(-exp(-K * (age - t0)))
   data: x
    Sinf        K       t0 
201.9056   0.5496   0.1215 
 residual sum-of-squares: 357835

Number of iterations to convergence: 6 
Achieved convergence tolerance: 3.569e-06

$logistic
[1] "Model: Sinf/(1+exp(-K*(age-t0))+e" "Response: Individual Length"      
[3] "Least Squares: Unweighted"        

$lout
Nonlinear regression model
  model: size ~ Sinf/(1 + exp(-K * (age - t0)))
   data: x
    Sinf        K       t0 
195.9021   0.7281   0.6935 
 residual sum-of-squares: 359655

Number of iterations to convergence: 6 
Achieved convergence tolerance: 9.261e-06

fishmethods documentation built on Nov. 17, 2017, 7:43 a.m.