Skip to contents

Introduction

Condition is a measure of the physical condition of a population of fish based on the relative heaviness or plumpness of the fish as compared to a standard. One measure is called relative weight and is simply 100 times the observed weight of a fish divided by a standard weight derived from an accepted model for that species and the individual’s observed length; i.e.,

Wri=100WiWsi(1) Wr_i = 100\frac{W_i}{Ws_i} \qquad(1)

where WriWr_i is the relative weight, WiW_i is the observed weight, and WsiWs_i is the standard weight for the iith fish. Individual relative weights are summarized to provide an overall measure of condition for the population. Relative weight and condition are explained in a variety of sources, including Ogle (2015). The goal of this vignette is to demonstrate how to calculate relative weights using functions inFSA.

The following packages are used herein. Note that the FSA functions described here were modified after version 0.9.6 and are thus specific to FSA >v0.9.6.

library(FSA)
library(dplyr)  # mutate, select, group_by, summarize

Standard Weight Equations

Equations for computing the standard weight (i.e., WsiWs_i) from an individual fish’s observed length (i.e., LiL_i) have been derived for a number of freshwater game fish in the United States, as well as several non-game fish in the United States and some other fish from outside of the United States. The specifics of these equations have been collated into the WSlit data.frame1 distributed with FSA and are most easily accessed with wsVal(). For example, the specifics of the standard weight equation for Bluegill are retrieved below.

wsVal("Bluegill")
#>     species measure  units ref method min.TL    int slope         source
#> 26 Bluegill      TL metric  75  Other     80 -5.374 3.316 Hillman (1982)

The results returned from wsVal() are:

  • species: species of fish asked for. If left blank then a list of all species for which a standard weight equation exists in WSlit will be shown.
  • group: the sub-group for the species. Some species have separate standard weight equations for sub-groups (e.g,. male or female, or lentic and lotic). If group does not appear in the output then there is no sub-group for that species (as illustrated here). The sub-group can be chosen with group= in wsVal() as demonstrated later.2
  • measure: the length measure used (will generally be TL for total length, but could be FL for fork length, BL for body length, or CL for caudal length depending on the species).
  • units: the units for which the equation was developed. The default is metric which has length in mm and weight in grams. However, English can also be used which has lengths in inches and weight in pounds. These are the only two “units” for which the equation can be returned; thus, if you recorded lengths and weights in different units you will need to adjust your data accordingly (or adjust the standard weights computed from the equations (see below) accordingly).
  • ref: the quantile used when developing the standard weight equation. The 75th percentile is used for most species, but some species have alternatives (50th or 25th percentile). Alternatives for a species can be chosen with ref= in wsVal().3
  • method: the method used to develop the standard weight equation. This will usually be RLP (regression-line-percentile) or EmP (empirical percentile) but is Other only for Bluegill, as shown here. Some (very few) species have equations for both methods. In these instances, you will need to choose which to use with method= in wsVal().4
  • min.TL: the minimum length for which the standard weight equation is appropriate.5
  • max.TL: the maximum length for which the standard weight equation is appropriate. Maximum lengths have not been specified for all species and, thus, may not appear in all outputs (e.g., for Bluegill here).
  • int: the intercept, on the common logarithm (i.e., log10) scale, for the standard weight equation.
  • slope: the slope, on the log10 scale, for the standard weight equation.
  • quad: the coefficient for the quadratic term, on the log10 scale, of the standard weight equation. Most species will not have a quadratic term and, thus, this may not appear in many outputs.
  • source: the literature source for the standard weight equation.
  • comments: comments about the standard weight equation. Not all species have comments, thus, this may not appear in many outputs.

A simpler output of only the equation coefficients and the lengths for which it applies may be returned by including simplify=TRUE in wsVal().6

wsVal("Bluegill",simplify=TRUE)
#>     species min.TL    int slope
#> 26 Bluegill     80 -5.374 3.316

Blue Sucker is an example where some of the “optional” values are returned (e.g., max.TL and quad). The example below further illustrates that the results can be returned in “English” units for many species.

