8 Extra Tasks


This data set includes data for 39 species of mammals distributed over 13 orders. The data were used for analyzing the relationship between constitutional and ecological factors and sleeping in mammals.

Two sleep variables (dreaming and non dreaming) were recorded. Variables such as life span, body weight, brain weight and gestation time were evaluated.

Ecological variables such as severity of predation, safety of sleeping place and overall danger were inferred from field observations in the literature.

The data to be analyzed are saved in a .csv file called mammals.csv which can be imported using the following code.

mammals <- read.csv(url("https://raw.githubusercontent.com/Glasgow-Stats-L1-L2/S1Z_Lab3/main/mammals.csv"))

8.1 Tasks


Repeat Exercises 9-12 again (written below as 1. - 4.) with two variables of your choosing from the mammals data set. e.g. you could examine the relationship between a species' brain weight (\(x\)) and the total amount of sleep they get (\(y\)). But it's up to you, as long as you have the explanatory and response variables in a way round that makes sense and they are both numeric. You may wish to consider an appropriate transformation of the data (e.g. log()), particularly for any variables with a small number of large outliers.


  1. Produce a scatterplot of the variables. Does there seem to be a linear relationship?


  1. Fit a suitable linear model to the variables.


  1. What is the equation of the fitted regression line?


  1. Check the model assumptions. Do they all hold?