DOI: 10.5061/dryad.pnvx0k723
title: Data from: Two’s company, three’s a crowd: Social situations alter group dynamics in the maritime earwig (<em>Anisolabis maritima</em>)

description: Sexual selection can lead to dimorphic traits that can affect an
 individual’s behavior, including how individuals respond to different
 social situations. We examined how sex and body size influence aggression
 and courtship in different-sized groups of the maritime earwig, Anisolabis
 maritima (Order Dermaptera), an insect in which males and females differ
 morphologically and behaviorally. In this study, we videotaped mixed-sex
 pairs and trios of earwigs for two hours to determine the effects of sex
 and size on their interactions. We found that, in pairs, females were more
 aggressive than males, and both sexes showed size-based aggression.
 However, sex was a stronger determinant of aggression in male-biased
 trios, whereas sex and size were more important in female-biased trios.
 Regarding courtship, neither larger nor smaller males were more likely to
 engage in copulatory activity in pairs. The presence of intrasexual
 selection altered the results in the two types of trios. In male-biased
 trios, the larger male had more copulatory opportunities as his size
 relative to his rival increased, indicating that intrasexual domination by
 larger males can overcome possible female preferences for smaller males.
 Interestingly, in female-biased trios, there were no such patterns since
 copulatory opportunities were relatively rare, the likely result of
 elevated aggression with two interacting females. Our results indicate
 that sex and size affect both aggression and sexual behavior differently
 based on group size and composition, which highlights the need to examine
 behaviors in a variety of social contexts.
