What causes extra pair copulation in prairie voles?

Prairie voles (Microtus ochrogaster) are famously monogamous, like humans, and ethologists and behavioral ecologists have studied them for that reason. Voles, like humans, also engage in extra-pair copulations, and we have been trying to understand the causes and consequences of those extra-pair copulations.

One reason that individuals engage in extra-pair copulations is in order to avoid inbreeding depression. Breeding that results for matings between related individuals typically causes a decline in vigor and health of individual offspring and a reduction in fitness for those phenotypes. Inbreeding depression is the reduction in fitness due to breeding among relatives.

So, what causes extra-pair copulation? What influences the probability that an individual enages in extra-pair copulation?

Here are some possibilities:

It is not always clear how animals and plants identify individuals who are closely related or not related, but under many circumstances, they somehow seem to mate with individuals who are less related than by chance along.

Background

From Wikipedia:

Fitness is the quantitative representation of natural and sexual selection within evolutionary biology. It can be defined either with respect to a genotype or to a phenotype in a given environment. In either case, it describes individual reproductive success and is equal to the average contribution to the gene pool of the next generation that is made by individuals of the specified genotype or phenotype. The fitness of a genotype is manifested through its phenotype, which is also affected by the developmental environment. The fitness of a given phenotype can also be different in different selective environments.

Data from the Solomon/Keane lab

The data file epr_209.csv contains observations on voles related to those we read about in Solomon and Keane (2018). These data are from sampling of voles from the Indiana site, collected over three years (2006-2008).

Each row in the data set is a record of a succesful copulation that resulted in at least one offspring. Included in each row we have the ofllowing columns:

Relatedness to a partner varies between -1 and +1. A value near zero indicates no more related than expected by chance; 1 is self-identity (e.g., clone) and negative values indicate even less related than we expect due to chance.

Here we read in the data.

d209 <- read.csv("epr_209.csv")
str(d209)
## 'data.frame':    250 obs. of  7 variables:
##  $ id      : chr  "101" "101" "1021" "1021" ...
##  $ sex     : chr  "male" "male" "female" "female" ...
##  $ year    : int  2006 2006 2007 2006 2006 2007 2007 2006 2006 2006 ...
##  $ nest    : chr  "19/20/21" "19/20/21" "29" "32" ...
##  $ size    : int  7 7 3 2 2 2 2 7 7 2 ...
##  $ r       : num  0.378 -0.183 0.321 -0.109 -0.032 ...
##  $ pairtype: chr  "nest" "nest" "nest" "extra" ...

Your goal

Ask yourself, “what the heck are these voles doing? is there anything in particular that seems related to the probability that an individual engages or does not engage in extra-pair copulation.

You will come up iwth a hypothesis about the conditions to might lead to more extra-pair copulations.

  1. pose a question that you can express in a graph using these data.
  2. draw a mock-up of the graph that is consistent with the mechanism you propose.
  3. create R code to create the figure you want.
  4. figure out what the figure tells you about the answer to your question. Does it match you expectations?

Put all of the above (question, hand-drawn graph mock-up, R figure of data, data-based answer to your question) in a document, and turn it in online.

Write your own script

To create the graph, you will write your own script. Start as uysual, by finding out what your current working directory. Make sure it is Rwork. The read in yur data and look at the variables. Then create the graph you want.

getwd()

d209 <- read.csv("epr_209.csv")
str(d209)

Use everything you have learned thus far, and the tutorial below to make the graph you want. After you make the graph you want, you can use ggsave("myVoles.png") to save the graph to your working directory.

Graphing in ggplot()

Here is some general guidance for using ggplot():

ggplot(data= myDataset, aes(x= X-variable, y= Y-variable)) + geom_typeOfPlot()

First, we load the ggplot2 package.

library(ggplot2)

If we load tidyverse, it will load ggplot2 and lots of others.

Using built-in data set, mpg: fuel economy data from 1999 to 2008 for 38 popular models of cars.

For a box-and-whisker plot.

ggplot(mpg, aes(x = class, y = hwy)) + geom_boxplot() + 
  labs(x="type of car", y="highway mileage")

For scatterplots

ggplot(mpg, aes(x=cty, y=hwy)) + geom_point() + 
  labs(x="city mileage", y="highway mileage")

## for a scatterplot with a fitted straight line 
ggplot(mpg, aes(x=cty, y=hwy)) + geom_point() + geom_smooth(method="lm")
## `geom_smooth()` using formula 'y ~ x'

## for a scatterplot with a fitted curved line 
ggplot(mpg, aes(x=cty, y=hwy)) + geom_point() + geom_smooth()
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'

For scatterplots with binomial data (0,1), using mpg data. Create a dichotomous variable (0, 1) indicating whether a car model is front wheel drive or other (rear- or 4-wheel drive). A plot like this puts probability on the y-axis. In this case it is the probability that a car with a given mileage is a front-wheel drive car.

Convert a factor or character variable to zeros and ones.

mpg2 <- mpg %>% 
  mutate(
    prob.f = ifelse(drv=="f", 1, 0)
  )

mpg2 <- mpg
mpg2$prob.f = ifelse(mpg2$drv=="f", 1, 0)

d209.b <- d209
d209.b$prob.extra = ifelse(d209.b$pairtype=="extra", 1, 0)


ggplot(mpg2, aes(cty, prob.f)) + geom_point() + geom_smooth(method="glm", method.args = list(family = "binomial"))
## `geom_smooth()` using formula 'y ~ x'

The graph tells us that the higher mileage our car has, the more likely it is–the higher the probability it is–to be a front-wheel drive car.