Session Ready
Exercise

Optimal temperature

Tadpoles can swim in both cold and warm water. They are fastest somewhere in-between. Swimming speeds in different temperature water are recorded in the Tadpoles dataset. vmax is the maximum velocity reached by a tadpole swimming in a channel (called a "race"). rtemp is the temperature of the water in the race.

The relationship between vmax and rtemp is not a straight line. Still, there are a variety of ways that the curved nature of the relationship can be captured by a linear model architecture. For instance, you can add a new explanatory term to the model, I(rtemp^2), which lm() will use to make the relationship between vmax and rtemp follow a parabolic (or "U-shaped") form. A parabola has a maximum (or minimum) and so can be an appropriate model for a quantity whose maximum value is of interest.

The biologists studying the tadpoles were not only interested in the optimal temperature for tadpole swimming. They wanted to know whether tadpoles raised in cold water and those raised in warm water would swim fastest in different temperatures. One hypothesis is that tadpoles are habituated to the temperature of water in which they are raised, and swim fastest in temperatures near that.

# A parabolic model of vmax
model_1 <- lm(vmax ~ rtemp + I(rtemp^2) + group, 
              data = Tadpoles)

# Graph it
fmodel(model_1, ~ rtemp + group)

model_1 above shows how to model a parabolic relationship. It also includes group, which indicates whether the tadpole was raised in warm or cold water.

Create model_2 in the console by putting in an interaction between group and rtemp. Then, graph model_2 using fmodel(). Which of the following statements concerning model_1 and model_2 are true?

  1. In both models, the two groups, c and w, have maximum velocity at the same temperature.
  2. In model_2 the maximum occurs at different temperatures for the different groups.
  3. The effect size of group does not vary with rtemp in the first model.
  4. The effect size of group varies with rtemp in the second model.
Instructions
50 XP
Possible Answers