DOI: 10.5061/dryad.tdz08kq4h
title: Strength of sexual selection and sex roles vary between social groups in a coral reef cardinalfish

description: The strength and direction of sexual selection can vary among populations.
 However, spatial variability is rarely explored at the level of the social
 group. Here we investigate sexual selection and sex roles in the
 paternally mouthbrooding, socially monogamous, and site-attached pajama
 cardinalfish, Sphaeramia nematoptera. Females were larger, more
 aggressive, and had a longer dorsal fin filament, indicating reversed sex
 roles. At the scale of social groups, we show the Bateman gradient and
 reproductive variance depending on the sex ratio and size of the groups.
 In small and medium-sized groups with balanced or male-biased sex ratios,
 Bateman gradients were steeper for females, whereas gradients were equally
 steep for both sexes in large groups or when the sex ratio was
 female-biased. For both sexes, reproductive variance increased with group
 size and with a higher male-to-female sex ratio. In S.
 nematoptera, mating opportunities outside the socially monogamous pair
 appear to impact sexual selection. We conclude that the strength and
 direction of sexual selection can be masked by social dynamics in
 group-living species when considering only population and large-scale
 demographic processes.
description: <em>Study system and tagging </em>
 This study was conducted over five periods, spanning two years;
 October - November 2012 (observational period: 32 days), February - March
 2013 (21 days), July - August 2013 (16 days), March - April 2014 (23 days)
 and September 2014 (9 days), in Kimbe Bay, Papua New Guinea (5°30’S,
 150°05’E). To reflect approximately the same observational timespan and
 thus enable comparisons of reproductive output, data were grouped by year.
 Social groups of the pajama cardinalfish, <em>Sphaeramia
 nematoptera</em>, were defined as occupying the same distinct patch
 of the stony coral <em>Porites cylindrica</em> at a minimum
 distance of 2m from another group (Fig. 1a). A total of 379 individuals
 from 18 groups at 5-17 m depth on five reefs were included in the study
 (see map in Rueger et al. 2019). All fish were caught using handnets and
 diluted clove oil solution (Munday and Wilson, 1997), and individually
 marked using Visible Implant Elastomer (VIE) tags (Northwest Marine
 Technology). For each individual, we recorded a unique identifier, their
 life stage, and sex (see Group size and structure), behaviour (see
 Behavioural observations), collected fin clips (see Measuring mating and
 reproductive success), and measured standard length. Other morphological
 measures (weight and dorsal fin filament) were only collected from a
 smaller sample (see Sexual dimorphism). This study was conducted in
 accordance with the James Cook University Ethics Committee, approval
 number A1847. <em>Group size and
 structure</em> The number of individual fish in
 18 spatially different groups were counted and adult and juvenile status
 were determined based on standard length (Rueger et al. 2016b). Sex was
 determined by observing the distended buccal cavity during brooding (male)
 and bulging abdomen shortly before brooding (female) as well as pairing
 behaviour (Rueger et al. 2016b, 2018). A total of 168 individuals in 18
 groups were identified as adults based on standard length with the
 remaining 211 being juveniles or subadults. Detailed demographics,
 including adult sex ratio and adult group size (number of adults per
 group), were gathered for 18 groups. For 10 groups three years of
 observations were available, for four groups two years of observations
 were available and for four groups only one year of observations was
 available. Reproduction was observed for 121 adult individuals for 16 of
 the 18 groups; in one group reproduction was observed in all three years,
 in nine groups reproduction was observed in two years and six groups
 reproduction was observed in only one year. All statistical analyses in
 this study were carried out in R version 4.0.3 (R Core team 2020). To
 determine whether the adult sex ratio and group size varied significantly
 between groups, we conducted a linear mixed model (LMM) analysis using the
 <em>lme4</em> package (Bates et al. 2015). We used adult sex
 ratio and group size as response variables in two separate models, group
 ID as fixed factor and year as random intercept. Significance tests for
 LMMs were performed by likelihood ratio tests of the full model with the
 effect in question tested against the model without the effect. No obvious
 deviations from homoscedasticity were detected by visually inspecting the
 residual plots. No outliers or high variance inflation factors (VIF) were
 detected in any of the best-fit models, using
 <em>performance</em> (Luedecke et al. 2020). Conditional and
 marginal R<sup>2</sup> were calculated using Nakagawa’s
 R<sup>2</sup> in <em>performance</em>.
 <em>Sexual dimorphism </em> A
 sample of 47 adult <em>S. nematoptera</em> were caught from
 multiple groups and euthanized to extract their gonads and determine sex
 (see Rueger et al. 2018 for detailed methods). These samples were not part
 of the long-term monitoring effort described above for 18 groups but
 instead originated from separate groups. There were 20 females and 27
 males in the sample. Their standard length (SL; fish length from the tip
 of the snout to the posterior end of the last vertebra excluding the
 length of the caudal (tail) fin) and the length of the dorsal filament
 (Fig. 1d) were measured to the nearest millimetre using calipers and wet
 weight (mass) was measured using a digital scale to the nearest
 0.1g. We conducted a directed comparison between three
 morphological traits, SL, mass, and dorsal fin filament, that are: 1)
 highly distinguishable in this species (dorsal fin filament length) (Fig.
 1d), and 2) commonly sexually dimorphic among other species (body size).
 While dorsal fin filament length may simply be represented by a univariate
 measurement (mm), body size, in contrast, is better represented as a
 multivariate morphological trait (Freeman & Jackson 1990).
 Therefore, we first constructed a multivariate metric of body size by
 loading SL (mm) and mass (g) into a Principal Component Analysis (PCA) and
 extracting the first component from the PCA (the allometric size variable)
 for each individual (henceforth defined as ‘Body PC1’; explaining 97% of
 the variance in SL and mass measurements). To aid in visual
 interpretation, PC1 values were normalized between 0 and 100. PCA was
 conducted in R using the function ‘prcomp’, and mass was not
 log-transformed before loading into the PCA because both mass and dorsal
 filament scaled linearly (Linear Model: <em>β =</em> 2.96,
 <em>t </em>= 10.10, df = 45, <em>p </em>&lt;
 0.001, adjusted R<sup>2</sup> = 0.687). Sexual dimorphism in
 body size was tested using a linear model with body size (Body PC1) as the
 Gaussian distributed response variable and sex as the sole fixed effect
 predictor. Sexual dimorphism in dorsal filament was
 tested using a similar linear model, however, body size was replaced with
 dorsal filament (mm) as the response variable (Gaussian distributed). To
 account for the influence of body size on dorsal filament alone, and to
 test for differences in allometric scaling between body size and dorsal
 filament between sexes, we included sex (binomial), body size (numeric),
 and an interaction between sex and body size as fixed effect
 predictors. The effects of either ASR or group size
 were not tested on measures of sexual dimorphism because these measures
 were not known for all groups the sampled fish originated from. A large
 part of the sample came from the same group (24 out of 47) which had an
 ASR of 1.27 and was collected as a whole (all 24 adults). The size
 distribution for the 24 individuals in this group was similar to the other
 23 fish included in this sample (see suppl. Figure S1). The other 23 fish
 in the sample were collected opportunistically from multiple groups of
 unknown ASR. <em>Behavioural
 observations</em> During each of the five
 observational periods, all individuals from 18 groups were located every
 two to three days via visual census on SCUBA. On each day we noted whether
 males were brooding, which individuals were in pairs (see Rueger et al.
 2018 for details) and we recorded the subject and object of any agonistic
 behaviours (chases or bites) over 15-20 min. We compared the number of
 aggressions recorded per individual between males and females using
 Fisher’s exact test. To determine whether adult sex ratio or group size
 influenced the number of observed aggressions, we fitted a generalized
 linear mixed model in <em>lme4</em> (Bates et al. 2015) with
 the number of aggressions per group as response variable, number of adults
 and ASR as predictor variables and group ID as random effect term. We used
 a Poisson error distribution and fitted an observation level random effect
 term to account for overdispersion. To account for one potential
 environmental factor that could influence mating dynamics, we tested
 whether using coral size (the size of the coral head occupied by each
 distinct group) as a covariate improved the model. Including coral size
 did not improve the model and we, therefore, did not include it in the
 final model (log-likelihood test of model with coral size vs without coral
 size; χ<sup>2 </sup>= 0.368, p = 0.544).
 <em>Measuring mating and reproductive success: Genetic
 parentage analysis </em> Relative mating and
 reproductive success were measured by analysing the parentage of embryos
 and matching them to known adult individuals in the population. A DNA
 sample was taken from each individual (N = 379) in the 18 groups via a
 commonly used non-lethal protocol (Dietrich & Cunjak 2006; Beldade
 et al. 2016; O’Donnell et al. 2017), by clipping their caudal fin using
 surgical scissors (Fig. 1d). The resulting fin-clips were stored in high
 grade 95% ethanol. The procedure was carried out during the same sampling
 effort (approximately 90 minutes) for all group members at the beginning
 of the first study period. Caudal fin tissue grew back to the
 pre-procedure size within 2-3 weeks and no adverse effects on survival or
 behaviour were recorded (TR pers. obs.). Within the study periods, all
 broods were collected by catching brooding males. Clutches were then
 subsampled for genetic analysis and individual embryos were stored in
 high-grade 95% ethanol. To consider the possibility of multiple mothers
 and fathers in each clutch, approx. 10 eggs were sampled from different
 parts of each egg mass, including several points on the surface and the
 centre of the congealed egg mass (see details in Rueger et al. 2019). A
 total of 1056 embryos from 105 broods carried by 64 males were
 assayed. All individuals were genotyped at 23
 microsatellite loci with a range of 3 to 34 alleles observed per locus.
 Four markers that showed high genotyping error (≥ 6%) were excluded from
 the analyses. The remaining 19 loci had an average genotyping error of
 2.2% ± 0.4 SE. Parentage assignments were conducted with the software
 COLONY v2.0 (Jones & Wang 2010) to identify the most likely mother
 or mothers, and father or fathers, of the sampled eggs carried by male
 cardinalfish. We identified the number of genetic mates (mating success)
 and the number of offspring (reproductive success) for each reproductive
 individual. Detailed methods of genotyping and parentage analysis as well
 as marker-specific statistics can be found in Rueger et al. (2015) and
 Rueger et al. (2019). <em>Bateman gradient
 </em> We investigated the Bateman gradient by
 estimating the linear regression slope between mating success (number of
 genetic mates) and reproductive success (number of offspring assigned
 through parentage) (Lande & Arnold 1983; Arnold & Wade
 1984). We compared the slopes between males and females collating all data
 for each individual for the five observational periods and using Bayesian
 regression models (<em>brms</em> package, Bürkner 2017). To
 explore the influence of group size and structure we calculated the mean
 number of adults for each group (Fig. 1b), and the mean adult sex ratio
 for each group (Fig. 1c) over all observational periods. We determined the
 relationship between mating success and reproductive success using group
 size (number of adults per group) and group adult sex ratio as continuous
 covariates, and sex as a categorical covariate. We included the four-way
 interaction between ‘number of mates’, ‘sex’, ‘adult sex ratio’ and
 ‘number of adults’, the three-way interactions between ‘number of mates’,
 ‘sex’ and ‘adult sex ratio’, as well as between ‘number of mates’, ‘sex’
 and ‘number of adults’, and the two-way interaction between ‘number of
 mates’ and ‘sex’.  To facilitate comparison with different species and
 group structures, we used standardized Bateman gradients, where we used
 the relative number of offspring and z-standardised number of mates
 (Collet et al. 2014; Schielzeth 2010). We also used z-standardised
 measures of adult sex ratio and adult group size. To account for
 non-independence of samples we also included group ID as a grouping term.
 We used weakly informative priors. We ran the model for 10,000 iterations
 in each of four chains, with a 2,000-iteration warm-up. We confirmed model
 suitability using standard Bayesian diagnostic tests (Leave-one-out (LOO)
 Pareto k: 97% &lt;0.5, 3% 0.5–0.7; Rhat: all = 1; Neff ratio: all
 &gt; 0.9; non-divergent trace plots; acf = low autocorrelation;
 density plots = unimodal; diagnostic plots in suppl. Fig. S2-3). LOO
 cross-validation results indicated predictions in the fitted model were
 robust to pointwise out-of-sample replacement of data points. Because the
 response variable (number of offspring) consists of count data we also
 used expected log predicted density (elpd) scores to compare the fit of
 the Gaussian linear regression model typically used in Bateman’s gradient
 assessments to one with a Poisson distribution. The more typically used
 linear regression model fit the data better (elpd difference = -60.7) and
 facilitates easier interpretation of the Bateman gradient, we therefore
 chose this model for further exploration. As above, we tested whether
 using coral size as a covariate improved the models. Eldp scores were
 lower when including coral size and we did therefore not include it in the
 final models (Δ ELPD=-2.1, SE=2.9).  Using the covariate model constructed
 from our observations, we compared Bateman gradient slopes
 (<em>emmeans</em> package, Luedecke 2018) for males and
 females across nine hypothetical breeding groups with crossed levels of
 group size (low = 3, medium = 8, high = 15) and adult sex ratios
 (male-dominated = 1.9, balanced = 1, female-dominated = 0.6). This
 ‘counterfactual’ modelling is useful for identifying the causal
 implications of manipulating one or more predictor variables, in lieu of
 experimental population manipulations, therefore showing the implied
 predictions for imaginary experiments (McElreath 2020). Model diagnostics
 are presented in suppl. Figure S 2, 3.
 <em>Reproductive variance </em> We
 quantified reproductive variance (sums of squares of differences from
 means in reproductive success - as the number of embryos assigned to each
 parent) across the full study period for each sex, overall, and within the
 16 groups in which reproduction was observed. We used a Bayesian
 framework, with a Gaussian distribution, to model differences in
 within-group reproductive variance for each of the sexes, in relation to
 the interacting effects of standardised group size and adult sex ratio. We
 standardised within-group measures of group size and adult sex ratio by
 subtracting the overall mean and dividing the result by the overall
 standard deviation, of each variable respectively
 (<em>sensu</em> Jones 2009). The interaction between
 standardised group size and the adult sex ratio was removed from the
 reduced model, after showing nonsignificance. A comparison of LOO elpd
 scores showed this reduced model fit the data better than the full
 interaction model (diff &gt;2). As above, including coral size reduced
 model fit and we did therefore not include it in the final models (Δ
 ELPD=-1.7, SE=1.4). Models were checked for fit as above. Estimated
 marginal means and credibility intervals were extracted using
 <em>emmeans</em> (Lenth 2020) and plotted with
 <em>ggeffects </em>(Luedecke 2018). Model diagnostic plots are
 shown in suppl. Fig. S 4. <em>Reproductive skew
 </em> To calculate skew in reproductive success
 (RS), we used the multinomial index implemented in the
 <em>SkewCalc</em> package (Ross et al. 2020). The multinomial
 index (<em>M</em>) is related to Nonacs’ binomial index
 <em>B </em>(Nonacs & Hager 2011) and accounts for
 heterogeneity in the number of observational periods in which an
 individual was observed (Ross et al. 2020). We calculated
 <em>M</em> for males, females, and the population as a whole,
 as well as for the different adult sex ratios and group size categories
 for each year. To explore the influence of group size and sex ratio on
 <em>M</em>, for each of the 16 groups for each of the three
 years where reproduction was observed (number of groups reproducing
 n<sub>2012 </sub>= 6; n<sub>2013 </sub>= 11;
 n<sub>2014 </sub>= 13), we assigned a categorical variable
 representing group size (small: n<sub>2012</sub> = 2,
 n<sub>2013 </sub>= 5, n<sub>2014 </sub>= 4;
 medium: n<sub>2012</sub> = 2, n<sub>2013 </sub>=
 3, n<sub>2014 </sub>= 8; large: n<sub>2012</sub> =
 2, n<sub>2013 </sub>= 3, n<sub>2014 </sub>= 1),
 and a category for adult sex ratio (female-biased (&lt;1:
 n<sub>2012</sub> = 1, n<sub>2013 </sub>= 4,
 n<sub>2014 </sub>= 3), equal (1: n<sub>2012</sub>
 = 1, n<sub>2013 </sub>= 3, n<sub>2014 </sub>= 6),
 male-biased (&gt;1: n<sub>2012</sub> = 4, n<sub>2013
 </sub>= 4, n<sub>2014 </sub>= 4)).