wsVal("Blue Sucker",units="English")
#>        species measure   units ref method min.TL max.TL    int slope  quad
#> 23 Blue Sucker      TL English  75    EmP    9.5  31.75 -3.354 2.273 0.461
#>                 source
#> 23 Neely et al. (2008)

Use of wsVal() requires spelling (and capitalizing) the name as it appears in WSlit. One can see all species names available in WSlit with wsVal() without any arguments.

wsVal()
#> 
#> Species name must be one of following. Be careful of spelling and capitalization.
#>   [1] "Aegean Chub"                "African Sharptooth Catfish"
#>   [3] "Alabama Bass"               "Ankara Nase"               
#>   [5] "Arctic Grayling"            "Bighead Carp"              
#>   [7] "Bigmouth Buffalo"           "Bigmouth Sleepers"         
#>   [9] "Black Bullhead"             "Black Crappie"             
#>  [11] "Blacktail Redhorse"         "Blue Catfish"              
#>  [13] "Blue Sucker"                "Bluegill"                  
#>  [15] "Bridgelip Sucker"           "Brook Chub"                
#>  [17] "Brook Trout"                "Brown Bullhead"            
#>  [19] "Brown Trout"                "Bull Trout"                
#>  [21] "Burbot"                     "Cavedano Chub"             
#>  [23] "Chain Pickerel"             "Channel Catfish"           
#>  [25] "Chinook Salmon"             "Cisco"                     
#>  [27] "Common Carp"                "Cutthroat Trout"           
#>  [29] "European Chub"              "European Perch"            
#>  [31] "Flannelmouth Sucker"        "Flathead Catfish"          
#>  [33] "Fourbarbel Scraper"         "Freshwater Drum"           
#>  [35] "Gizzard Shad"               "Golden Shiner"             
#>  [37] "Golden Trout"               "Goldeye"                   
#>  [39] "Green Sunfish"              "Horse Barbel"              
#>  [41] "Humpback Chub"              "Kokanee"                   
#>  [43] "Lake Chubsucker"            "Lake Herring"              
#>  [45] "Lake Trout"                 "Largemouth Bass"           
#>  [47] "Largescale Sucker"          "Longnose Gar"              
#>  [49] "Marble Trout"               "Mountain Mullet"           
#>  [51] "Mountain Whitefish"         "Muskellunge"               
#>  [53] "Nile Tilapia"               "Nipple-Lip Scraper"        
#>  [55] "Northern Pike"              "Northern Pikeminnow"       
#>  [57] "Northern Snakehead"         "Northern Squawfish"        
#>  [59] "Paddlefish"                 "Palmetto Bass"             
#>  [61] "Pejerrey"                   "Pumpkinseed"               
#>  [63] "Pursak Chub"                "Rainbow Trout"             
#>  [65] "Razorback Sucker"           "Redbreast Sunfish"         
#>  [67] "Redear Sunfish"             "Riffle Dace"               
#>  [69] "River Carpsucker"           "River Goby"                
#>  [71] "Rock Bass"                  "Roundtail Chub"            
#>  [73] "Ruffe"                      "Sardine"                   
#>  [75] "Sauger"                     "Saugeye"                   
#>  [77] "Shoal Bass"                 "Shorthead Redhorse"        
#>  [79] "Shovelnose Sturgeon"        "Silver Carp"               
#>  [81] "Smallmouth Bass"            "Smallmouth Buffalo"        
#>  [83] "South European Roach"       "Spotted Bass"              
#>  [85] "Spotted Gar"                "Spotted Sunfish"           
#>  [87] "Striped Bass"               "Striped Bass X White Bass" 
#>  [89] "Suwannee Bass"              "Tiger Muskellunge"         
#>  [91] "Utah Chub"                  "Walleye"                   
#>  [93] "Warmouth"                   "White Bass"                
#>  [95] "White Catfish"              "White Crappie"             
#>  [97] "White Perch"                "White Sturgeon"            
#>  [99] "White Sucker"               "Yellow Bass"               
#> [101] "Yellow Bullhead"            "Yellow Perch"

