// library(ascii) // setwd("c://aaaWork//web//fishR//bookex//AIFFD//Box6_5") // Sweave("Box6_5a.Rnw",driver=RweaveAsciidoc) AIFFD Box 6.5 Vignette ======================= :Author: Derek H. Ogle :Email: dogle@northland.edu :Date: 10-June-2010 :Revision: 2 == Required Packages and Setting Options ---- > library(FSA) # catch.curve ---- == Preparing Data The data for this box is very simple and could have been entered directly into R. However, I have entered these data into an external tab-delimited text file which is read into R and observed as follows: ---- > setwd("c://aaaWork//web//fishR//bookex//AIFFD//Box6_5") > d <- read.table("box6_5.txt",header=TRUE) > d year.class catch age0 1 2000 150 1665 2 1999 28 556 3 1998 5 111 4 1997 69 2330 5 1996 12 445 6 1995 17 1220 ---- First, age needs to be computed from +*year.class*+ as follows, ---- > d$age <- 2001 - d$year.class ---- As suggested in Box 6.5 an index of year-class strength is created by dividing the annual capture of age-0 fish (i.e., +*age0*+) by the minimum annual capture of age-0 fish in all years. This is accomplished with, ---- > d$ycs <- d$age0/min(d$age0) ---- The catch of fish in each age-class is then adjusted by dividing the observed trap-net catch by this index of year-class strength, ---- > d$adjcatch <- d$catch/d$ycs ---- It is good practice to see what the data frame now looks like, ---- > d year.class catch age0 age ycs adjcatch 1 2000 150 1665 1 15.000000 10.000000 2 1999 28 556 2 5.009009 5.589928 3 1998 5 111 3 1.000000 5.000000 4 1997 69 2330 4 20.990991 3.287124 5 1996 12 445 5 4.009009 2.993258 6 1995 17 1220 6 10.990991 1.546721 ---- == Fitting Catch-Curve Method The table of the data shows that all adjusted catches appear to be on the descending limb of the catch-curve and thus should be used in the regression to estimate the instantaneous mortality rate. The catch-curve model is fit, as described in the link:../Box6_4.html[Box 6.4 Vignette] with (note that leaving the third argument to +*[red]#catch.curve#*+ blank tells R to use all ages), ---- > cc1 <- catch.curve(d$age, d$adjcatch) > summary(cc1) Estimate Std. Error t value Pr(>|t|) Z 0.3321564 0.03699358 8.978758 0.0008515291 A 28.2624898 NA NA NA > confint(cc1) 95% LCI 95% UCI Z 0.2294458 0.4348671 A 20.5025925 35.2649284 > plot(cc1) ---- image::Box6_5a-008.png[] These results are very slightly different from what is shown in Box 6.5. This is likely due to rounding but it is unclear if this is the reason as enough computational detail is not shown in Box 6.5. == A Slight Alternative It makes more sense to me to compute a so-called _year-class correction factor_ by dividing the maximum observed catch by each of the individual catches-at-age; e.g., ---- > d$yccf <- max(d$age0)/d$age0 > d$yccf [1] 1.399399 4.190647 20.990991 1.000000 5.235955 1.909836 ---- These values then represent how many times smaller that year-class is then the maximum observed year-class. If each catch is then multiplied by this value it inflates the smaller year-classes "up to" the size of the largest year-class. This adjustment is constructed with, ---- > d$adjcatch2 <- d$catch * d$yccf ---- and then the catch-curve model is fith with, ---- > cc2 <- catch.curve(d$age, d$adjcatch2) > summary(cc2) Estimate Std. Error t value Pr(>|t|) Z 0.3321564 0.03699358 8.978758 0.0008515291 A 28.2624898 NA NA NA ---- A comparison of these results with the results from above shows that it does not make any difference which "adjustment" method you use. In fact, "re-scaling" to any constant value -- minimum catch, maximum catch, mean catch, or 100 -- will result in the same estimated instantaneous mortality rate because the slope of the regression is invariant to linear transformations of the data (all of these "scales" only differ by a constant ratio). As a final example, examine the results from scaling to the mean catch, ---- > d$yccf2 <- mean(d$age0)/d$age0 > d$adjcatch3 <- d$catch * d$yccf2 > cc3 <- catch.curve(d$age, d$adjcatch3) > summary(cc3) Estimate Std. Error t value Pr(>|t|) Z 0.3321564 0.03699358 8.978758 0.0008515291 A 28.2624898 NA NA NA ----