9  Explorative data analysis

Last modified on 26. December 2025 at 19:09:05

“A quote.” — Dan Meyer

9.1 General background

9.2 Theoretical background

Figure 9.1: foo

9.3 R packages used

9.4 Data

R Code [show / hide]
jump_dog_tbl <- read_delim("data/jump_fleas.txt") |> 
  select(host, jumplength) |> 
  filter(host == "dog") 
R Code [show / hide]
jump_dog_tbl
# A tibble: 7 × 2
  host  jumplength
  <chr>      <dbl>
1 dog         21.8
2 dog         28.4
3 dog         34.8
4 dog         34.4
5 dog         38.8
6 dog         31.4
7 dog         41.4
R Code [show / hide]
sem <- \(x) sd(x)/sqrt(length(x))

sem(jump_dog_tbl$jumplength)
[1] 2.480887
R Code [show / hide]
sem <- \(x) sqrt(var(x)/length(x))

sem(jump_dog_tbl$jumplength)
[1] 2.480887
R Code [show / hide]
sem <- \(x) sqrt(sum((x-mean(x))^2)/(length(x)*(length(x)-1)))

sem(jump_dog_tbl$jumplength)
[1] 2.480887
R Code [show / hide]
sem <- \(x) sqrt(sum((x-mean(x))^2))/sqrt(length(x)*(length(x)-1))

sem(jump_dog_tbl$jumplength)
[1] 2.480887

\[ SE = \cfrac{s}{\sqrt{n}} \] \[ SE = \sqrt{\cfrac{s^2}{n}} \]

\[ SE = \cfrac{\sqrt{SS}}{n};\; \mbox{for large n} \]

\[ SE = \sqrt{\cfrac{\sum_{i=1}^n\cfrac{(y_i - \bar{y})^2}{n-1}}{n}} = \sqrt{\cfrac{\sum_{i=1}^n (y_i - \bar{y})^2}{n\cdot(n-1)}} = \cfrac{\sqrt{SS}}{\sqrt{n\cdot(n-1)}} \]

With n is large

\[ SE = \cfrac{\sqrt{\sum_{i=1}^n (y_i - \bar{y})^2}}{\sqrt{n^2}} = \cfrac{\sqrt{\sum_{i=1}^n (y_i - \bar{y})^2}}{n} = \cfrac{\sqrt{SS}}{n} \]

R Code [show / hide]
jump_dog_tbl |> 
  group_by(host) |> 
  summarise(mean(jumplength), var(jumplength), sd(jumplength), sem(jumplength)) |> 
  mutate_if(is.numeric, round, 2)
# A tibble: 1 × 5
  host  `mean(jumplength)` `var(jumplength)` `sd(jumplength)` `sem(jumplength)`
  <chr>              <dbl>             <dbl>            <dbl>             <dbl>
1 dog                 33.0              43.1             6.56              2.48

9.5 Mean

Figure 9.2: foo
Figure 9.3: foo
Figure 9.4: foo
Figure 9.5: foo
Figure 9.6: foo
Figure 9.7: foo
Figure 9.8: foo

9.6 Alternatives

Further tutorials and R packages on XXX

9.7 Glossary

term

what does it mean.

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

  • itemize with max. 5-6 words

9.9 Summary

References