emp {FSA}R Documentation

Computes the standard weight equation using the emperical-percentile method.

Description

Computes the standard weight equation using the empirical-percentile method when given populations of length-weight data.

Usage

emp(df,pops,len,wt,min,max,w=10,n.cutoff=3,cutoff.tail=TRUE,qtype=8,probs=0.75,
    method=c("lm","rq"),quadratic=TRUE)

## S3 method for class 'EMP':
coef(object, ...)

## S3 method for class 'EMP':
summary(object, ...)

## S3 method for class 'EMP':
predict(object, ...)

## S3 method for class 'EMPlm':
anova(object, ...)

## S3 method for class 'EMPlm':
plot(x,pch=16,col.pop="rich",col.Ws="black",lwd.Ws=3,lty.Ws=1,
          jitterX=TRUE,jitter.factor=3,...)

## S3 method for class 'EMPlm':
fit.plot(object,pch=16,col.pt="black",col.Ws="red",lwd.Ws=3,lty.Ws=1,
          xlab="log10(midpt Length)",ylab=paste(100*object$probs,"Percentile of mean log10(Weight)"),
          main="EMP Equation Fit",...)

## S3 method for class 'EMPlm':
residual.plot(object, ...)
        
## S3 method for class 'EMPrq':
fit.plot(object,pch=16,col.pop="rich",col.Ws="black",lwd.Ws=3,
              lty.Ws=1,jitterX=TRUE,jitter.factor=3,...)

Arguments

