knitr::opts_chunk$set(echo = TRUE)
SDS100::download_data("gapminder_2007.Rda")
$\$
library(SDS100) # Get the gapminder data load("gapminder_2007.Rda") lifeExp <- gapminder_2007$lifeExp # Visualize the data
$\$
# We can use the sample(data_vec, n) to get a sample of length n: # How can we get x-bar from this sample in R?
$\$
Q: How can we get a full sampling distribution?
# we can repeat a process many times using the SDS100 do_it() function do_it(100) * { 2 + 3 }
$\$
# Let's create a sampling distribution in R # create a histogram of the sampling distribution # get the population mean, and the mean of the sampling distribution # is there bias? # add a vertical line to our sampling distribution histogram at mu
$\$
What happens to the sampling distribution as we change n? Experiment for n = 1, 5, 10, 20
$\$
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.