All parts of the species names in WSlit are capitalized (e.g., “Blue Sucker” and not “blue sucker” or “Blue sucker”). wsVal() will return an informative error message if your capitalization is not correct but the message will be less informative if your spelling is off.

wsVal("Blue sucker")
#> Error: There is no Ws equation in 'WSlit' for "Blue sucker". However, there is
#>   an entry for "Blue Sucker" (note spelling, including capitalization).
wsVal("Blue suckr")
#> Error: There is no Ws equation in 'WSlit' for "Blue suckr". Type 'wsVal()' to
#>   see a list of available species.

It is also not always obvious whether a species has equations for sub-groups or not.7 One way to deal with this is to just ask for the equation for your species of interest without using group=. If sub-groups exist then you will get an error message asking you to choose which sub-group to use.

wsVal("Brown Trout")
#> Error: "Brown Trout" has Ws equations for these sub-groups: "lentic" and
#>   "lotic". Please use 'group=' to select the equation for one of these
#>   groups.

Then try again by choosing the sub-group with group=.

wsVal("Brown Trout",group="lentic")
#>        species  group measure  units ref method min.TL    int slope
#> 36 Brown Trout lentic      TL metric  75    RLP    140 -5.422 3.194
#>                      source
#> 36 Hyatt and Hubert (2001b)

The same general process can be used for species that have equations developed from multiple methods.

wsVal("Arctic Grayling")
#> Error: Ws equations exist for both the RLP and EmP 'method's for "Arctic
#>   Grayling". Please select one or the other with 'method='.
wsVal("Arctic Grayling",method="EmP")
#>           species measure  units ref method min.TL    int slope
#> 6 Arctic Grayling      TL metric  75    EmP    150 -5.279 3.096
#>                 source                                                comment
#> 6 Gilham et al. (2021) authors note that either RLP or EmP method may be used

Or for multiple reference groups.

wsVal("Ruffe")
#> Error: Ws equations exist for more than one 'ref'erence value for "Ruffe".
#>   Please select one of the following values with 'ref=': 50 or 75.
wsVal("Ruffe",ref=50)
#>     species measure  units ref method min.TL max.TL     int  slope   quad
#> 147   Ruffe      TL metric  50    EmP     55    205 -3.3524 1.3969 0.4054
#>                       source
#> 147 Ogle and Winfield (2009)

Cautions

Table 1 shows species for which multiple standard weight equations exist in WSlit such that the specific one must be chosen by using group=, method=, or ref= in wsVal().

Table 1: Species for which the user will have to select among multiple standard weight equations by using group=, method=, or ref= in wsVal().
Species Cause of Multiple Equations
Arctic Grayling Multiple methods exist
Bigmouth Sleepers Sub-groups exist; multiple reference values
Brook Trout Sub-groups exist
Brown Trout Sub-groups exist
Cutthroat Trout Sub-groups exist
Mountain Mullet Multiple reference values
Muskellunge Sub-groups exist
Paddlefish Sub-groups exist
Rainbow Trout Sub-groups exist
River Goby Multiple reference values
Ruffe Multiple reference values
Sardine Multiple reference values
Spotted Bass Sub-groups exist
Walleye Sub-groups exist

Calculate Individual Relative Weight

Example with Linear Equation

The specifics of the standard weight equation returned by wsVal() can be used to compute the standard weight for a fish given its observed length. As an example, suppose that the relative weight of a Largemouth Bass with an observed length and weight of 350 mm and 650 g is desired.

Begin by assigning the specifics of the standard weight equation for Largemouth Bass returned by wsVal() to an object (e.g., wsLMB here).

wsLMB <- wsVal("Largemouth Bass")

The intercept and slope for the standard weight equation on the log10-log10 scale can be extracted from this object.

wsLMB[["int"]]
#> [1] -5.528
wsLMB[["slope"]]
#> [1] 3.273

The standard weight is then computed from these results and the log10-transformed observed length as follows (with the result saved to an object, called ex1 here). Make sure to note the use of 10^ to back-transform the log10-transformed standard weight to a standard weight on the raw scale.

