The aim of these exercises is to improve your ability to deal with multi-predictor linear models where we have a single continuous response and the two or more predictors are all continuous or a mixture of continuous and categorical.

A

Let’s continue with the Martello et al. (2022) example from Chapter 7 assessing whether dietary supplements improve the perceived health of dogs with osteoarthritis. The model we focused on at the end of that exercise was one modelling the pain index of dogs after 60 days as a function of whether they received dietary supplements or a placebo and the sex of the dog. The dogs unavoidably varied in body weight, ranging from 14-47 kg. To partly account for this, the authors adjusted the doses to a constant amount per kg of body weight. However, you can probably think of a range of ways in which weight might affect osteoarthritis. The model using treatment and sex fitted the data fairly well, with r2 around 0.6. We detected a strong treatment effect, but it is possible that if we reduced background noise, we might see sex-specific responses and we’d also get a more precise estimate of the effects.

Think about the steps you’d take to see if it would be helpful to include body weight in the model, then go back to the data and run the analysis.

df <- read.csv("../data/martello.csv")

B

La Rosa and Conner (2017) examined effects of several floral traits on fitness components of milkweeds, Asclepias spp. The fitness components were male and female pollination success and female reproductive success.

In the paper, their analysis focused on 6 predictors, They measured six floral traits, although one of them, hood height, was not relevant for Asclepias viridiflora, which was the species with the largest sample size:

Their Figure 2 shows what these measurements represent on flowers.

The data are available from Dryad here.

Fitness component estimates were relativized by dividing by the mean, and the traits were standardized to a mean of zero and standard deviation of one.

Start by looking at A. syriaca, then for comparison, look at how these floral traits affect A. viridiflora

First look at the removals per flower

  • What checks should you do before assessing the predictors’ effects?

  • If you’re happy with your pre-flight checks, fit the model and make some conclusions about the effects of each predictor, including any notes of caution

Run through same sequence for the other two life-history traits

  • What would you need to check in doing analyses on three different fitness components as response variables?

  • What do you conclude about the floral traits’ influence on fitness components of this species?

Now have a look at the data for the more common species Asclepias viridiflora

  • What do you conclude about the role of floral traits in these two species?

  • Is there anything you’d be cautious about in making this comparison?

C

Recall the sengi example (Kaufman et al. (2013)) from Chapter 5 (or go back and look at it ;-)) where we looked at the relationship between brain mass and body mass in small insectivore species. Now we will look at how this relationship varies between families of insectivores, including whether sengis are different from the rest. There are 3 groups of insectivores, sengis and closely (afrotherian) and more distantly (laurasiatherian) species, and the research question is about where sengis fit. We can frame this as 2 or 3 questions.

  1. Does the new species (udzugwensis) fit within the pattern of other sengi?

  2. Are sengi different from the other small insectivores in their brain size?

    1. sengi vs all others, or

    2. sengi vs closely-related vs distantly related insectivores

Get started by loading the kaufman data.

df <- read.csv("../data/kaufman.csv")
head(df,10)
##            family        genus   species bodymass brainmass        relation
## 1  Solenodontidae    Solenodon paradoxus    672.0      4723 laurasiatherian
## 2      Tenrecidae       Tenrec ecaudatus    852.0      2588     afrotherian
## 3      Tenrecidae      Setifer   setosus    237.0      1516     afrotherian
## 4      Tenrecidae Hemicentetes  semispin    116.0       839     afrotherian
## 5      Tenrecidae     Echinops  telfairi     87.5       623     afrotherian
## 6      Tenrecidae  Oryzorictes talpoides     44.2       580     afrotherian
## 7      Tenrecidae    Microgale    cowani     15.2       420     afrotherian
## 8      Tenrecidae    Limnogale  mergulus     92.0      1150     afrotherian
## 9      Tenrecidae    Microgale   dobsoni     31.9       557     afrotherian
## 10     Tenrecidae    Microgale  talazaci     48.2       766     afrotherian
##            relation2
## 1  other insectivore
## 2  other insectivore
## 3  other insectivore
## 4  other insectivore
## 5  other insectivore
## 6  other insectivore
## 7  other insectivore
## 8  other insectivore
## 9  other insectivore
## 10 other insectivore

