12  Template chapter

Last modified on 28. December 2025 at 17:34:59

“A quote.” — Dan Meyer

12.1 General background

R Code [show / hide]
set.seed(20251226) #20251226
cor_high_tbl <- tibble(weight = abs(rnorm(5, 3, 4)),
                       jumplength = 10 + 1 * weight + rnorm(5, 0, 4)) |> 
  mutate(sweight = weight - mean(weight),
         sjump = jumplength - mean(jumplength),
         ss_xy = sweight * sjump,
         ss_x = sweight^2,
         ss_y = sjump^2,
         sign_xy = ifelse(sign(ss_xy) == -1, "\U2012", "+"))
set.seed(202511)

sum(cor_high_tbl$ss_x)
[1] 33.95848
R Code [show / hide]
sum(cor_high_tbl$ss_x) |> sqrt()
[1] 5.82739
R Code [show / hide]
sum(cor_high_tbl$ss_y)
[1] 47.94158
R Code [show / hide]
sum(cor_high_tbl$ss_y) |> sqrt()
[1] 6.923986
R Code [show / hide]
sum(cor_high_tbl$ss_xy)
[1] 33.21142
R Code [show / hide]
cor(cor_high_tbl$weight, cor_high_tbl$jumplength)
[1] 0.8231087
R Code [show / hide]
cov(cor_high_tbl$weight, cor_high_tbl$jumplength)
[1] 8.302855
R Code [show / hide]
lm_fit <- lm(jumplength ~ weight, data = cor_high_tbl)
R Code [show / hide]
vcov(lm_fit)
            (Intercept)     weight
(Intercept)   3.4921715 -0.6111907
weight       -0.6111907  0.1517616
Figure 12.1: foo
Figure 12.2: foo
Figure 12.3: foo
Figure 12.4: foo

12.2 Theoretical background

12.3 R packages used

12.4 Data

12.5 Alternatives

Further tutorials and R packages on XXX

12.6 Glossary

term

what does it mean.

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

  • itemize with max. 5-6 words

12.8 Summary

References