( ex1 <- 10^(wsLMB[["int"]]+wsLMB[["slope"]]*log10(350)) )
#> [1] 629.1218

This calculation suggests that standard weight for a 250 mm Largemouth Bass is 629.1 g. With this and Equation 1, the relative weight for this individual can be computed (recalling that the observed weight was 650 g).

100*650/ex1
#> [1] 103.3186

This indicates that the individual is heavier than a standard fish of the same length as this values is greater than 100.

Example with Quadratic Equation

A similar process can be followed for species where the standard weight equation includes a quadratic term. The only “trick” here is to include the quadratic term multiplied by the square of the log10-transformed observed length when computing the standard weight. This calculation is illustrated below with a 500 mm and 1010 g Blue Sucker.

( wsBS <- wsVal("Blue Sucker",simplify=TRUE) )
#>        species min.TL max.TL   int slope  quad
#> 24 Blue Sucker    240    809 -2.98 0.977 0.461
( ex2 <- 10^(wsBS[["int"]]+wsBS[["slope"]]*log10(500)+wsBS[["quad"]]*log10(500)^2) )
#> [1] 1035.19
100*1010/ex2
#> [1] 97.56662

Cautions

A few things to consider when calculating relative weights for individuals.

  • Make sure the individual is longer than the minimum and shorter than the maximum (if given) length returned by wsVal().
  • Make sure to log10-transform the observed length when computing the standard weight. Note that all standard weight equations use log10 so never use the natural log with standard weight calculations.
  • Make sure to back-transform (i.e., raise to the power of 10) the value so that the standard weight is on the raw rather than log10-transformed scale.
  • Relative weights have traditionally been reported on a scale where the fraction is multiplied by 100 (i.e., so 100 means that the observed weight equals the standard weight). Thus, don’t forget to multiply by 100 when computing the relative weight.

Calculate Relative Weights for All of One Species

It is not common to compute the standard and relative weights for a single individual as was done in the previous section. Rather, it is more useful to calculate these values for all individuals in a sample, and then summarize those values for an overall assessment of the condition of those individuals.

Consider the CiscoTL data.frame distributed with the FSAdata package that contains the lengths (mm) and weights (g) of Cisco (Coregonus artedii) sampled from Trout Lake, WI, USA over a 25 year period.

data("CiscoTL",package="FSAdata")
str(CiscoTL)
#> 'data.frame':    8594 obs. of  8 variables:
#>  $ lakeid    : Factor w/ 1 level "TR": 1 1 1 1 1 1 1 1 1 1 ...
#>  $ year4     : int  1981 1981 1981 1981 1981 1981 1981 1981 1981 1981 ...
#>  $ sampledate: Factor w/ 59 levels "7/19/2004","7/20/2004",..: 48 47 48 51 51 51 51 48 48 47 ...
#>  $ gearid    : Factor w/ 9 levels "ELFISH","TRAMML",..: 5 5 5 5 5 5 5 5 5 5 ...
#>  $ spname    : Factor w/ 1 level "CISCO": 1 1 1 1 1 1 1 1 1 1 ...
#>  $ length    : int  140 146 147 153 150 152 146 153 156 176 ...
#>  $ weight    : num  21.4 22.3 23.3 23.5 24 24 24.5 25.9 26.5 35.8 ...
#>  $ sex       : Factor w/ 3 levels "F","I","M": 1 1 1 1 1 1 1 1 1 1 ...
peek(CiscoTL,n=10)
#>      lakeid year4 sampledate gearid spname length weight  sex
#> 1        TR  1981  8/11/1981 VGN032  CISCO    140   21.4    F
#> 955      TR  1983  7/29/1983 VGN032  CISCO    196     NA <NA>
#> 1910     TR  1984  7/24/1984 VGN038  CISCO    213     NA <NA>
#> 2865     TR  1987  7/28/1987 VGN038  CISCO    208     NA <NA>
#> 3820     TR  1991  7/30/1991 VGN025  CISCO    139     NA <NA>
#> 4774     TR  1993  7/27/1993 VGN038  CISCO    213     NA <NA>
#> 5729     TR  1997  7/28/1997 VGN032  CISCO    174     NA <NA>
#> 6684     TR  1999  7/26/1999 VGN025  CISCO    137     NA <NA>
#> 7639     TR  2002  7/23/2002 VGN025  CISCO    144     NA <NA>
#> 8594     TR  2006  7/20/2006 VGN038  CISCO    216     NA <NA>