In Chapter 5, you should have decided that log-transforming both variables was sensible, so lets also start by defining new variables logbrain and logbody. That will make the coding tidier, without having to log things repeatedly.

df$logbrain <- log(df$brainmass)
df$logbody <- log(df$bodymass)

For the first question, cast your mind back to Chapter 6. How would you decide whether the new species is unusual?

Now lets compare sengis to the other insectivores. Use three groups for comparison (sengi, Afrotherian and Laurasiatherian). These groups are defined in the variable relation

** You could make this comparison in two ways:

  • fit a linear model including the groups as a categorical factor and log body mass as a covariate, i.e. an analysis of covariance
  • look at the patterns in the residuals for the relationship between log-brain and log-body

**Before you start, are there any things to check in the original data, linked to the assumptions of the linear model you’ll fit?

Analysis of covariance

Outline the steps you’ll take

Run the analysis

Use residuals from a regression of all data and compare residuals between groups

D

We’ll return to the elephant seal example in the study by Le Boeuf et al. (2000) and see whether body weight plays any role in foraging. In Chapter 5, you should have noticed that while the focus of the initial analysis was on the relationship between time spend on the foraging grounds and distance travelled, the authors recorded weight on departure for each animal. Your exploratory data analysis should have shown a relationship between body weight and the original predictor and response variables. Now try and make some sense of what’s going on here.

Think about how body mass might influence distance travelled and how it might contribute to time on foraging areas

How will you assess whether including body weight as a second predictor helps us understand feeding time better?

#Get the data file back
df <- read.csv("../data/leboeuf.csv")
head(df,10)
##    male departwt distance FFAduration durationto durationfrom
## 1   Pop       NA      534          31         18           11
## 2   Alt      973      755          89          9            8
## 3   Pro      977     1210          77         12           18
## 4   Hal     1121       NA          NA         NA           NA
## 5   Blu       NA     1297          76         19           25
## 6   Dua      996     1487          68         18           23
## 7   Rov     1100     2073          69         29           25
## 8   Ric     1068     2181          46         21           42
## 9   Ori     1097       NA          NA         NA           NA
## 10  Jer     1199       NA          NA         NA           NA

Fit the appropriate model to the data, interpret the results, and explain whether body weight helps us.

Is there anything else you might look at?

References

Kaufman, Jason A., Gregory H. Turner, Patricia A. Holroyd, Francesco Rovero, and Ari Grossman. 2013. “Brain Volume of the Newly-Discovered Species Rhynchocyon Udzungwensis (Mammalia: Afrotheria: Macroscelidea): Implications for Encephalization in Sengis.” Edited by Andrew Iwaniuk. PLoS ONE 8 (3): e58667. https://doi.org/f4qwz3.
La Rosa, Raffica J., and Jeffrey K. Conner. 2017. “Floral Function: Effects of Traits on Pollinators, Male and Female Pollination Success, and Female Fitness Across Three Species of Milkweeds ( Asclepias ).” American Journal of Botany 104 (1): 150–60. https://doi.org/gr2r9p.
Le Boeuf, B. J., D. E. Crocker, D. P. Costa, S. B. Blackwell, P. M. Webb, and D. S. Houser. 2000. “Foraging Ecology of Northern Elephant Seals.” Ecological Monographs 70 (3): 353–82. https://doi.org/fj9rqc.
Martello, Elisa, Mauro Bigliati, Raffaella Adami, Elena Biasibetti, Donal Bisanzio, Giorgia Meineri, and Natascia Bruni. 2022. “Efficacy of a Dietary Supplement in Dogs with Osteoarthritis: A Randomized Placebo-Controlled, Double-Blind Clinical Trial.” Edited by Angel Abuelo. PLOS ONE 17 (2): e0263971. https://doi.org/gr9cmt.