You are on page 1of 1

QMM: Exercise Sheet 10 - Multilevel analysis

Fabien Baeriswyl, Jérôme Reboulleau, Tom Ruszkiewicz

Exercise 1. For this exercise, use the file MNRadonUranium.csv, which is the data case that you covered in the
class about radon measurements except that we add a new variable, namely the uranium level by county.
a) Fit a model using floor and uranium as predictors and by letting the intercept vary by county.
b) Comment on the model’s coefficients.
c) Determine the fixed and the random effects.
d) Fit a model where there is an intercept, where floor and uranium are predictors, floor and uranium interacts
and where the intercept and the slope (for floor) are varying by county.
e) Determine the fitted regression equation for county 85.

Exercise 2. This exercise is designed to be an introduction provided by ggplot2 visualisation. Load the dataset
dragons.csv that repertoriates the test score to an intelligence test on dragons, their respective body length, the
mountain where they live and the site in the particular mountain where they live.
a) First, plot the relation between the body length and the test score and emphasize the linear relation. What do
you observe?
b) Plot the same relation as before, but emphasise the points by mountain range.
c) Produce scatterplots of the relationship between body length and test score by mountain range.
d) Scale and center the bodyLength variable. Then, fit a multilevel model and allow the intercept to be random.
What do you observe?
e) Fit a multilevel model and allow both the intercept to be random and the body length effect to also vary across
mountain ranges.
f) Plot the regression lines from your model in e) on your scatterplots of c).

You might also like