Note that there are lots of missing weights in this data.frame.

“Manual” Calculations

The relative weight calculation begins by finding the specifics of the standard weight equation for Cisco.

( wsC <- wsVal("Cisco") )
#>    species measure  units ref method min.TL    int slope
#> 51   Cisco      TL metric  75    RLP    100 -5.517 3.224
#>                       source                  comment
#> 51 Fisher and Fielder (1998) same as for Lake Herring

Two new variables – Ws for standard weight and Wr for relative weight – are added to the data.frame in three steps below. First, Ws is calculated using the coefficients from the standard weight equation and the log-transformed length variable as shown above (but within mutate() from dplyr). Second, if the observed length is less than the minimum length for which the standard weight equation should be applied, then the previously calculated Ws is replaced with an NA (for missing value). Finally, the relative weight is computed from the observed weight and standard weight variables using Equation 1.

CiscoTL <- CiscoTL |>
  mutate(Ws=10^(wsC[["int"]]+wsC[["slope"]]*log10(length)),
         Ws=ifelse(length<wsC$min.TL,NA,Ws),
         Wr=100*weight/Ws)
peek(CiscoTL,n=10)
#>      lakeid year4 sampledate gearid spname length weight  sex        Ws      Wr
#> 1        TR  1981  8/11/1981 VGN032  CISCO    140   21.4    F  25.24159 84.7807
#> 955      TR  1983  7/29/1983 VGN032  CISCO    196     NA <NA>  74.68503      NA
#> 1910     TR  1984  7/24/1984 VGN038  CISCO    213     NA <NA>  97.65531      NA
#> 2865     TR  1987  7/28/1987 VGN038  CISCO    208     NA <NA>  90.45575      NA
#> 3820     TR  1991  7/30/1991 VGN025  CISCO    139     NA <NA>  24.66492      NA
#> 4774     TR  1993  7/27/1993 VGN038  CISCO    213     NA <NA>  97.65531      NA
#> 5729     TR  1997  7/28/1997 VGN032  CISCO    174     NA <NA>  50.87809      NA
#> 6684     TR  1999  7/26/1999 VGN025  CISCO    137     NA <NA>  23.53895      NA
#> 7639     TR  2002  7/23/2002 VGN025  CISCO    144     NA <NA>  27.64144      NA
#> 8594     TR  2006  7/20/2006 VGN038  CISCO    216     NA <NA> 102.15953      NA

As an illustration, the mean and standard deviation of relative weights are computed below (along with validn which is the number of non-NA (i.e., non-missing) relative weights).8 These results suggest that this population of Cisco is substantially “skinnier” (i.e., under-weight) than the standard for the species (because the mean relative weight is substantially less than 100).

CiscoTL |>
  summarize(validn=sum(!is.na(Wr)),
            mnWr=mean(Wr,na.rm=TRUE),
            sdWr=sd(Wr,na.rm=TRUE))
#>   validn    mnWr     sdWr
#> 1   1190 76.6967 7.784748

Using the WrAdd() Convenience Function

wrAdd() can be used to add a relative weight variable to a data.frame for all species in the data.frame for which a standard weight equation exists. The main argument to wrAdd() is a formula of the form weight~length+species where weight is the observed weight variable, length is the observed length variable, and species is the name of the species variable. One constraint here is that the species must be spelled (and capitalized) as in WSlit. In these data for Cisco, the species name is in spname but the species is all capital letters as “CISCO”, rather than the required “Cisco”. capFirst()9 may be used to convert a word to a form where just the first letter is capitalized, and is used below.10

