This exercise introduces you to biological scaling.
We can evaluate how any variable changes (scales) with mass using this equation:
Variable = a * (body mass) ^ b where a is the scaling coefficient and b is the scaling exponent.
In most cases, we will be interested in b. Let’s explore what happens when we vary b.
## Warning: Some default values taken from current environment: a, b
Experiment with the above equation. Try b values that are above and below zero. How does the shape of the curve change in response to changes in b?
[Type your answer here.]
What relationship would we predict between a linear dimension and body weight? Body weight is a function of the volume that an organism fills. For the simple case of a cubic animal that remains exactly cubic as it grows, surface area increases in proportion to the length of a side squared, while volume increases in proportion to length of a side cubed.
What scaling exponent would you predict for surface area and length as mass changes?
[Type your answer here.]
Let’s explore these relationships.
## length surfaceArea mass
## 1 1 1 1
## 2 2 4 8
## 3 3 9 27
## 4 4 16 64
## 5 5 25 125
## 6 6 36 216
## [1] "Surface area = Blue, Length = Red"
Experiment by putting different numbers into the length column. What shape do the points follow? Notice that if you input big numbers, the graph can become difficult to read.
[Type your answer here.]
One way to make these data easier to work with is to perform a log transformation and plot log transformed data. We can do this two ways. Here, we’ll create three new variables - the log transformations of length, surfaceArea, and mass. In other exercise, we will bypass this step, and do the log transformation in the same step as we plot (or model) the data. The results are the same.
## [1] "Surface area = Blue, Length = Red"
What equation would best model these log-transformed data? Can you explain why? (Hint: try log transforming the original equation).
[Type your answer here.]
Now, let’s try to fit a model to the log-transformed data.
## (Intercept) logMass
## -1.813e-16 6.667e-01
R returns two numbers: the y-intercept and the slope (which it labels logMass). Does the output from this model match your predictions from above?
[Type your answer here.]
Now, in the chunk below, perform the same analysis for length.
## (Intercept) logMass
## -9.065e-17 3.333e-01
Does the output from this model match your predictions from above?
[Type your answer here.]
Finally, let’s put all of this together into a plot.