OVERVIEW. Changing environments favors the evolution of variable phenotypes. Take for instance a plant. Its leaves will grow larger, thicker, or with more chemical defenses depending on sunlight, water availability and the threat of herbivory. These are examples of phenotypic plasticity - changes in the traits of organisms during their lifetime in response to environmental variability. Today, we will measure changes in morphological traits of tadpoles given a change in their environment.



Student learning outcomes:


References:


Materials:



1. Phenotypic plasticity and predation risk

Below are images of treefrog tadpoles - the first at rest and the second being consumed by a dragonfly larva. In terms of plasticity, what traits do you think might respond to predation risk?



To answer this question, Touchon and Warkentin (2008) carried out and experiment in which they grew treefrog tadpoles with and without the presence of a predator. After 10 days of treatment, they made morphological measurements and tested for phenotypic plasticity as depicted in the figure below.



A. Import the “tadpole” dataset to RStudio and explore it.

Let’s import and explore the “tadpole” data. For this, save the data file in your computer “as page source”. Note: “tail_fin_depth_mm” corresponds to “TD” in the figure above.

# importing the data
tadpole <- read.csv("tadpole.csv",header=TRUE)

# viewing the data
View(tadpole)


Questions:

  1. How many variables and what type of variables (e.g., categorical, continuous) “tadpole” has?
  2. Generate a testable hypothesis about the phenotypic plasticity of tadpoles in the presence of a dragonfly predator. Include the null hypothesis.
  3. Given the type of variables available, what type of data visualization is more appropriate (type of graph)?


B. Plot the data.

To plot the mean tail depth across treatment groups, we need to first get a summary of descriptive statistics. For this, we use the function summarySE() in package Rmisc. The first argument in this function is the dataframe and the subsequent arguments are the column name of the variable to be summarized (response variable) and the column name containing the grouping variable (explanatory variable).

# loading package Rmisc
library(Rmisc)

# estimating the summary stats
sum <- summarySE(tadpole,"tail_fin_depth_mm","treatment")

sum

# loading package ggplot2
library(ggplot2)

# plotting the mean tail depth across treatments
p1 <- ggplot(sum,aes(treatment,tail_fin_depth_mm)) +
  geom_bar(stat ="identity") +
  geom_errorbar(aes(ymin=tail_fin_depth_mm-sd,ymax=tail_fin_depth_mm+sd)) +
  xlab("Treatment") +
  ylab("Mean tail fin depth (mm)") +
  theme_classic(15)

p1


Questions:

  1. What are the response and explanatory variables?
  2. Do the data seems to support your hypothesis? Explain.


C. Test your hypothesis using a two-sample t-test.

To compare two group means, we use a two-sample Student’s t-test. So, let’s perform a t-test to determine whether there is a significant difference between the mean fin depth of the control and predator groups.


The test statistic, t, for the two-sample t-test is: \[ \begin{aligned} t=\frac{\overline{y}_1-\overline{y}_2}{SE_{\overline{y}_1-\overline{y}_2}}, \end{aligned} \] where \(\overline{y}_1\) and \(\overline{y}_2\) are the two group means and \(SE_{\overline{y}_1-\overline{y}_2}\) is the standard error of the difference between the two sample means for group 1 and group 2. Here, the t statistic is a ratio of the difference between the two groups and the difference within the two groups. The larger the t, the more difference there is between groups. For instance, a t score of 3 means that the groups are three times as different from each other as they are within each other.


The \(SE_{\overline{y}_1-\overline{y}_2}\) is defined as: \[ \begin{aligned} SE_{\overline{y}_1-\overline{y}_2}=\sqrt{s^2_p (\frac{1}{n_1} + \frac{1}{n_2})}, \end{aligned} \] where \(s^2_p\) is the pooled sample variance.


The sample variance \(s^2_p\) is defined as: \[ \begin{aligned} s_p^2=\frac{{df_1s^2_1+df_2s^2_2}}{df_1+df_2}, \end{aligned} \] where \(df_1\) and \(df_2\) are the degrees of freedom of groups 1 and 2, respectively, and \(s^2_1\) and \(s^2_2\) are the variances of groups 1 and 2, respectively.


The R function t.test() estimates a two-sample t-test. The first argument is the response variable and the second argument is the explanatory variable, both separated by “~”. We use $ to indicate “within”.

# two-sample t-test
t.test(tadpole$tail_fin_depth_mm~tadpole$treatment)


Hint: Remember that the p-value is the probability that the results from your analysis occurred by chance, given that the null hypothesis is true. P-values are from 0% to 100%. For example, a p-value of 5% (0.05) means that if you repeat the experiment, there is a 5% chance of obtaining the same results if the null hypothesis were true. As 5% is very low, we can be confident of rejecting the null hypothesis (results are not probably by chance).


Questions:

  1. Interpret the estimated t statistic.
  2. Do you reject the null hypothesis? Explain.
  3. Is predation risk a factor driving phenotypic plasticity in tadpoles?


Great Work!