5. Sampling: Practical 5b
Introduction
Objectives
Learn how to do the following in R
- construct and interpret a sampling distribution of a statistic by applying random sampling from a population
- the properties of the sampling distribution of a mean as well as a proportion:
- the larger the sample size, the more the distribution of sample means approaches the normal distribution
- the true mean is better estimated with increasing sample size
- the standard deviation among sampling means equals the population standard deviation divided by the square root of the sample size
Instruction
- Read through the text below
- Execute code-examples and compare your results with what is explained in the text
- Make the exercises
- Time: 120 minutes
Introduction
In a previous practical we have studied different distributions (e.g. the normal distribution, and the binomial distribution). This practical will help you understand the relation between populations that follow such distributions and the samples you can draw from them.
To evaluate the effects of sampling, it is nice to have observations from the population (as was the case in the previous practical) or to know the theoretical parameters, because these can be used for comparison with the sampling statistics (the estimates of the theoretical parameters).
In this practical we will use cases where we know the theoretical parameters. We will make use of the functions that generate random data, like rbinom()
and rnorm()
.
Let's start with one random dataset that we call z. We assume that z is a complete population. Create z with the following commands:
set.seed(85)
x1 <- rnorm(10000, 0, 100)
x2 <- rnorm(10000, 300, 65)
z <- c(x1, x2)