Electronic supplementary material for: Maternal condition and previous
reproduction interact to affect offspring sex in a wild mammal
Mathieu Douhard, Marco Festa-Bianchet and Fanie Pelletier
Département de biologie and Centre d’Études Nordiques, Université de Sherbrooke, 2500
boulevard de l’Université, Sherbrooke, Québec, Canada J1K 2R1.
1
Electronic supplementary material S1
Table S1. Sample size and age distribution of bighorn sheep females used in this study.
Age 5
N
6
102 96
7
8
9
10
11
12
13
14
15
16
17
86
67
54
52
38
26
18
13
6
1
1
2
Electronic supplementary material S2
Figure S1. Chronology of successive reproductions in bighorn sheep, showing when variables
under consideration (in red) were measured.
3
Electronic supplementary material S3
######### R Code ######
#Load Data
data<-read.table("datadryad.txt",h=T,dec=",")
#Check data
dim(data)
str(data)
data$idmother<-as.factor(data$idmother)
data$idfather<-as.factor(data$idfather)
data$year<-as.factor(data$year)
data$pws<-as.factor(data$pws)
#First explore offspring sex-ratio variation
summary(as.factor(data$sex))### 267 sons, 293 daughters
prop.test(x = 267, n = (267+293)) ### test for equilibrate sex ratio
#Run vif function to see potential correlations problems
library(car)
vif(glm(sex~ pws * condition * env, family="binomial",data))
# 1) Run an analysis of deviance
PBsimfun <- function(m0,m1,x=NULL) {
if (is.null(x)) x <- simulate(m0)
m0r <- try(refit(m0,x[[1]]),silent=TRUE)
if (inherits(m0r,"try-error")) return(NA)
m1r <- try(refit(m1,x[[1]]),silent=TRUE)
if (inherits(m1r,"try-error")) return(NA)
c(-2*(logLik(m0r)-logLik(m1r)))
} ## author Ben Bolker (http://ms.mcmaster.ca/~bolker/R/misc/foxchapter/bolker_chap.html)
library(lme4)
lm0<-glmer(sex ~ pws * condition * env + (1|idmother) +
(1|year),data,family="binomial",control=glmerControl(optimizer="bobyqa"))
4
lm1<-glmer(sex ~ pws + condition + env + pws:condition + pws:env + condition:env + (1|idmother) +
(1|year), data,family="binomial",control=glmerControl(optimizer="bobyqa"))
set.seed(125)
test1<- replicate(400,PBsimfun(lm1,lm0))
obsval1 <- -2*(logLik(lm1)-logLik(lm0))
test1 <- c(na.omit(pmax(test1,0)),obsval1)
hist(test1)
mean(test1>=obsval1)
lm2<-glmer(sex ~ pws + condition + env + pws:condition + pws:env + (1|idmother) +
(1|year),data,family="binomial",control=glmerControl(optimizer="bobyqa"))
set.seed(126)
test2<- replicate(400,PBsimfun(lm2,lm1))
obsval2 <- -2*(logLik(lm2)-logLik(lm1))
test2 <- c(na.omit(pmax(test2,0)),obsval2)
hist(test2)
mean(test2>=obsval2)
lm3<-glmer(sex ~ pws + condition + env + pws:condition + (1|idmother) +
(1|year),data,family="binomial",control=glmerControl(optimizer="bobyqa"))
set.seed(127)
test3<- replicate(400,PBsimfun(lm3,lm2))
obsval3 <- -2*(logLik(lm3)-logLik(lm2))
test3 <- c(na.omit(pmax(test3,0)),obsval3)
hist(test3)
mean(test3>=obsval3)
lm4<-glmer(sex ~ pws + condition + env + (1|idmother) +
(1|year),data,family="binomial",control=glmerControl(optimizer="bobyqa"))
set.seed(128)
test4<- replicate(400,PBsimfun(lm4,lm3))
obsval4 <- -2*(logLik(lm4)-logLik(lm3))
test4 <- c(na.omit(pmax(test4,0)),obsval4)
hist(test4)
mean(test4>=obsval4)
5
lm5<-glmer(sex~ pws*condition + (1|idmother) + (1|year),
data,family="binomial",control=glmerControl(optimizer="bobyqa"))
set.seed(120)
test5 <- replicate(400,PBsimfun(lm5,lm3))
obsval5 <- -2*(logLik(lm5)-logLik(lm3))
test5 <- c(na.omit(pmax(test5,0)),obsval5)
hist(test5)
mean(test5>=obsval5)
#interpretation of the interaction between pws and condition
summary(lm5)## 'no lamb weaned' is considered as reference
data$pws2 <- relevel(data$pws, "1")
lm51<-glmer(sex ~ pws2 * condition + (1|idmother) + (1|year),
data,family="binomial",control=glmerControl(optimizer="bobyqa"))
summary(lm51)## 'weaned a male' is considered as reference
data$pws3 <- relevel(data$pws, "2")
lm52<-glmer(sex ~ pws3 * condition + (1|idmother) + (1|year),
data,family="binomial",control=glmerControl(optimizer="bobyqa"))
summary(lm52) ## 'weaned a female' is considered as reference
# Check that the three higher values of condition belong to three different females.
data[data$condition>1.25,]### this is true
# 2) Re-run an analysis of deviance after excluding extreme values of condition (> 1.5 and < 1.5)
dataev<-data[data$condition>-1.5 & data$condition<1.5,]
dim(dataev)
lma<-glmer(sex~ pws * condition + (1|idmother) +
(1|year),dataev,family="binomial",control=glmerControl(optimizer="bobyqa"))
lmb<-glmer(sex~ pws + condition + (1|idmother) + (1|year),
dataev,family="binomial",control=glmerControl(optimizer="bobyqa"))
set.seed(130)
testbis<- replicate(400,PBsimfun(lmb,lma))
obsvalbis <- -2*(logLik(lmb)-logLik(lma))
6
testbis <- c(na.omit(pmax(testbis,0)),obsvalbis)
hist(testbis)
mean(testbis>=obsvalbis)
#interpretation of the interaction between pws and condition
summary(lma)## 'no lamb weaned' is considered as reference
dataev$pws2 <- relevel(dataev$pws, "1")
lmc<-glmer(sex ~ pws2 * condition + (1|idmother) + (1|year),
dataev,family="binomial",control=glmerControl(optimizer="bobyqa"))
summary(lmc)## 'weaned a male' is considered as reference
dataev$pws3 <- relevel(dataev$pws, "2")
lmd<-glmer(sex ~ pws3 * condition + (1|idmother) + (1|year),
dataev,family="binomial",control=glmerControl(optimizer="bobyqa"))
summary(lmd) ## 'weaned a female' is considered as reference
# 3) Re-run an analysis of deviance with maternal age as additional variable
#Run vif function to see potential correlations problems
vif(glm(sex~ age * pws * condition, family="binomial",data))
lmage0<-glmer(sex ~ age * pws * condition + (1|idmother) + (1|year), data,
family="binomial",control=glmerControl(optimizer="bobyqa"))
lmage1<-glmer(sex~ age + pws + condition + pws:condition + age:pws + age:condition + (1|idmother)
+ (1|year), data,family="binomial",control=glmerControl(optimizer="bobyqa"))
set.seed(112)
testage1 <- replicate(400,PBsimfun(lmage1,lmage0))
obsage1 <- -2*(logLik(lmage1)-logLik(lmage0))
testage1 <- c(na.omit(pmax(testage1,0)),obsage1)
hist(testage1)
mean(testage1>=obsage1)
lmage2<-glmer(sex ~ age + pws + condition + pws:condition + age:pws + (1|idmother) + (1|year),
data, family="binomial",control=glmerControl(optimizer="bobyqa"))
set.seed(113)
testage2 <- replicate(400,PBsimfun(lmage2,lmage1))
obsage2 <- -2*(logLik(lmage2)-logLik(lmage1))
7
testage2 <- c(na.omit(pmax(testage2,0)),obsage2)
hist(testage2)
mean(testage2>=obsage2)
lmage3<-glmer(sex ~ age + pws + condition + pws:condition + (1|idmother) + (1|year),
data,family="binomial",control=glmerControl(optimizer="bobyqa"))
set.seed(114)
testage3 <- replicate(400,PBsimfun(lmage3,lmage2))
obsage3 <- -2*(logLik(lmage3)-logLik(lmage2))
testage3 <- c(na.omit(pmax(testage3,0)),obsage3)
hist(testage3)
mean(testage3>=obsage3)
lmage31<-glmer(sex~ age + pws2 + condition + pws2:condition + (1|idmother) + (1|year),
data,family="binomial",control=glmerControl(optimizer="bobyqa"))
summary(lmage31)
# 4) Re-run an analysis of deviance with paternal reproductive success as additional variable
datap<-data[!is.na(data$fathersuccess),]
vif(glm(sex ~ pws * condition * fathersuccess,family="binomial",datap))
lmfather1 <-glmer(sex ~ pws * condition * fathersuccess + (1|idmother) + (1|idfather) +
(1|year),datap,family="binomial",control=glmerControl(optimizer="bobyqa"))
lmfather2 <-glmer(sex ~ pws + condition + fathersuccess + pws:condition + pws:fathersuccess +
condition:fathersuccess + (1|idmother) + (1|year) +
(1|idfather),datap,family="binomial",control=glmerControl(optimizer="bobyqa"))
set.seed(110)
testpat1 <- replicate(400,PBsimfun(lmfather2,lmfather1))
obspat1 <- -2*(logLik(lmfather2)-logLik(lmfather1))
testpat1 <- c(na.omit(pmax(testpat1,0)),obspat1)
hist(testpat1)
mean(testpat1>=obspat1)
lmfather3 <-glmer(sex ~ pws + condition + fathersuccess + pws:condition + pws:fathersuccess +
(1|idmother) + (1|year) +
(1|idfather),datap,family="binomial",control=glmerControl(optimizer="bobyqa"))
set.seed(120)
8
testpat2 <- replicate(400,PBsimfun(lmfather3,lmfather2))
obspat2 <- -2*(logLik(lmfather3)-logLik(lmfather2))
testpat2 <- c(na.omit(pmax(testpat2,0)),obspat2)
hist(testpat2)
mean(testpat2>=obspat2)
lmfather4 <-glmer(sex ~ pws2 + condition + fathersuccess + pws2:condition + (1|idmother) + (1|year)
+ (1|idfather),datap,family="binomial",control=glmerControl(optimizer="bobyqa"))
set.seed(130)
testpat3 <- replicate(400,PBsimfun(lmfather4,lmfather3))
obspat3 <- -2*(logLik(lmfather4)-logLik(lmfather3))
testpat3 <- c(na.omit(pmax(testpat3,0)),obspat3)
hist(testpat3)
mean(testpat3>=obspat3)
summary(lmfather4)
# % of variance explained
library(MuMIn)
r.squaredGLMM(lmfather4)### paternal + maternal effects
lmfather5 <-glmer(sex ~ fathersuccess + (1|idmother) + (1|year) +
(1|idfather),datap,family="binomial",control=glmerControl(optimizer="bobyqa"))
r.squaredGLMM(lmfather5)### paternal effect only
lmfather6 <-glmer(sex ~ pws * condition + (1|idmother) + (1|year) +
(1|idfather),datap,family="binomial",control=glmerControl(optimizer="bobyqa"))
r.squaredGLMM(lmfather6)
9
Electronic supplementary material S4
Figure S2. Probability of producing a son according to maternal condition between -1.5 and
1.5 and previous weaning success (PWS). Solid and dashed lines represent model predictions
± s.e.
10
Electronic supplementary material S5
Table S2. Generalized linear mixed model of the probability of producing a son based on 341
observations of 122 female bighorn sheep aged 7-13 years. We measured maternal condition
as each female’s mass adjusted to September 15 each year, about two months before
conception, minus her average mid-September mass between 6 and 12 years of age.
Interactions between terms are denoted by ×. ENV, environmental conditions; PWS, previous
weaning success.
Analysis of deviance
χ²
d.f.
p-value
maternal condition × PWS × ENV
4.56
2
0.11
maternal condition × ENV
0.19
1
0.71
PWS × ENV
0.39
2
0.80
maternal condition × PWS
7.94
2
0.02
ENV
2.12
1
0.16
Reduced model
Estimate
s.e.
p-value
Intercept
-0.140
0.206
0.49
no lamb weaned
0.026
0.283
0.93
weaned a female
0.199
0.276
0.47
maternal condition
0.204
0.084
0.01
no lamb weaned × maternal condition
-0.327
0.119
0.006
weaned a female × maternal condition
-0.147
0.125
0.24
PWS†
† Females that weaned a male were considered as reference.
11
Electronic supplementary material S6
Table S3. Generalized linear mixed model of the probability of producing a son based on 560
observations of 165 female bighorn sheep. As a first step, we tested the interactive effects
(denoted by ×) between mother’s age and other maternal characteristics (condition and
previous weaning success, PWS). As interaction terms were not significant, they were
removed from the model to estimate the main effect of age.
Analysis of deviance
χ²
d.f.
p-value
maternal condition × PWS × age
0.50
2
0.82
maternal condition × age
0.01
1
0.94
PWS × age
3.48
2
0.21
Reduced model
Estimate
s.e.
p-value
Intercept
-0.214
0.178
0.23
Age
0.057
0.190
0.77
no lamb weaned
0.117
0.224
0.60
weaned a female
0.366
0.228
0.11
maternal condition
1.067
0.348
0.002
no lamb weaned × maternal condition
-1.522
0.465
< 0.001
weaned a female × maternal condition
-1.129
0.468
0.016
PWS†
† Females that weaned a male were considered as reference.
12
Table S4. Generalized linear mixed model of the probability of producing a son based on 298
observations of 112 mothers and 86 fathers. Paternal success is available for most lambs only
since 1988, providing a smaller sample size compared to analyses including only maternal
effects. As a first step, we tested the interactive effects (denoted by ×) between paternal
reproductive success and maternal characteristics (condition and previous weaning success,
PWS). As interaction terms were not significant, they were removed from the model to
estimate the main effect of paternal reproductive success. Similarly to all continuous
variables, paternal success was centered and then divided by two standard deviations.
Analysis of deviance
χ²
d.f.
p-value
maternal condition × PWS × paternal success
1.26
2
0.58
maternal condition × paternal success
1.49
1
0.26
PWS × paternal success
0.46
2
0.84
Reduced model
Estimate
s.e.
p-value
Intercept
-0.307
0.233
0.19
paternal success
0.886
0.281
0.002
no lamb weaned
-0.131
0.312
0.67
weaned a female
0.471
0.315
0.13
maternal condition
0.918
0.436
0.03
no lamb weaned × maternal condition
-1.600
0.633
0.01
weaned a female × maternal condition
-0.753
0.624
0.23
PWS†
† Females that weaned a male were considered as reference.
13
© Copyright 2026 Paperzz