CiscoTL <- CiscoTL |>
  mutate(Wr=wrAdd(weight~length+capFirst(spname)))
peek(CiscoTL,n=10)
#>      lakeid year4 sampledate gearid spname length weight  sex      Wr
#> 1        TR  1981  8/11/1981 VGN032  CISCO    140   21.4    F 84.7807
#> 955      TR  1983  7/29/1983 VGN032  CISCO    196     NA <NA>      NA
#> 1910     TR  1984  7/24/1984 VGN038  CISCO    213     NA <NA>      NA
#> 2865     TR  1987  7/28/1987 VGN038  CISCO    208     NA <NA>      NA
#> 3820     TR  1991  7/30/1991 VGN025  CISCO    139     NA <NA>      NA
#> 4774     TR  1993  7/27/1993 VGN038  CISCO    213     NA <NA>      NA
#> 5729     TR  1997  7/28/1997 VGN032  CISCO    174     NA <NA>      NA
#> 6684     TR  1999  7/26/1999 VGN025  CISCO    137     NA <NA>      NA
#> 7639     TR  2002  7/23/2002 VGN025  CISCO    144     NA <NA>      NA
#> 8594     TR  2006  7/20/2006 VGN038  CISCO    216     NA <NA>      NA

wrAdd() deals with species that have more than one standard weight equation11 with WsOpts=. For example, consider adding a relative weight variable to the RuffeSLRH92 data.frame distributed with FSAdata.

data("RuffeSLRH92",package="FSAdata")
str(RuffeSLRH92)
#> 'data.frame':    738 obs. of  11 variables:
#>  $ fish.id : num  1992 1992 1992 1992 1992 ...
#>  $ month   : int  4 4 4 4 4 4 4 4 4 4 ...
#>  $ day     : int  23 23 23 23 23 23 23 23 23 23 ...
#>  $ year    : int  1992 1992 1992 1992 1992 1992 1992 1992 1992 1992 ...
#>  $ indiv   : int  1 2 3 4 5 6 7 8 9 10 ...
#>  $ location: int  160170 160170 160170 160170 160170 160170 160170 160170 160170 160170 ...
#>  $ length  : int  90 128 112 68 56 58 111 111 115 65 ...
#>  $ weight  : num  9.3 32.5 19 4.4 2.1 2.8 16.1 17.9 22.7 3.4 ...
#>  $ sex     : Factor w/ 3 levels "female","male",..: 2 1 2 2 3 2 2 2 2 1 ...
#>  $ maturity: Factor w/ 11 levels "developing","immature",..: 7 7 7 7 10 7 7 7 7 2 ...
#>  $ age     : int  NA NA NA NA NA NA NA NA NA 1 ...

Note that there is no species variable, which is needed by wrAdd().12 Additionally, for simplicity of presentation, I removed several other variables that are not needed for this example.

RuffeSLRH92 <- RuffeSLRH92 |>
  mutate(species="Ruffe") |>
  select(species,length,weight,sex)
peek(RuffeSLRH92,n=10)
#>     species length weight     sex
#> 1     Ruffe     90    9.3    male
#> 82    Ruffe    120   24.0    male
#> 164   Ruffe    142   33.1  female
#> 246   Ruffe     84    7.4  female
#> 328   Ruffe    100   12.6    male
#> 410   Ruffe     25    0.2 unknown
#> 492   Ruffe     94   13.0    male
#> 574   Ruffe     85    7.9    male
#> 656   Ruffe    145   39.1    male
#> 738   Ruffe    160   52.9  female

Code similar to that used above for Cisco returns an error because there are standard weight equations for Ruffe for both 50th and 75th percentile references (see snippet below with the error message).

RuffeSLRH92 <- RuffeSLRH92 |>
  mutate(Wr=wrAdd(weight~length+species))