description: # Strength of sexual selection and sex roles vary between social groups in
 a coral reef cardinalfish [Access this dataset on
 Dryad](https://doi.org/10.5061/dryad.tdz08kq4h) Rueger et al. (Forthcoming
 2024). Strength of sexual selection and sex roles vary between social
 groups in a coral reef cardinalfish. *The American Naturalist*. The
 dataset contains the data underlying the Bateman gradient, reproductive
 output, and reproductive skew analyses (Bateman gradient file), as well as
 the data underlying the behaviour and trait analyses (aggression and Trait
 data files). We have also included the code for the Bateman gradient
 analysis and figures. Data were collected over five periods, spanning two
 years; October - November 2012 (observational period: 32 days), February -
 March 2013 (21 days), July - August 2013 (16 days), March - April 2014 (23
 days), and September 2014 (9 days), in Kimbe Bay, Papua New Guinea
 (5°30’S, 150°05’E). ## Description of the data and file structure Each
 dataset is available as a separate Excel workbook and includes the data in
 tab 1 and variable descriptions and measurement units are provided in tab
 2. ### Population structure data ("dmographics.csv") Variables
 include: * Year - the year data was recorded * Group - social group ID *
 ASR - adult sex ratio (number of males: number of females) * adult -
 number of adults in the group ### Aggression recorded between individuals
 ("Aggression\_Ruegeretal\_2024.xlsx") Variables include: * Date
 - sampling time period * Site - social group ID * Tag - individual fish ID
 * SL - standard length (mm) * Sex - sex of the individual * Status -
 paired/unpaired status as determined by behavioural observations * Aggr -
 total number of aggressions * AggrOther - aggression towards
 heterospecific * AggrHomo - aggression towards individuals of the same sex
 * AggrHetero - aggression towards individuals of the opposite sex * Clutch
 - number of clutches * NoM - number of mates * ASRcat - Adult sex ratio
 category * adultcat - category for the number of adults in the group *
 density - density of adults (number of adults/group territory size) * ASR
 - Adult sex ratio * adult - number of adults in the group ### Aggression
 recorded per group, summarized ("Group\_aggression\_2024.csv")
 Variables include: * Date - study period * Group - social group ID * ASR -
 adult sex ratio * adult - number of adults in the group * group.agr -
 number of aggresive behaviours counted for each group in each study period
 ### Trait data (including standard length, weight and dorsal fin filament)
 ("Trait\_Ruegeretal\_2024.xlsx") Variables include: * DF -
 dorsal fin filament length (mm) * weight - wet weight (g) * sex - sex as
 determined by dissection and observing gonads * maturity - determined by
 standard length (mm) * Reef - inshore patch reef ID in Kimbe Bay, Papua
 New Guinea * Site - group ID * ID - individual fish ID * SL - standard
 length (mm) * TL - total length (mm) ### Genopytes for the parentage
 analysis, which is what reproductive output is based on
 ("Parentage\_Ruegeretal\_2024.xlsx") Variables include: *
 OffspringID - ID of embryo analysed * clutch - clutch ID * Date - Date
 sampled * Year - Year sampled * Reef - reef ID in Kimbe Bay, Papua New
 Guinea * Group - group ID * Female - female identified as parent * Male -
 male identified as the parent ### COLONY parentage assignments to
 calculate reproductive skew ("parents.csv") Variables include: *
 Offspring ID - unique identifier for each offspring genotype * Clutch -
 clutch ID * Date - sampling period * Year - year of sampling period * Reef
 - the name of the reef where the clutch was sampled * Group - group ID of
 the *S. nematoptera* group where the clutch was sampled * Female/ Male -
 assigned parents according to COLONY ### Bateman gradient data (including
 the number of offspring and mates for each individual and the number of
 adults and sex ratio in each group)
 ("Bateman\_Ruegeretal\_2024.xlsx") Variables include: * ID -
 individual fish id * Year - year of sampling * sex - sex of the individual
 * Group - social group ID that the individual is located in * offspring -
 number of offspring recorded for the individual during the sampling year *
 mates - number of mates recorded for individuals during the sampling year
 * ASR - adult sex ratio in social group * adults - number of adults in a
 social group * ASRcat - adult sex category * adultcat - number of adults
 category ### Standardized Bateman data
 ("Bateman\_Ruegeretal\_2024.xlsx" with meta-data and the working
 csv file "Bateman\_standardized.csv") Variables include: * ID -
 individual fish id * Year - year of sampling * sex - sex of the individual
 * Group - social group ID that the individual is located in * offspring -
 number of offspring recorded for an individual during the sampling year *
 mates - number of mates recorded for individuals during the sampling year
 * ASR - adult sex ratio in social group * adults - number of adults in
 social group * ASRcat - adult sex category * adultcat - number of adults
 category ### R code for Bateman gradient analyses
 ("Bateman\_code-2.R") Bateman_code has the following sections,
 with annotation, description, and session info included: 1. Library 2.
 Data import and useful functions 3. Bayesian modeling 4. Model
 investigation 4a. Investigate model quality 4b. Investigate model output
 5. Plotting ### R code for all other analyses ("Cardinalfish sex
 roles\_aggr\_dimorph\_skew\.Rmd") Contains the following sections,
 with annotation included: 1. Methods 2. Group size and structure 2a. Model
 2b. Figure 3. Sexual dimorphism 3a. Model 3b. Figures 4. Aggression 4a.
 Model 4b. Figure 5. Reproductive Skew 5a. Models