description: # Data from: Two’s company, three’s a crowd: Social situations alter group
 dynamics in the maritime earwig (*Anisolabis maritima*) #### 1. Data
 Structure and File Preparation The original dataset was compiled as a
 single stacked data frame in Microsoft Excel (.xlsx format), with each row
 representing an individual observation within a behavioral trail. For
 analysis and data sharing, the dataset was separated by trial type:  Pairs
 2M1F Trios (two males, one female),  2F1M Trios (two females, one male)
 Each trial type was exported as a separate comma-separated values (.csv)
 file to facilitate analysis in R. We have included our original data set
 called OriginalData.xlsx, as well as the .csv files that correspond to
 each of the three worksheets within this Excel file. #### 2. Aggression
 Analyses and Data Organization For aggression analyses, we maintained the
 stacked data structure and used random effects to account for repeated
 measures within trials and IDs. Files used for these analyses are labeled
 as ‘Original’ (PairsOriginal.csv, Trios2M1FOriginal.csv,
 Trios2F1MOriginal.csv). Across both Pairs and Trios datasets, files
 include columns for:  Sex Size (as described in Methods),  Relative Size
 (as described in Methods),  Individual ID Behavioral variables (described
 using full descriptive names) , and a column recording copulatory behavior
 with end time, which was not used in statistical analyses due to the low
 frequency of copulation events across trials. #### **Aggression summary
 variables** Two aggression-related summary columns are presented in these
 files:  AggressionAll – numerical percentage of aggressive acts relative
 to all recorded interactions AggressionMeaningful – numerical percentage
 of aggressive acts relative to all interactions excluding incidental
 contact. These columns were not used in the statistical analyses. Instead,
 we recalculated aggression from the underlying behavioral data and modeled
 it as a proportion using a beta distribution, as detailed in Methods. ####
 **TotalInteractions** Sum of: I + OS + DS + A + FF #### **Trio-specific
 variables** In trio datasets (Trios2M1FModified.csv and
 Trios2F1MModified.csv), additional columns were included to facilitate
 tracking of individual identity and interaction direction: 
 SizeClassification (column E): size class designationof same-sex
 individuals within a trial; used solely for bookkeeping, as size and
 relative size are continuous variables. dots (column G): number of
 white-out dots applied to individuals to distinguish same-sex individuals
 in video recordings Directional interaction columns (K – L): Indicate the
 direction of interactions and whether behaviors were directed towards a
 member of the same or opposite sex (col L). These columns were not used
 duringthe aggression analysis. LargeSize / SmallSize / MaleSize /
 FemaleSize: Pronotum width (mm) of each individual in the trio. Pronotum
 width (mm) / Size: Same measurement — pronotum width in millimeters. 6th
 Abdominal width (mm): Width of the 6th abdominal segment. LS: Large vs
 Small; LM: Large vs Medium; SL: Small vs Large; SM: Small vs Medium; ML:
 Male Large vs Male Small; MS: Male Small vs Male Large; LF: Large Male vs
 Female; SF: Small Male vs Female; FL: Female vs Large Male; FS: Female vs
 Small Male #### 3. Mating Analyses and Data Organization For mating
 analyses (mate preference and predicting copulatory behavior), we manually
 reshaped datasets from the original stacked format to a trial -level wide
 format. These files are labeled as ‘Modified” (e.g., PairsModified.csv).
 This restructuring allowed measurements and behaviors from both
 individuals in a pair to be reshaped within a single row, facilitating
 analyses of mating outcomes. #### **Variable naming conventions – Pairs**
 In PairsModified datasets:  Column names beginning with ‘F’ refer to the
 female in the pair. Column names beginning with ‘M’ refer to the male in
 the pair. FF (col H): refers to the presence or absence of
 forceps-to-forceps contact during the trial. FFCount (col I): refers to
 the number of forceps-to-forceps contact events observed during a trial.
 This was not used in our analyses. The prefix-based naming convention
 distinguishes sex-specific morphological measurements, relative size
 metrics, behavioral counts, and aggression summaries within pair trials.
 All variables retain the same definitions and calculation methods as in
 the original stacked datasets; only the data structure and column naming
 were modified. #### **Variable naming conventions – Trios** For mating and
 courtship analyses in Trio,s we used a distinct naming convention to track
 identity, sex, and directionality of interactions. Most behavioral columns
 follow a four-character structur e:  First two letters indicate the
 individuals involved: L = Large same-sex individual (males in 2M1F,
 females in 2F1M) S = Small same-sex individual (males in 2M1F, females in
 2F1M) M or F = lone-sex individual (male in 2F1M, female in 2M1F) For
 directional behaviors (strikes and retreats), letter order denotes actor
 recipient Second two letters indicate behavior OS – offensive strikes, DS
 – defensive strikes, TS – total strikes, IC – incidental contact, A -
 antennation, Ret – retreats. Examples LS_TS: Large same-sex individual, 
 Small same-sex individual, total strikes SM_A: Small same sex individual
 with lone-sex Male, antennation #### **Special variables** Several columns
 do not follow the general naming convention and are documented
 separately:  SizeClass (column F): initial size class of the lone-sex
 individual; reassigned later and not used in analyses XYRelative (columns
 G – L): relative size where X is the focal individual and Y is the
 opponent, following the same identity codes described above FF (column
 AT): binary indicator of forceps-to-forceps contact during a trial FF_OSex
 (column AU): indicates which same-sex individual engaged in forceps to
 forceps contact with the lone-sex individual (L = Large, S = Small, B =
 Both) LS_FF_Count, LM_FF_Count, SM_FF_count (columns AV – AX): counts of
 forceps-to-forceps contact events by dyad. Aggression summary columns
 (cols BE-BP, AA - AggressionAll, AM - AggressionMeaningful) follow the
 same definitions described for Aggression analyses. These summary columns
 were not used in courtship or mating analyses Time to 1st copulation:
 Minutes until first mating. \#copulations / forcep-forcep contacts: Number
 of mating-related events. Total duration of copulations: Total mating
 time. % time in contact (X/120 min): Percent of 2-hour trial spent in
 contact. Right vs left penis extended: Morphological mating variable.
 Length of extended virga: Measurement of reproductive organ length. ####
 4. Other Notes Retreat behaviors (movement away from an advancing
 opponent) were recorded in trios but were not used in any analysis.  Size
 was measured in cm; all other variables are unitless