| FroeseWs {FSA} | R Documentation |
Computes the standard weight equation using the geometric mean of a and the mean of b from weight-length regression equations as described in Froese (2006).
FroeseWs(log.a,b)
## S3 method for class 'FROESE':
plot(x,min,max,what=c("both","raw","log"),col.pop="rich",lwd.pop=1,lty.pop=1,
order.pop=TRUE,col.Ws="black",lwd.Ws=3,lty.Ws=1, ...)
## S3 method for class 'FROESE':
coef(object, ...)
log.a |
A numeric vector containing the log_{10}(a) values for the population of length-weight regression equations. |
b |
A numeric vector containing the b values for the population of length-weight regression equations |
x |
An object saved from the FrowseWs() call (i.e., of class Froese). |
min |
A number indicating the smallest X-mm length to model. |
max |
A number indicating the midpoint value of the largest X-mm length category. |
object |
An object saved from FroeseWs() (i.e., of class FROESE). |
what |
A string indicating the type of plot to produce. See details. |
col.pop |
A string indicating the type of color or palette to use for the population of length-weight regression lines. See details. |
order.pop |
A logical indicating whether the populations should be plotted from the smallest to largest weight in the initial length category. See details. |
lwd.pop |
A numeric indicating the width of the line to use for the population of length-weight regression lines. |
lty.pop |
A numeric indicating the type of line to use for the population of length-weight regression lines. |
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. |
... |
Additional arguments for methods. |
The main function computes the mean of the log_{10}(a) and b values for the standard weight equation as detailed in Froese (2006). Note that log(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.
The plot and coef methods are used to construct a plot (see below) and extract the coefficients of the standard weight equation. 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.
A list is returned with five items. The first (log.a) is a numeric vector of the observed log_{10}(a) values sent in the
log.a argument. The second (b) is a numeric vector of the observed b values sent in the b argument. The third (gm.a) is a numeric containing the geometric mean of the a parameter. This is simply the back-transformed mean log_{10}(a) value – i.e., 10^{log_{10}(a)}. The fourth (mn.b) is the arithmetic mean of the b parameter. The fifth item (mn.log.a) is the arithmetic mean of log_{10}(a).
Derek H. Ogle, dogle@northland.edu
Froese, R. 2006. Cube law, condition factor and weight-length relationships: history, meta-analysis and recommendations. Journal of Applied Ichthyology 22:241-253.
rlp, emp, validateWs, quantile in stats
## Ruffe Ws equation from Ogle and Winfield
# Get data
data(RuffeWs)
## Create log10 TL and Wt
RuffeWs$logtl <- log10(RuffeWs$tl)
RuffeWs$logwt <- log10(RuffeWs$wt)
# Isolate development data sets
rWs.d <- subset(RuffeWs,use=="develop")
rWs.d <- drop.levels(rWs.d,reorder=FALSE)
str(rWs.d)
## Compute regression results for all data sets in development set
# First, a function to loop through the Wt vs. TL regressions
# this function is specific to the RuffeWs data frame
loopreg <- function(d,alpha=0.05) {
reg.nums <- sort(unique(d$regrnum))
n <- minTL <- maxTL <- minWT <- maxWT <- r2 <- loga <- b <- numeric(length(reg.nums))
reg.lbls <- country <- character(length(reg.nums))
sigb3 <- logical(length(reg.nums))
for (i in 1:length(reg.nums)) {
df <- drop.levels(subset(d,regrnum==reg.nums[i]),reorder=FALSE)
reg.lbls[i] <- levels(df$loc)
minTL[i] <- min(df$tl)
maxTL[i] <- max(df$tl)
minWT[i] <- min(df$wt)
maxWT[i] <- max(df$wt)
lw.lm <- lm(logwt~logtl,data=df)
n[i] <- dim(lw.lm$model)[1]
r2[i] <- summary(lw.lm)$r.squared
loga[i] <- coef(lw.lm)[1]
b[i] <- coef(lw.lm)[2]
sigb3[i] <- as.character(ho.coef(lw.lm,2,3)[,"p value"]<alpha)
}
data.frame(reg.lbls,n,minTL,maxTL,minWT,maxWT,loga,b,sigb3,r.sq=round(r2,3))
}
# Second, do the looping and view the results
reg.d <- loopreg(rWs.d)
view(reg.d)
# "Fit" the Froese model
Froese.res.d <- FroeseWs(reg.d$loga,reg.d$b)
# Observe results
coef(Froese.res.d)
plot(Froese.res.d,min=55,max=200)
# 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
Froese.v.w <- validateWs(Froese.res.d,rWs.v,"regrnum","tl","wt",min=60,max=190,w=10,type="Willis")
summary(Froese.v.w)
Froese.v.w
# See individual regressions -- NOT RUN
## Not run: xyplot(Wr~tl|locShort,data=Froese.v.w$df,type=c("p","r"),par.strip.text=list(cex=0.5))
# Perform validation calculations -- EmpQ method
Froese.v.q <- validateWs(Froese.res.d,rWs.v,"regrnum","tl","wt",min=60,max=190,w=10,type="EmpQ",use.means=TRUE,weighted=TRUE)
anova(Froese.v.q)
fit.plot(Froese.v.q,ylab="Standarded Mean Mean Weight")