Exercise

# Normal-Normal priors

Researchers developed a test to evaluate the impact of sleep deprivation on reaction time. For subject \(i\), let \(Y\)_{i} be the *change* in reaction time (in ms) after 3 sleep deprived nights. Of course, people react differently to sleep deprivation. It's reasonable to assume that \(Y\)_{i} are Normally distributed around some *average* \(m\) with *standard deviation* \(s\): \(Y\)_{i} \(\sim N(m, s^2)\).

In the first step of your Bayesian analysis, you'll simulate the following prior models for parameters \(m\) and \(s\): \(m \sim N(50, 25^2)\) and \(s \sim Unif(0, 200)\). This requires the `rnorm(n, mean, sd)`

and `runif(n, min, max)`

functions.

Instructions

**100 XP**

- Use
`rnorm(n, mean, sd)`

to sample 10,000 draws from the \(m\) prior. Assign the output to`prior_m`

. - Use
`runif(n, min, max)`

to sample 10,000 draws from the \(s\) prior. Assign the output to`prior_s`

. - After storing these results in the
`samples`

data frame, construct a density plot of the`prior_m`

samples and a density plot of the`prior_s`

samples.