df A data frame containing the length-weight data for each population.
pops A string or numeric indicating which column in df contains the variable identifying the different populations.
len A string or numeric indicating which column in df contains the variable with the length data.
wt A string or numeric indicating which column in df contains the variable with the weight data.
min A number indicating the midpoint value of the smallest X-mm length category.
max A number indicating the midpoint value of the largest X-mm length category.
w A number indicating the widths for which to create length categories.
n.cutoff A numeric indicating the minimum sample size in a length category that should be included in the regression.
cutoff.tail A logical indicating if all length categories larger than the lowest length category with a sample size below n.cutoff should be excluded =TRUE or just those length categories with sample sizes lower than n.cutoff.
qtype Type of quantile method to use. See details.
probs A number indicating the probability of the quantile. Must be between 0 and 1.
method A character indicating whether a linear regression (lm or quantile regression (rq) should be used to construct the standard weight equation. See details.
quadratic A logical indicating whether a quadratic regression should be fit (=TRUE or not.
x, object An object saved from the emp call (i.e., of class EMP).
pch A single numeric indicating what plotting characther codes should be used for the points in plot or fit.plot.
col.pop A string indicating the type of color or palette to use for the population of length-weight regression lines. See details.
col.Ws A string indicating the type of color to use for the standard length-weight regression line.
lwd.Ws A numeric indicating the width of the line to use for the standard length-weight regression line.
lty.Ws A numeric indicating the type of line to use for the standard length-weight regression line.
jitterX A logical indicating whether the x values in plot should be jittered.
jitter.factor A numeric indicating the relative magnitude of the jittering in x (sent to factor argument in jitter().
col.pt A string used to indicate the color of the plotted points.
xlab A label for the x-axis of fit.plot.
ylab A label for the y-axis of fit.plot.
main A label for the main title of fit.plot.
... Additional arguments for methods.

Details

The main function follows the steps of the empirical percentile method detailed in Gerow et al. (2005). In general, the mean log10 weight for each population within all length categories is computed, length categories with fewer than ncutoff are eliminated (see cutoff.tail description above), the third quartile of mean log10 weights for the remaining categories are found, and a n-weighted regression (quadratic regression if quadratic=TRUE) is then fit to the third quartile of mean log10 weights and the length category midpoint value.

Gerow et al. (2005) suggest using a quantile definition that is basically the same as qtype=9. Types of quantile calculation methods are discussed in the details of of quantile.

The plot, coef, and summary methods are used to construct a plot (see below), extract the coefficients of the standard weight equation, and find summary results of the lm object returned by the main function. The plot method plots the mean log10 weights versus length category midpoint for each population represented in the data frame with the resultant standard weight equation superimposed in black.

If the col.pop argument is set equal to one of these palettes – “rich”, “cm”, “default”, “grey”, “gray”, “heat”, “jet”, “rainbow”, “topo”, or “terrain” – and the order.pop=TRUE then the populations plotted should form a general color gradient from smallest to largest weight in the initial length category. This will make it easier to identify populations that “cross over” other populations.

Value

A list is returned with seven items. The first (pop.by.len) is a table of the number of populations represented in each length category. The second (ind.by.len) is a table of the number of individual fish in each length category. The third (ind.by.len.pop) is a table of the number of individual fish in each length category for each population. The fourth (mnlwt.by.len.pop) is a table of the mean log10 weight for each length category for each population. The fifth (regdata) is a dataframe used for the Ws regression (i.e., third quartiles of mean log10 weight and length category midpoints). The sixth (quadratic) is a logical indicating whether the quadratic regression was used. The seventh (Ws) is the Ws regression model results.

Author(s)

Derek H. Ogle, dogle@northland.edu

References

Gerow, K.G., R.C. Anderson-Sprecher, and W.A. Hubert. 2005. A new method to compute standard-weight equations that reduces length-related bias. North American Journal of Fisheries Management 25:1288-1300.

See Also

rlp, FroeseWs, validateWs, quantile in stats

Examples

## Walleye Ws equation for comparison to Gerow's Excel Tool
# Gerow's results were -- -4.624269, 2.477718, and 0.1461490 for the intercept, linear term, and quadratic term for 75th percentile Ws equation
# Gerow's results were -- -4.950281, 2.698470, and 0.1052352 for the intercept, linear term, and quadratic term for 50th percentile Ws equation
data(WalleyeGerowLW)
wae1 <- emp(WalleyeGerowLW,"popn","len","wt",min=155,max=955,cutoff.tail=FALSE)         # compare to Ws75 results
coef(wae1)
wae2 <- emp(WalleyeGerowLW,"popn","len","wt",min=155,max=955,qtype=9,cutoff.tail=FALSE) # compare to Ws75 results -- uses same quantile type?
coef(wae2)
wae1a <- emp(WalleyeGerowLW,"popn","len","wt",min=155,max=955,n.cutoff=1,probs=0.5)         # compare to Ws50 results; note use of all length categories
coef(wae1a)
wae2a <- emp(WalleyeGerowLW,"popn","len","wt",min=155,max=955,qtype=9,n.cutoff=1,probs=0.5) # compare to Ws50 results -- uses same quantile type?
coef(wae2a)

# It appears that a difference from Gerow's work is that the quantiles computed
#   here are different than his quantiles.  This can be seen by comparing the
#   regdata results with the results in his 'summarized' worksheet.  From
#   Gerow et al. (2005) it appears that he used 'qtype=9'; however, 'qtype=5'
#   provides the closest values to his Excel worksheet.
wae1$regdata

## Ruffe Ws equation from Ogle and Winfield
# Get data
data(RuffeWs)

# Isolate development data sets
rWs.d <- subset(RuffeWs,use=="develop")
rWs.d <- drop.levels(rWs.d,reorder=FALSE)
str(rWs.d)
# Summarize TL to set min and max to emp()
Summary(rWs.d$tl)
# Find the EmP Ws equation
emp.res.d <- emp(rWs.d,pop="regrnum",len="tl",wt="wt",min=60,max=220,w=10,n.cutoff=4,cutoff.tail=TRUE)
# EmP model results
anova(emp.res.d)
summary(emp.res.d)
# Fitted model and residual plots
fit.plot(emp.res.d)
plot(emp.res.d$Ws$residuals~emp.res.d$Ws$fitted.values,pch=19)
abline(h=0,lty=3)
# Sample sizes
emp.res.d$pop.by.len
emp.res.d$ind.by.len
# Fitted model relative to mean weights by length categories
plot(emp.res.d)

# Validate (explore length-related biases)
# Isolate validation data sets
rWs.v <- subset(RuffeWs,use=="validate")
rWs.v <- drop.levels(rWs.v,reorder=FALSE)

# Perform validation calculations -- Willis method
EMP.v.w <- validateWs(emp.res.d,rWs.v,"regrnum","tl","wt",min=60,max=210,w=10,type="Willis")
# Observed validation results
summary(EMP.v.w)
EMP.v.w
# See individual regressions -- NOT RUN
## Not run: xyplot(Wr~tl|locShort,data=EMP.v.w$df,type=c("p","r"),par.strip.text=list(cex=0.5))

# Perform validation calculations -- weighted EmpQ method
EMP.v.q <- validateWs(emp.res.d,rWs.v,"regrnum","tl","wt",min=60,max=220,w=10,type="EmpQ",weighted=TRUE)
anova(EMP.v.q)
fit.plot(EMP.v.q)

[Package FSA version 0.0-13 Index]