5  Blood meal of fleas

Last modified on 03. September 2026 at 12:26:24

“A quote.” — Dan Meyer

5.1 General background

5.2 Theoretical background

Figure 5.1: foo

5.3 R packages used

5.4 Data

5.4.1 Linear

R Code [show / hide]
weight_bloodmeal_n14_tbl <- tibble(x = c(1.2, 2.4, 3.5, 3.9, 2.8, 1.8, 3.1, 
                                       5.1, 4.6, 5.5, 6.2, 7.1, 6.5, 7.6),
                                 y = 2 + 1.2*x + rnorm(14, 0, 2)) |>
  mutate_all(round, 1) |> 
  rename(bloodmeal = x, weight = y)
Table 5.1: foo.
bloodmeal weight
1.2 6.5
2.4 3.6
3.5 6.6
3.9 5.4
2.8 7.0
1.8 3.4
3.1 6.0
5.1 6.2
4.6 7.1
5.5 9.6
6.2 10.3
7.1 12.4
6.5 10.0
7.6 13.5
Figure 5.2: Relationship between blood meal and body weight.

5.4.2 Non-linear

\[ y = -0.0365*x^4 + 0.9348*x^3 - 7.396*x^2 + 18.876*x + 12.353 \]

R Code [show / hide]
jump_bloodmeal_n21_tbl <- tibble(x = c(1.2, 2.4, 3.5, 3.9, 2.8, 1.8, 3.1, 
                                       5.1, 4.6, 5.5, 6.2, 7.1, 6.5, 7.6,
                                       8.6, 9.3, 10.5, 9.8, 11.8, 11.1, 10.2),
                                 y = -0.0365*x^4 + 0.9348*x^3 - 7.396*x^2 + 18.876*x + 12.353 + rnorm(21, 0, 3)) |>
  mutate_all(round, 1) |> 
  rename(bloodmeal = x, jumplength = y)
Table 5.2: foo.
bloodmeal jumplength
1.2 28.4
2.4 22.7
3.5 20.6
3.9 25.7
2.8 26.8
1.8 28.6
3.1 22.8
5.1 17.4
4.6 18.1
5.5 15.0
6.2 10.9
7.1 20.0
6.5 10.2
7.6 15.5
8.6 21.5
9.3 26.3
10.5 33.8
9.8 26.7
11.8 32.8
11.1 36.0
10.2 29.2
Figure 5.3: Relationship between blood meal and jumping length.

5.4.3 Not independent

R Code [show / hide]
library(mvtnorm)

sigma <- matrix(c(4,2,2,3), ncol=2)
x <- rmvnorm(n = 21, mean=c(1,2), sigma=sigma) |> 
  as_tibble() |> 
  rename(weight = V1, bodylength = V2)
Warning: The `x` argument of `as_tibble.matrix()` must have unique column names if
`.name_repair` is omitted as of tibble 2.0.0.
ℹ Using compatibility `.name_repair`.
R Code [show / hide]
colMeans(x)
    weight bodylength 
 0.6196407  1.8279247 
R Code [show / hide]
var(x)
             weight bodylength
weight     6.432148   2.761048
bodylength 2.761048   4.428079
Figure 5.4: foo (A) foo (B) foo

5.5 Data availability

The data is available as txt-Files under https://github.com/jkruppa/biodatascience.

5.6 Alternatives

Further tutorials and R packages on XXX

5.7 Glossary

term

what does it mean.

5.8 The meaning of “Models of Reality” in this chapter.

  • itemize with max. 5-6 words

5.9 Summary

References