#>     species group ref method
#> 147   Ruffe  <NA>  50    EmP
#> 148   Ruffe  <NA>  75    EmP
#> Error in `mutate()`:
#> ℹ In argument: `Wr = wrAdd(weight ~ length + species)`.
#> Caused by error:
#> ! More than one Ws equation exists for "Ruffe". Please use a named list
#>   in 'opts=' to select one equation for "Ruffe" by specifing 'group',
#>   'ref', or 'method' as appropriate. See details in documentation and
#>   above (for reference).

To continue, wrAdd() must be instructed as to which of these two equations should be used to calculate the standard weight and, thus, relative weight. This is handled with a list in WsOpts= which will include the species name set equal to a list which identifies the specific equation to use (i.e., ref=50 in this example).

RuffeSLRH92 <- RuffeSLRH92 |>
  mutate(Wr=wrAdd(weight~length+species,WsOpts=list(Ruffe=list(ref=50))))
peek(RuffeSLRH92,n=10)
#>     species length weight     sex        Wr
#> 1     Ruffe     90    9.3    male 110.34512
#> 82    Ruffe    120   24.0    male 119.03123
#> 164   Ruffe    142   33.1  female  97.21733
#> 246   Ruffe     84    7.4  female 107.76315
#> 328   Ruffe    100   12.6    male 108.98596
#> 410   Ruffe     25    0.2 unknown        NA
#> 492   Ruffe     94   13.0    male 135.44538
#> 574   Ruffe     85    7.9    male 111.08527
#> 656   Ruffe    145   39.1    male 107.53033
#> 738   Ruffe    160   52.9  female 106.51935

Calculate Relative Weights for All of Multiple Species

The real value of wrAdd() is that it can be used to efficiently add a relative weight variable for multiple species in a single data.frame. For example, InchLake2 distributed with FSAdata contains lengths and weights for several species captured from Inch Lake.

data("InchLake2",package="FSAdata")
peek(InchLake2,n=10)
#>     netID fishID          species length weight year
#> 1     206    501         Bluegill    1.5    0.7 2008
#> 57     16    208    Black Crappie   11.6  380.0 2007
#> 115   101    583         Bluegill    5.5   48.0 2008
#> 172   102    642 Bluntnose Minnow    2.1    1.3 2008
#> 229   116    760  Largemouth Bass    2.8    2.0 2008
#> 287   109    843  Largemouth Bass   13.1  460.0 2008
#> 344   130    902  Largemouth Bass   10.1  173.0 2008
#> 401     6    178         Bluegill    6.2   62.0 2007
#> 459    12     45 Bluntnose Minnow    2.7    6.0 2007
#> 516     4    127         Bluegill    6.6   90.0 2007

One oddity of these data is that length was recorded in inches, whereas weight was recorded in grams. The standard weight equations either use inches and pounds or millimeters and grams. In this case, I converted the inches to mm first, and then added the relative weight variable with wrAdd() as before.

InchLake2 <- InchLake2 |>
  mutate(lenmm=length*25.4,
         Wr=wrAdd(weight~lenmm+species))

The mean and sd of relative weight by species is shown below. It is important to carefully examine these results because a species could have no mean relative weight calculated because there is no standard weight equation for that species (in WSlit) or because the species name is not spelled as expected (in WSlit). The four species with no mean relative weight below all do, indeed, not have a known standard weight equation.

InchLake2 |>
  group_by(species) |>
  summarize(validn=sum(!is.na(Wr)),
            mnWr=mean(Wr,na.rm=TRUE),
            sdWr=sd(Wr,na.rm=TRUE)) |>
  as.data.frame()
#>            species validn     mnWr      sdWr
#> 1    Black Crappie     25 90.10370  5.990792
#> 2         Bluegill    160 86.11836 12.997061
#> 3 Bluntnose Minnow      0      NaN        NA
#> 4   Fathead Minnow      0      NaN        NA
#> 5      Iowa Darter      0      NaN        NA
#> 6  Largemouth Bass     87 83.89716  8.011810
#> 7      Pumpkinseed     12 95.17387 23.273849
#> 8   Tadpole Madtom      0      NaN        NA
#> 9     Yellow Perch     26 70.94935  6.816332