library(exampleci)
Everyone knows that the Titanic sank, but there is generally little sense of the magnitude of the disaster. Here I compare some guesses of the total number of passengers that died to actual mortality statistics.
The vector representation of guesses at the total number of passengers that died is:
guesses <- c(1,1,1)
I polled a total of r length(guesses)
people. Their mean guess was r mean(guesses)
.
The actual number of deaths can be extracted from the Titanic R sample dataset as follows:
actual <- apply(Titanic, c(4), sum)['No']
Giving a total of r actual
deaths.
Here is a plot of the guesses versus the actual value:
hist(guesses) abline(v=actual,col=3,lty=3)
This subject clearly requires further study.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.