standLM: standLM Conduct a standarization on log-transformed CPUE...

View source: R/cpuefuncs.r

standLMR Documentation

standLM Conduct a standarization on log-transformed CPUE using lm

Description

standLM conducts a standarization on log-transformed CPUE data using lm. A number of predefined models are entered (use makemodels) with the raw data and a label. It produces an object of class outce, which is a list of length 9 containing a matrix of Results, a matrix of StErr, a matrix of WhichM, which describes the relative performance of each model, Optimum, which identifies the optimal model by name (the last factor included) and column in the Results matrix, the number of year Nyrs, and the Label included as inlab, the a matrix of parameters, a full copy of the optModel, and a list of Models.

Usage

standLM(inmods, indat, inlab = "", console = TRUE)

Arguments

inmods

is the list of models to be analysed along with their respective labels - can be generated using makemodels

indat

is the data.frame containing the raw data, which must contain columns with the same names as the factors being included in the models.

inlab

is an optional label that is added to text and plotted outputs, which defaults to the empty string

console

defaults to TRUE; if TRUE write each model to the screen as each model runs, which can mess up auto-documenting documents.

Value

a list containing the standardization of class 'outce'

Examples

## Not run: 
 data(abeg)
 splabel = "Abalone"
 print(tapply(ab$catch,list(ab$year,ab$block),sum,na.rm=TRUE)/1000)
 labelM <- c("year","diverID","month","block","boatID")
 ab1 <- makecategorical(labelM,ab)
 mods <- makemodels(labelM)
 out <- standLM(mods,ab1,splabel)
 round(out$Results,4)
 round(out$WhichM,4)
 plotstand(out,bars=TRUE)

## End(Not run)

haddonm/rforcpue documentation built on Oct. 12, 2024, 11:55 p.m.