Allometry of Kootenay Lake Rainbow Trout

Here we plot relationships between Rainbow Trout metrics and fit a linear model to estimate the allometric ralationships for:

Weight vs Length

library(ggplot2)
library(broom)

fish <- kootlake::fish

is.na(fish$Weight[is.na(fish$Weight) | fish$Weight == 0]) <- TRUE

WL_mod <- lm(log(Weight) ~ log(Length), data = fish)
WL_data <- data.frame(Length = seq(min(fish$Length), max(fish$Length), length.out = 30L))
WL_data$Weight <- exp(predict(WL_mod, newdata = WL_data))

ggplot(data = fish, aes(x = Length, y = Weight)) +
  geom_point(alpha = 0.4, size = 1) +
  geom_line(data = WL_data, col = "blue") +
  expand_limits(y = 0)


tidy(WL_mod, conf.int = TRUE)
#> # A tibble: 2 × 7
#>   term        estimate std.error statistic p.value conf.low conf.high
#>   <chr>          <dbl>     <dbl>     <dbl>   <dbl>    <dbl>     <dbl>
#> 1 (Intercept)   -18.4     0.128      -144.       0   -18.7     -18.2 
#> 2 log(Length)     3.03    0.0200      151.       0     2.99      3.07

Fecundity vs Length

FL_mod <- lm(log(Fecundity) ~ log(Length), data = fish)

FL_data <- data.frame(Length = seq(min(fish$Length), max(fish$Length), length.out = 30L))
FL_data$Fecundity <- exp(predict(FL_mod, newdata = FL_data))

ggplot(data = fish, aes(x = Length, y = Fecundity)) +
  geom_point(alpha = 0.5, size = 1) +
  geom_line(data = FL_data, col = "blue") +
  expand_limits(y = 0)


tidy(FL_mod, conf.int = TRUE)
#> # A tibble: 2 × 7
#>   term        estimate std.error statistic  p.value conf.low conf.high
#>   <chr>          <dbl>     <dbl>     <dbl>    <dbl>    <dbl>     <dbl>
#> 1 (Intercept)   -12.1      0.875     -13.9 3.32e-20   -13.9     -10.4 
#> 2 log(Length)     3.17     0.135      23.5 1.25e-31     2.90      3.44

Fecundity vs Weight

FW_mod <- lm(log(Fecundity) ~ log(Weight), data = fish)

FW_data <- data.frame(Weight = seq(min(fish$Weight, na.rm = TRUE), max(fish$Weight, na.rm = TRUE), length.out = 30L))
FW_data$Fecundity <- exp(predict(FW_mod, newdata = FW_data))

ggplot(data = fish, aes(x = Weight, y = Fecundity)) +
  geom_point(alpha = 0.5, size = 1) +
  geom_line(data = FW_data, col = "blue") +
  expand_limits(y = 0)


tidy(FW_mod, conf.int = TRUE)
#> # A tibble: 2 × 7
#>   term        estimate std.error statistic  p.value conf.low conf.high
#>   <chr>          <dbl>     <dbl>     <dbl>    <dbl>    <dbl>     <dbl>
#> 1 (Intercept)    7.11     0.0577     123.  5.58e-50    6.99       7.23
#> 2 log(Weight)    0.955    0.0399      23.9 4.16e-24    0.874      1.04