Introduction

   In the early 19th century Charles Darwin studied finches in the Galapagos Islands. His observations of the diverse finches, of which each species seemed to be specially adapted to its environment, likely contributed to his ideas about natural selection and evolution. Darwin’s theory of evolution is now widely accepted, however further study and exploration continues. Darwin’s finches remain an especially important subject of study, particularly their beak size and shape, which adapt quickly to environmental changes (Grant 2017).

   The data set to be explored in this paper contains beak measurements taken by Peter and Rosemary Grant in 1975 and 2012 of two species of finches: Geospiza fortis, also known as the medium ground finch, and Geospiza scandens, or the common cactus finch. The data includes columns for beak length measurements and beak depth measurements for each species, however, for simplicity I will focus only on beak depth for the outcome variable of this paper.

   Birds of both G. fortis and G. scandens species have an average lifespan of about 5-7 years, although some have been recorded to live at least 12 years in the wild (Gibbs and Grant, 1987, p. 803-804). Since this data is collected 37 years apart, the observations can safely be considered independent. The variables of interest are as follows:

Outcome Variable

  • Beak depth: The distance, in millimeters, between the top and bottom of the beak.

Predictor Variables

  • Year:
    • 1975 Group
    • 2012 Group
  • Species:
    • G. fortis
    • G. scandens

G. fortis. (left) and G. scandens (right) | Source: Peter R. Grant

I will use one-way and two-way ANOVA to analyze the data and to find out which variables affect beak depth, and what interactions, if any, exist.

data1975 <- read_csv("finch_beaks_1975.csv")

data2012 <- read_csv("finch_beaks_2012.csv")

beak_depth <- c(data1975$bdepth, data2012$bdepth)

year_group <- as.factor(c(rep(1975, 403), rep(2012, 248)))

species_group <- as.factor(c(rep("Fortis", 316), rep("Scandens", 87), rep("Fortis", 121), rep("Scandens", 127)))

treatment_group <- as.factor(c(rep("Fortis-1975", 316), rep("Scandens-1975", 87), rep("Fortis-2012", 121), rep("Scandens-2012", 127)))

treamtent_groups_tibble <- tibble(treatment_group, beak_depth)

Summary Statistics

Summary Data for Each Treatment Group

summary_stats <- treamtent_groups_tibble %>%
                    group_by('Treament Group'=treatment_group) %>%
                    summarise(mean = mean(beak_depth), sd = sd(beak_depth), min=min(beak_depth), median = median(beak_depth), max = max(beak_depth), n = n()) 

summary_stats
## # A tibble: 4 x 7
##   `Treament Group`  mean    sd   min median   max     n
##   <fct>            <dbl> <dbl> <dbl>  <dbl> <dbl> <int>
## 1 Fortis-1975       9.17 0.737   7.5    9.2  11.0   316
## 2 Fortis-2012       8.61 0.733   7.2    8.5  11.1   121
## 3 Scandens-1975     8.96 0.567   7.9    9    10.4    87
## 4 Scandens-2012     9.19 0.669   7.7    9.2  11     127
  • The mean (standard deviation) beak depth for the G. fortis-1975 sample is 9.17 (0.74)mm. The median beak depth for the G. fortis-1975 sample is 9.2mm.

  • The mean (standard deviation) beak depth for the G. fortis-2012 sample is 8.61 (0.73)mm. The median beak depth for the G. fortis-2012 sample is 8.5mm.

  • The mean (standard deviation) beak depth for the G. scandens-1975 sample is 8.96 (0.57)mm. The median beak depth for the G. scandens-1975 sample is 9mm.

  • The mean (standard deviation) beak depth for the G. scandens-2012 sample is 9.19 (0.67)mm. The median beak depth for the G. scandens-2012 sample is 9.2mm.

Treatment Groups Boxplots

treamtent_groups_tibble %>% 
  ggplot() +
    geom_boxplot(aes(factor(treatment_group), beak_depth, group = treatment_group)) + 
    xlab("Treatment Group") + 
    ylab("Beak depth (mm)") +
    theme_bw() 

Treatment Groups Histograms

ggplot(data = treamtent_groups_tibble, mapping = aes(x = beak_depth)) +
  geom_histogram(binwidth = 0.175, color = "black", fill = "lightgray") +
  facet_wrap(~ treatment_group, nrow = 2) +
  xlab("Beak depth (mm)") +
  theme_bw() 

One-Way ANOVA: Year Group Variable

year_tibble <- tibble(beak_depth, year_group)
year_tibble_results <- aov(beak_depth ~ year_group, data = year_tibble)
year_tibble_table <- summary(aov(beak_depth ~ year_group, data = year_tibble))

pander(year_tibble_table, style='rmarkdown') 
Analysis of Variance Model
  Df Sum Sq Mean Sq F value Pr(>F)
year_group 1 7.644 7.644 14.43 0.0001587
Residuals 649 343.7 0.5295 NA NA

Hypothesis Test

