Data from: Condition-dependent responses to risk in a small mammal
Data files
Mar 02, 2026 version files 68.20 KB
-
animals_for_cages_from_seminatural_enclosures.csv
3.14 KB
-
data_combine_KLH.csv
31.76 KB
-
PredationFQ.R
22.61 KB
-
README.md
10.68 KB
Abstract
Animal responses to risky situations are shaped by both environmental (external) cues and internal states such as body condition. Recent meta-analyses indicate that individuals in better condition take fewer risks, consistent with the idea that they protect their assets. However, these results rely mostly on short-term, standard laboratory assessments of threat response. Consequently, it remains unclear whether variation in condition influences risk-taking consistently across different ecological contexts. Here, we address this by testing whether house mice from high- or standard-quality food environments, and mice of different weights (used as a proxy for condition), vary in their risk-taking behaviour across two scenarios. First, we quantified foraging behaviour in low- and high-risk areas in the absence of predation cues. We then introduced predator stimuli to assess how foraging changed under increased perceived threat. Overall, we aimed to determine whether the effect of risk on foraging depended on diet quality and body mass. Mice originating from the high-quality food environment reduced foraging in the high-risk area under predation cues significantly more than those from standard-quality environments. In contrast, heavier individuals, irrespective of food quality, foraged less and for shorter periods in the high-risk area. Last, when predation cues were introduced, these heavier mice increased their foraging effort in the high-risk area but did not spend more time there. These findings indicate condition-dependent responses to risk and support core predictions of the asset-protection hypothesis. Importantly, they highlight that different traits related to individual state or condition may shape different responses to ecological unpredictability, such as predation risk. This variation as a function of different variables related to the state warrants further investigation.
Overview
This project investigated the short-term behavioral responses of wild house mice (Mus musculus domesticus) to predation risk and whether these responses were influenced by individual condition (e.g., body weight) or the quality of their developmental environment. Behavioral foraging data were collected from a semi-natural enclosure experiment under varying predation-risk treatments.
This repository includes the raw and processed data, metadata, and R scripts used to perform statistical analyses for the manuscript.
The study investigated how wild house mice (Mus musculus domesticus) adjust their foraging behaviour under predation risk, and whether these responses were influenced by individual body condition (body mass) or by the quality of their developmental food environment.
Behavioural data were collected from a semi-natural enclosure experiment under control (no predator cue) and predation (owl cue) conditions.
Repository Structure
The repository is organized as follows:
Predation_project/
├── Code/
│ └── analysis.R
└── Data/
├── data_combine_KLH.csv
└── animals_for_cages from_seminatural_enclosures.csv
- Code/ — contains the R script used for data processing, statistical analysis, and figure generation.
- Data/ — contains all data files used in the analyses.
- The project is designed so that the R script works using relative paths, ensuring full reproducibility on any system.
To reproduce the analyses:
-
Open R or RStudio.
-
Set your working directory to the unzipped project folder (
Predation_project/). -
Run the following:
source("Code/PredationFQ.R")
The script automatically sets the working directory Data/ and loads the necessary files.
Data Files
1. data_combine_KLH.csv
Primary dataset containing individual-level foraging behaviour data collected during the experiment.
Each row represents behavioural observations for a single mouse (ID) on a specific experimental night.
Each individual appears three times in the dataset, corresponding to:
- Night 1: Control condition (no predator cue)
- Nights 2–3: Predation treatment (presence of owl calls)
Data are in long format (repeated measures per ID).
2. animals_for_cages_from_seminatural_enclosures.csv
Contains mouse body mass measurements from individuals before the experiment from the different developmental food-quality environments.
Variable Description
This dataset contains behavioural, movement, food-consumption, and body-mass measurements from experimental trials in mice exposed to different developmental food-quality environments and predator treatments.
- Identifiers and Metadata
| Variable | Description | Units / Notes |
|---|---|---|
Test |
Experimental trial or batch identifier | Numeric |
Date |
Date of behavioural recording | DD.MM.YY |
Min |
Time interval analysed during the night | hh:mm:ss range |
ID |
Unique identifier for each mouse | Primary key |
room |
Experimental room or enclosure identifier | Numeric/code |
food |
Developmental food treatment: SQ (standard-quality) or HQ (high-quality) |
Treatment group |
night |
Experimental night number (1 = control; 2–3 = predator cue exposure) | Integer |
treat |
Predator treatment: control (no predator cue) or owl (predation cue) |
Experimental condition |
sex |
Biological sex of an individual | m = male; f = female |
- Body Mass Measures
| Variable | Description | Units |
|---|---|---|
Start_Date |
Date body mass measurement period began | DD.MM.YY |
End_Date |
Date body mass measurement period ended | DD.MM.YY |
Start_Weight |
Body mass before the experimental trial | grams (g) |
End_Weight |
Body mass after the experimental trial | grams (g) |
Weight_Difference |
Change in body mass (End_Weight − Start_Weight) |
grams (g) |
- Foraging Behaviour
| Variable | Description | Units |
|---|---|---|
first_move |
Latency to first emergence from nest | seconds |
number_HQ |
Number of visits to high-quality (HQ) food patches | count |
time_spent_HQ |
Total time spent foraging in HQ patch | seconds |
number_SQ |
Number of visits to standard-quality (SQ) food patch | count |
time_spent_SQ |
Total time spent foraging in the SQ patch | seconds |
- Nest and Tube Behaviour
| Variable | Description | Units |
|---|---|---|
number_tube |
Number of entries into the tube/transition area | count |
time_spent_tube |
Time spent in the tube area | seconds |
number_nest |
Number of nest visits | count |
time_spent_nest |
Time spent inside the nest | seconds |
time_resting |
Time inactive outside nest | seconds |
- Movement Behaviour
| Variable | Description | Units |
|---|---|---|
number_moving_safe |
Movement events occurring in sheltered/safe areas | count |
time_moving_safe |
Time spent moving in safe areas | seconds |
number_moving_unsafe |
Movement events occurring in exposed/unsafe areas | count |
time_moving_unsafe |
Time spent moving in unsafe areas | seconds |
total_time_moving |
Total movement time (safe + unsafe) | seconds |
time_active |
Total active time across all behaviours | seconds |
- Food Consumption Measures
Food intake was recorded separately for left (L) and right (R) food trays.
| Variable | Description | Units |
|---|---|---|
SQ_Start_R, SQ_End_R |
Amount of standard-quality food before and after trial (right tray) | grams (g) |
SQ_eaten_R |
Standard-quality food consumed from the right tray | grams (g) |
SQ_Start_L, SQ_End_L |
Amount of standard-quality food before and after trial (left tray) | grams (g) |
SQ_eaten_L |
Standard-quality food consumed from the left tray | grams (g) |
total_SQ_eaten |
Total standard-quality food consumed (L + R) | grams (g) |
HQ_Start_R, HQ_End_R |
Amount of high-quality food before and after trial (right tray) | grams (g) |
HQ_eaten_R |
High-quality food consumed from the right tray | grams (g) |
HQ_Start_L, HQ_End_L |
Amount of high-quality food before and after trial (left tray) | grams (g) |
HQ_eaten_L |
High-quality food consumed from the left tray | grams (g) |
total_HQ_eaten |
Total high-quality food consumed (L + R) | grams (g) |
total_food_eaten |
Total food consumed (HQ + SQ combined) | grams (g) |
- Missing Data
- Missing values are coded as
NA. - Missing values occur when:
- individuals did not emerge from the nest,
- video tracking failed,
- Food intake could not be reliably measured.
Code and Software
All analyses were conducted in R (version 4.3.1) using the following packages:
| Package | Version | Purpose |
|---|---|---|
tidyverse |
1.3.2 | Data manipulation and visualization |
lme4 |
1.1-35 | Linear mixed-effects models |
ggplot2 |
3.4.4 | Graphical plots |
performance |
0.10.2 | Model diagnostics |
sjPlot, emmeans, rptR, tidyr, ggpubr, readxl |
- | Model summaries, estimated means, repeatability, plotting, and data import |
Script file
Code/analysis.R
Performs:
- Data import and preprocessing
- Model fitting (GLMMs and LMMs)
- Diagnostic checks
- Visualization and summary figure generation
Workflow Summary
-
Load the data:
read_csv("Data/data_combine_KLH.csv") read_csv("Data/animals_for_cages from_seminatural_enclosures.csv") -
Run analyses and figures:
source("Code/PredationFQ.R") -
Outputs include:
- Model summaries (LMMs, GLMMs)
- Diagnostic plots
- Figures used in the manuscript
Contact
For questions regarding data or code, contact:
[Karem Lopez-Hervas]
[lopezhervas@evolbio.mpg.de]
Notes for Users
- The project uses relative paths (
setwd("Data")), so it can be run on any computer without editing file locations. - To ensure reproducibility, please maintain the folder structure exactly as shown above.
- All analyses reproduce the results and figures reported in the Ethology manuscript.
