addNage {DATRAS} | R Documentation |
Add numbers-at-age to a DATRASraw object. Numbers are estimated using a continuation-ratio logit model. This is just a short-cut for calling 'fitALK' to fit the model followed by 'predict.ALKmodel' and adding numbers-at-age per haul to the DATRASraw object in a variable called 'Nage'.
addNage(x, ages, mc.cores = 1, model = c(paste("cra~LngtCm"), paste("cra~poly(LngtCm,2)"), paste("cra~LngtCm+s(lon,lat,bs='ts')"))[method], method = 1, autoChooseK = FALSE, useBIC = FALSE, varCof = FALSE, maxK = 100, gamma = 1.4, verbose = FALSE, ...)
x |
a DATRASraw object. |
ages |
Vector with consecutive ages to consider, last age is plus group. |
mc.cores |
The number of cores to use, i.e. how many processes will be spawned (at most) |
model |
Model formula(string) for ALK, or a vector of strings specifying the formula for each logit (i.e. number of age groups minus one). |
method |
Use default formula: 1=Normal distributed age-at-length (1st order), 2=Second order polynomial, 3=Spatial ALK, first order length-effect. |
autoChooseK |
Automatic choice of the max. dimension for the basis used to represent the smooth term for spatial ALK. See ?s in the mgcv-package. |
useBIC |
Use Bayesian Information Criterion for smoothness selection instead of AIC. |
varCof |
Use varying coefficients model for spatial effect. |
maxK |
Maximum k to use. Only applies if autoChooseK is TRUE. |
gamma |
Multiplier for AIC score (see ?gam) |
verbose |
Print details about the fitting process. |
... |
Optional extra arguments to gam() |
A DATRASraw object.