We made the observation that Messor pergandei foragers are polymorphic in size and seed sizes in the environment are variable. We asked the question “Is size polymorphism in granivorous ants an adaptation to optimally forage for seed of varying size?” We hypothesized that polymorphism in granivorous ants is an adaptation to maximize energy gain in environments where food energetic quality and handling time trade-off. We then tested two predictions from this hypothesis.
Prediction 1: When individual Messor ant colonies encounter seed that is variable in seed size, large seed will only be carried large foragers and small seed will only be carried by small foragers.
Experiment 1 (testing P1): Individual-level size matching of ants and seed size
Read in the data for Experiment 1. Check the structure of the data to make sure the dependent variable is quantitative (numeric or integer) and that the independent variable seed size and group and categorical
EXP1.RAW.DATA <- read.csv("antlab - exp1.csv", colClasses = c(group="factor", colony="factor")) %>% mutate(seed_size = relevel(seed_size,"S") %>% recode(S="small",L="large"))
str(EXP1.RAW.DATA)'data.frame': 694 obs. of 4 variables:
$ group : Factor w/ 8 levels "1","2","3","4",..: 3 3 3 3 3 3 3 3 3 3 ...
$ colony : Factor w/ 2 levels "1","2": 1 1 1 1 1 1 1 1 1 1 ...
$ seed_size: Factor w/ 2 levels "small","large": 1 1 1 1 1 1 1 1 1 1 ...
$ ant_size : num 2 1.25 1.75 1 1.25 1 1.5 1 1.5 1.5 ...
Create the dataset we will analyze by taking the means and CV of each group x colony x seed_size subset
EXP1.DATA <- EXP1.RAW.DATA %>%
group_by(group, colony, seed_size) %>%
summarize(n= n(),
ant_size_mean = mean(ant_size),
ant_size_cv = sd(ant_size)/mean(ant_size))
kable(EXP1.DATA, digits=2)| group | colony | seed_size | n | ant_size_mean | ant_size_cv |
|---|---|---|---|---|---|
| 1 | 1 | small | 19 | 1.39 | 0.21 |
| 1 | 1 | large | 21 | 1.37 | 0.21 |
| 1 | 2 | small | 21 | 1.25 | 0.19 |
| 1 | 2 | large | 20 | 1.12 | 0.34 |
| 2 | 1 | small | 20 | 1.41 | 0.21 |
| 2 | 1 | large | 20 | 1.31 | 0.22 |
| 2 | 2 | small | 21 | 1.17 | 0.17 |
| 2 | 2 | large | 21 | 1.42 | 0.15 |
| 3 | 1 | small | 18 | 1.40 | 0.23 |
| 3 | 1 | large | 20 | 1.68 | 0.21 |
| 3 | 2 | small | 20 | 1.41 | 0.24 |
| 3 | 2 | large | 20 | 1.56 | 0.19 |
| 4 | 1 | small | 21 | 1.26 | 0.28 |
| 4 | 1 | large | 21 | 1.68 | 0.17 |
| 4 | 2 | small | 20 | 0.98 | 0.37 |
| 4 | 2 | large | 20 | 1.57 | 0.21 |
| 5 | 1 | small | 22 | 1.52 | 0.22 |
| 5 | 1 | large | 22 | 1.75 | 0.15 |
| 5 | 2 | small | 22 | 1.30 | 0.22 |
| 5 | 2 | large | 22 | 1.89 | 0.11 |
| 6 | 1 | small | 22 | 1.19 | 0.17 |
| 6 | 1 | large | 28 | 1.18 | 0.14 |
| 6 | 2 | small | 23 | 1.09 | 0.18 |
| 6 | 2 | large | 22 | 1.17 | 0.18 |
| 7 | 1 | small | 24 | 1.34 | 0.19 |
| 7 | 1 | large | 21 | 1.61 | 0.17 |
| 7 | 2 | small | 35 | 1.46 | 0.22 |
| 7 | 2 | large | 27 | 1.51 | 0.19 |
| 8 | 1 | small | 20 | 1.50 | 0.19 |
| 8 | 1 | large | 20 | 1.86 | 0.15 |
| 8 | 2 | small | 20 | 1.43 | 0.24 |
| 8 | 2 | large | 21 | 1.83 | 0.11 |
Plot the raw data by group and seed_size
ggplot(EXP1.RAW.DATA, aes(x=paste0("G",group,"C",colony), y=ant_size, fill=seed_size)) +
geom_boxplot() +
xlab("Group - Colony") + ylab("Ant head size (mm)") +
scale_fill_discrete("Seed size")Question: Does the mean Messor ant size differ between those carrying large and small seed?
Interpretation: We would have evidence for size matching, in support of Prediction 1, if large seed is carried by larger ants than small seed. If this is not the case, then our prediction is false and thus we do not have support for our hypothesis.
Calculate descriptive statistics, getting mean and se of ant_size_mean for both levels of seed_size (small and large seed)
A1.SUMMARY <- EXP1.DATA %>%
group_by(seed_size) %>%
summarize(n= n(),
mean = mean(ant_size_mean),
sd = sd(ant_size_mean),
se = sd(ant_size_mean)/sqrt(n()))
kable(A1.SUMMARY, digits=3)| seed_size | n | mean | sd | se |
|---|---|---|---|---|
| small | 16 | 1.319 | 0.154 | 0.039 |
| large | 16 | 1.531 | 0.250 | 0.063 |
ggplot(A1.SUMMARY, aes(y = mean, x = seed_size)) +
geom_col() +
geom_errorbar(aes(ymin = mean - se, ymax = mean + se), width = 0.2) +
scale_y_continuous(expand = expansion(mult = c(0, 0.1))) +
ylab("Mean ant head size (mm)") + xlab("Seed size") This analysis is a two-way ANOVA with seed size and block (=group) as independent variables and mean ant head size as the dependent variable. Include block as an independent variable to account for variation among your research groups, which includes how groups collected and measured ants.
| Df | Sum Sq | Mean Sq | F value | Pr(>F) | |
|---|---|---|---|---|---|
| seed_size | 1 | 0.359 | 0.359 | 17.1 | 4e-04 |
| group | 7 | 0.813 | 0.116 | 5.54 | 0.000785 |
| Residuals | 23 | 0.482 | 0.021 | NA | NA |
Question: Does the variablity in Messor ant size differ between those carrying large and small seed?
Intepretation: The strongest evidence in support of our prediction for size matching would be if the variability in ant size carrying both seed sizes is the same, indicating that large ants are as selective in the large seed sizes they carry as small ants are selective in the small seed sizes they carry.
Calculate descriptive statistics, getting mean and se of ant_size_cv for both levels of seed_size (small and large seed)
A2.SUMMARY <- EXP1.DATA %>%
group_by(seed_size) %>%
summarize(n= n(),
mean = mean(ant_size_cv),
sd = sd(ant_size_cv),
se = sd(ant_size_cv)/sqrt(n()))
kable(A2.SUMMARY, digits=3)| seed_size | n | mean | sd | se |
|---|---|---|---|---|
| small | 16 | 0.220 | 0.049 | 0.012 |
| large | 16 | 0.182 | 0.053 | 0.013 |
ggplot(A2.SUMMARY, aes(y = mean, x = seed_size)) +
geom_col() +
geom_errorbar(aes(ymin = mean - se, ymax = mean + se), width = 0.2) +
scale_y_continuous(expand = expansion(mult = c(0, 0.1))) +
ylab("CV ant head size") + xlab("Seed Size") This analysis is a two-way ANOVA with seed size and block (=group) as independent variables and ant head size variability (CV) as the dependent variable. Include block as an independent variable to account for variation among your research groups, which includes how groups collected and measured ants.
| Df | Sum Sq | Mean Sq | F value | Pr(>F) | |
|---|---|---|---|---|---|
| seed_size | 1 | 0.0119 | 0.0119 | 5.62 | 0.0265 |
| group | 7 | 0.0296 | 0.00423 | 2 | 0.099 |
| Residuals | 23 | 0.0486 | 0.00211 | NA | NA |
Prediction 2. When individual Messor ant colonies encounter seed that is either all small or all large sized, colonies foraging for large seed will dispatch more larger ants over time to forage than colonies foraging for small seed.
Experiment 2 (testing P2): Colony-level size matching of ants and seed size
View the raw data and check the structure of the data to make sure the dependent variable is quantitative (numeric or integer) and that the independent variable seed size and group and categorical.
EXP2.RAW.DATA <- read.csv("antlab - exp2.csv", colClasses = c(group="factor", colony="factor")) %>% mutate(seed_size = relevel(seed_size,"S") %>% recode(S="small",L="large"))
str(EXP2.RAW.DATA)'data.frame': 985 obs. of 5 variables:
$ group : Factor w/ 8 levels "1","2","3","4",..: 3 3 3 3 3 3 3 3 3 3 ...
$ colony : Factor w/ 2 levels "1","2": 1 1 1 1 1 1 1 1 1 1 ...
$ seed_size: Factor w/ 2 levels "small","large": 2 2 2 2 2 2 2 2 2 2 ...
$ pre_post : Factor w/ 2 levels "post","pre": 2 2 2 2 2 2 2 2 2 2 ...
$ ant_size : num 1 2 1.25 1.75 1.75 1.25 1 1.25 1.5 1.25 ...
Plot the raw data by group and seed_size
ggplot(EXP2.RAW.DATA, aes(x=paste0("G",group,"C",colony), y=ant_size, fill=seed_size, color=pre_post)) +
geom_boxplot() +
xlab("Group - Colony") + ylab("Ant head size (mm)") +
scale_fill_discrete("Seed size") +
scale_color_grey("Pre/post baiting")Create the dataset we will analyze by taking the means of each group x colony x seed_size subset and then calculating ant size change by subtracting pre from post.
EXP2.DATA <- EXP2.RAW.DATA %>%
group_by(group, colony, seed_size, pre_post) %>%
summarize(mean = mean(ant_size)) %>%
spread(pre_post, mean) %>%
mutate(ant_size_change = post - pre)
kable(EXP2.DATA, digits=2)| group | colony | seed_size | post | pre | ant_size_change |
|---|---|---|---|---|---|
| 1 | 1 | large | 1.43 | 1.15 | 0.28 |
| 1 | 2 | small | 1.20 | 1.26 | -0.06 |
| 2 | 1 | large | 1.43 | 1.43 | 0.00 |
| 2 | 2 | small | 1.54 | 1.44 | 0.10 |
| 3 | 1 | small | 1.32 | 1.27 | 0.04 |
| 3 | 1 | large | 1.38 | 1.45 | -0.07 |
| 4 | 1 | small | 1.35 | 1.42 | -0.07 |
| 4 | 2 | large | 1.63 | 1.34 | 0.29 |
| 5 | 1 | small | 1.40 | 1.61 | -0.21 |
| 5 | 2 | large | 1.61 | 1.50 | 0.11 |
| 6 | 1 | small | 1.32 | 1.30 | 0.02 |
| 6 | 2 | large | 1.22 | 1.37 | -0.15 |
| 7 | 1 | large | 1.35 | 1.26 | 0.09 |
| 7 | 2 | small | 1.38 | 1.34 | 0.03 |
| 8 | 1 | small | 1.40 | 1.48 | -0.08 |
| 8 | 2 | large | 1.77 | 1.53 | 0.24 |
Question: Does the mean change in Messor ant head size over time differ between those colonies baited with all large or all small seed?
Interpretation: We would have evidence for size matching and in support of Prediction 2 if the change in ant head size is positive (increasing body size) for colonies offered large seed and negative (decreasing body size) for ant colonies offered small seed.
Calculate descriptive statistics, getting mean and se of ant_size_change for both levels of seed_size (small and large seed)
B1.SUMMARY <- EXP2.DATA %>%
group_by(seed_size) %>%
summarize(n= n(),
mean = mean(ant_size_change),
sd = sd(ant_size_change),
se = sd(ant_size_change)/sqrt(n()))
kable(B1.SUMMARY, digits=3)| seed_size | n | mean | sd | se |
|---|---|---|---|---|
| small | 8 | -0.028 | 0.096 | 0.034 |
| large | 8 | 0.100 | 0.164 | 0.058 |
ggplot(B1.SUMMARY, aes(y = mean, x = seed_size)) +
geom_col() +
geom_errorbar(aes(ymin = mean - se, ymax = mean + se), width = 0.2) +
ylab("Change in ant head size (mm)") + xlab("Seed Size")This analysis is a two-way ANOVA with seed size and block (=group) as independent variables and change in mean ant head size as the dependent variable. Include block as an independent variable to account for variation among your research groups, which includes how groups collected and measured ants.
| Df | Sum Sq | Mean Sq | F value | Pr(>F) | |
|---|---|---|---|---|---|
| seed_size | 1 | 0.0648 | 0.0648 | 2.44 | 0.162 |
| group | 7 | 0.0681 | 0.00973 | 0.367 | 0.895 |
| Residuals | 7 | 0.186 | 0.0265 | NA | NA |