RuffeWs: Raw Length-weight data that can be used to compute the Ws for...

Description Format Source See Also Examples

Description

Raw length-weight data from a variety of populations used for computing the standard weight (Ws) equation for ruffe (Gymnocephalus cernuus).

Format

A data frame with 20005 observations on the following 13 variables:

regrnum

A unique numeric identifier for each separate regression – should match one-to-one with locShort.

fishID

A numeric identifier for each fish that is not unique.

country

Country of data set.

locShort

Name (and possibly year) of data set.

watertype

Waterbody type descriptor.

year

Year of collection.

month

Month of collection.

day

Day of collection.

tl

Total length (mm) of fish.

fl

Fork length (mm) of fish.

sl

Standard length (mm) of fish.

wt

Weight (g) of fish.

use

Use of data set – either develop or validate.

Source

From Ogle, D.H. and I.J. Winfield. 2009. Ruffe length-weight relationships with a proposed standard weight equation. North American Journal of Fisheries Management 29:850-85.

See Also

rlp, emp, and wsValidate.

Examples

  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
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
library(FSA)
data(RuffeWs)
## Create log10 TL and Wt
RuffeWs$logtl <- log10(RuffeWs$tl)
RuffeWs$logwt <- log10(RuffeWs$wt)

## Isolate development and validation data sets
rWs.d <- subset(RuffeWs,use=="develop")
rWs.d <- gdata::drop.levels(rWs.d,reorder=FALSE)
str(rWs.d)

rWs.v <- subset(RuffeWs,use=="validate")
rWs.v <- gdata::drop.levels(rWs.v,reorder=FALSE)
str(rWs.v)

## Compute regression results for all data sets in development set
# First, a function to loop through the Wt vs. TL regressions
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 <- gdata::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]
  }
  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)
head(reg.d)


## Ruffe Ws equation from Ogle and Winfield
# 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
fitPlot(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)
# Perform validation calculations -- Willis method
emp.v.w <- wsValidate(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

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


## Fit the RLP model
rlp.res.d <- rlp(reg.d$loga,reg.d$b,min=60,max=210,w=10)
# RLP model results
summary(rlp.res.d)
# Fitted model and residual plot
fitPlot(rlp.res.d)
residPlot(rlp.res.d)
# Show rlp model relative to all regression lines
plot(rlp.res.d)

# Validate (explore length-related biases)
# Perform validation calculations -- Willis method
rlp.v.w <- wsValidate(rlp.res.d,rWs.v,"regrnum","tl","wt",min=60,max=210,w=10,type="Willis")
summary(rlp.v.w)
rlp.v.w


# Perform validation calculations -- weighted EmpQ method
rlp.v.q <- wsValidate(rlp.res.d,rWs.v,"regrnum","tl","wt",min=60,max=210,w=10,
  type="EmpQ",weighted=TRUE)
anova(rlp.v.q)
fitPlot(rlp.v.q)


## "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)
# Perform validation calculations -- Willis method
Froese.v.w <- wsValidate(Froese.res.d,rWs.v,"regrnum","tl","wt",min=60,max=190,w=10,type="Willis")
summary(Froese.v.w)
Froese.v.w

# Perform validation calculations -- EmpQ method
Froese.v.q <- wsValidate(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)
fitPlot(Froese.v.q,ylab="Standarded Mean Mean Weight")

droglenc/FSAWs documentation built on July 8, 2018, 7:01 a.m.