# rlp: Computes the standard weight equation using the... In droglenc/FSAWs: Functions for constructing and validating standard weight (Ws) equations for fish.

## Description

Computes the standard weight equation using the regression-line-percentile method when given the log(a) and b values for a population of length-weight regression equations.

## Usage

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29``` ```rlp(log.a, b, min, max, w = 10, qtype = 8, probs = 0.75, digits = NULL) ## S3 method for class 'rlp' plot(x, what = c("both", "raw", "log"), col.pop = c("rich", "cm", "default", "grey", "gray", "heat", "jet", "rainbow", "topp", "terrain"), lwd.pop = 1, lty.pop = 1, order.pop = TRUE, col.Ws = "black", lwd.Ws = 3, lty.Ws = 1, ...) ## S3 method for class 'rlp' anova(object, ...) ## S3 method for class 'rlp' coef(object, ...) ## S3 method for class 'rlp' predict(object, ...) ## S3 method for class 'rlp' summary(object, ...) ## S3 method for class 'rlp' fitPlot(object, pch = 16, col.pt = "black", col.Ws = "red", lwd.Ws = 3, lty.Ws = 1, xlab = "log10(midpt Length)", ylab = paste("log10(", 100 * object\$prob, " Percentile of Predicted Weight)", sep = ""), main = "RLP Equation Fit", ...) ## S3 method for class 'rlp' residPlot(object, ...) ```

## Arguments

 `log.a` A numeric vector that contains the log_{10}(a) values for the population of length-weight regression equations. `b` A numeric vector that contains the b values for the population of length-weight regression equations `min` A number that indicates the midpoint value of the smallest X-mm length category. `max` A number that indicates the midpoint value of the largest X-mm length category. `w` A number that indicates the widths for which to create length categories. `qtype` Type of quantile method to use. See details. `probs` A number that indicates the probability of the quantile. Must be between 0 and 1. `digits` Number of digits to round predicted weights. `x` An object saved from the `rlp` call (i.e., of class `rlp`). `object` An object saved from `rlp()` or `emp()` (i.e., of class `rlp`) for the `anova`, `coef`, and `summary` functions.. `what` A string that indicates the type of plot to produce. See details. `col.pop` A string that indicates the type of color or palette to use for the population of length-weight regression lines. See details. `order.pop` A logical that indicates whether the populations should be plotted from the smallest to largest weight in the initial length category. See details. `lwd.pop` A numeric that indicates the width of the line to use for the population of length-weight regression lines. `lty.pop` A numeric that indicates the type of line to use for the population of length-weight regression lines. `col.Ws` A string that indicates the type of color to use for the standard length-weight regression line. `lwd.Ws` A numeric that indicates the width of the line to use for the standard length-weight regression line. `lty.Ws` A numeric that indicates the type of line to use for the standard length-weight regression line. `pch` A single numeric that indicates what plotting characther codes should be used for the points in the fitPlot. `col.pt` A string used to indicate the color of the plotted points. `xlab` A label for the x-axis of fitPlot. `ylab` A label for the y-axis of fitPlot. `main` A label for the main title of fitPlot. `...` Additional arguments for methods.

## Details

The main function follows the steps of the regression-line-percentile method detailed in Murphy et al. (1990). In summary, a predicted weight is constructed for each 1-cm length class from each population from the given log_{10}(a) and b values, the predicted weight at the `prob`th percentile (wq) is identified, and a linear regression equation is fit to the log_{10}(wq) and log_{10}(midpoint length) data.

Note that log_{10}(a) and b must be from the regression of log_{10}(W) on log_{10}(L) where W is measured in grams and L is the total length measured in mm.

It appears that Murphy et al. (1990) used `qtype=6` in their SAS program. 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 `what` argument in the `plot` method can be set to `"both"`, `"log"`, or `"raw"`. The `"raw"` plot plots lines on the length-weight scale for each population represented in the `log.a` and `b` vectors with the resultant standard weight equation superimposed in red. The `"log"` plot constructs a similar plot but on the log_{10}(weight)-log_{10}(length) scale. The `"both"` option produces both plots side-by-side.

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 the following items:

• `log.a` is a numeric vector of the observed log_{10}(a) values sent in the `log.a` argument.

• `b` is a numeric vector of the observed b values sent in the `b` argument.

• `data.pred` is a matrix of the predicted weight at length for all populations.

• `data.reg` contains a data frame with the `prob`th quartile of predicted weights and the midpoint lengths.

• `Ws` is an `lm` object that contains the results of the regression of log_{10}(wq) on log_{10}(midpoint length).

## Author(s)

Derek H. Ogle, [email protected]

## References

Murphy, B.R., M.L. Brown, and T.A. Springer. 1990. Evaluation of the relative weight (Wr) index, with new applications to walleye. North American Journal of Fisheries Management, 10:85-97.

`emp`, `FroeseWs`, and `wsValidate`; and `quantile` in stats
 ```1 2 3 4 5 6 7 8 9``` ```## Recreate Murphy et al. (1990) results for largemouth bass # min and max lengths were 152 and 816 # compare to log.a=-5.379 and b=3.221 data(LMBassWs) lmb.rlp <- rlp(LMBassWs\$log.a,LMBassWs\$b,155,815,qtype=6) coef(lmb.rlp) plot(lmb.rlp) #fitPlot(lmb.rlp) #residPlot(lmb.rlp) ```