Cesar Ramos
2020
For more details on authoring R presentations please visit https://support.rstudio.com/hc/en-us/articles/200486468.
summary(cars)
speed dist
Min. : 4.0 Min. : 2.00
1st Qu.:12.0 1st Qu.: 26.00
Median :15.0 Median : 36.00
Mean :15.4 Mean : 42.98
3rd Qu.:19.0 3rd Qu.: 56.00
Max. :25.0 Max. :120.00
To see an extreme case of non-independent events, consider our example of drawing five beads at random without replacement:
beads = rep(c("red", "blue"), times = c(2,3))
x = sample(beads, 5)
If you have to guess the color of the first bead, you will predict blue since blue has a 60% chance. But if I show you the result of the last four outcomes:
# Donde x es la muestra tomada de la urna donde se extrayeron 5 bolos en ese orden.
x
[1] "blue" "red" "blue" "red" "blue"
x[2:5]
[1] "red" "blue" "red" "blue"