# Sampling Distributions

## Introduction

The notion of a sampling distribution is one of the most important concepts taught in introductory statistics because it lays down the foundations and motivates the use of hypothesis testing. For instance, in introductory statistics courses, it is common to lear the $t$-test for comparing two population means. The $t$ statistic we learn is given by the equation ***** and it is common knowledge (among statisticians and quantitative methodologists with several years of experience at least) that this statistic follows a $t$ distribution with $n - 1$ degrees of freedom. Importantly two questions arise. Importantly notice the following:

```
RS <- function(nDraws)
{
r <- 1.85
draws <- NULL
nTotal <- nAccept <- 0
repeat
{
nTotal <- nTotal + 1
x <- rnorm(1, 0, sqrt(0.5))
rgx <- r*dnorm(x, 0, sqrt(0.5))
kx <- Kx(x)
if(runif(1, 0, rgx) < kx) {
draws <- c(draws, x)
nAccept <- nAccept + 1 }
if(length(draws) == nDraws) break
}
```

```
plot(rnorm(100))
```