Hypotheses

   \(H_0: \ \mu_\mbox{1975} = \mu_\mbox{2012}\)
   \(H_1:\) at least one is different

Test Statistic

   \(F_0 = 14.435\).

p-value

   \(p = 0.0002\).

Rejection Region

   Reject if \(p < \alpha\), where \(\alpha=0.05\).

Conclusion and Interpretation

   Reject \(H_0\). There is sufficient evidence to suggest that beak depth is different in 1975 and 2012.

Posthoc Test: Tukey’s W

year_tukey <- summary(glht(year_tibble_results, linfct = mcp(year_group = "Tukey")))

#year_tukey
Comparison p-value Significant?
1975 vs. 2012 0.000159 Yes

Tukey’s W posthoc test supports significance for the 1975 group compared with the 2012 group.

One-Way ANOVA: Species Group Variable

species_tibble <- tibble(beak_depth, species_group)
species_tibble_results <- aov(beak_depth ~ species_group, data = species_tibble)
species_tibble_table <- summary(aov(beak_depth ~ species_group, data = species_tibble))

pander(species_tibble_table, style='rmarkdown') 
Analysis of Variance Model
  Df Sum Sq Mean Sq F value Pr(>F)
species_group 1 0.9057 0.9057 1.677 0.1957
Residuals 649 350.4 0.5399 NA NA

Hypothesis Test

Hypotheses

   \(H_0: \ \mu_f = \mu_s\)
   \(H_1:\) at least one is different

Test Statistic

   \(F_0 = 1.677\).

p-value

   \(p = 0.1957\).

Rejection Region

   Reject if \(p < \alpha\), where \(\alpha=0.05\).

Conclusion and Interpretation

   Fail to reject \(H_0\). There is not sufficient evidence to suggest that beak depth is different for the G. fortis and G. scandens species.

Two-Way ANOVA

two_way_tibble <- tibble(species_group, year_group, beak_depth)

two_way_tibble_results <- aov(beak_depth ~ species_group*year_group, data = two_way_tibble)
two_way_tibble_table <- summary(two_way_tibble_results)

pander(two_way_tibble_table, style='rmarkdown') 
Analysis of Variance Model
  Df Sum Sq Mean Sq F value Pr(>F)
species_group 1 0.9057 0.9057 1.833 0.1763
year_group 1 10.31 10.31 20.86 5.924e-06
species_group:year_group 1 20.39 20.39 41.27 2.57e-10
Residuals 647 319.7 0.4941 NA NA

Hypothesis test for interaction

Hypotheses

   \(H_0:\) There is not an interaction between species and year
   \(H_1:\) There is an interaction between species and year

Test Statistic

   \(F_0 = 41.27\).

p-value

   \(p < 0.0001\).

Rejection Region

   Reject if \(p < \alpha\), where \(\alpha=0.05\).

Conclusion and Interpretation

   Reject \(H_0\). There is sufficient evidence to suggest that there is an interaction between species and year.

Interaction plot

interaction.plot(x.factor     = two_way_tibble$year_group,
                 trace.factor = two_way_tibble$species_group,
                 response     = two_way_tibble$beak_depth,
                 fun = mean,
                 type="b",
                 col=c("blue", "green"),
                 pch=c(19, 17),
                 fixed=TRUE,
                 xlab = "Year Group",
                 ylab = "Beak Depth (mm)",
                 trace.label = "Species",
                 leg.bty = "o")

   The lines intersect, clearly showing an interaction between species and year group.

Graphical assessment

almost_sas(two_way_tibble_results)

   The variances seem to be approximately equal (top left graph), satisfying the equal variance assumption. In the top right, the Q-Q plot shows that the data follows an approximate 45 degree line, satisfying the normality assumption. The histogram, in the bottom right corner, has a roughly normal shape centered at 0. The bottom left graph shows that density also has a normal shape.

Conclusion

   The two-way ANOVA hypothesis test for interaction suggests an interaction between species and year group with p-value \(p < 0.0001\). This suggests that the combination of species type and the year of sampling has an affect on beak depth. This may be due to the two species adapting differently to environmental changes over time. This interaction is illustrated by the crossed lines of the profile plot. The ANOVA assumptions of normality and homogeneity of variance are both satisfied, so it seems that ANOVA was appropriate to use with this data.

References

Grant, P. R. (2017), Ecology and Evolution of Darwin’s Finches, Princeton, NJ: Princeton University Press

Grant, Peter R.; Grant, B. Rosemary (2013), Data from: 40 years of evolution. Darwin’s finches on Daphne Major Island, Dryad, Dataset, https://doi.org/10.5061/dryad.g6g3h

Gibbs, H. Lisle, and Peter R. Grant. “Adult Survivorship in Darwin’s Ground Finch (Geospiza) Populations in a Variable Environment.” Journal of Animal Ecology, vol. 56, no. 3, 1987, pp. 797–813. JSTOR, www.jstor.org/stable/4949. Accessed 16 Nov. 2020.