Simulated dataset from 'Quantifying the causal pathways contributing to natural selection'
收藏NIAID Data Ecosystem2026-03-12 收录
下载链接:
http://datadryad.org/dataset/doi%253A10.5061%252Fdryad.j0zpc86c8
下载链接
链接失效反馈官方服务:
资源简介:
This dataset (Antechinus.csv) relates to the worked example in the appendix of the paper:
Henshaw JM, Morrissey MB, Jones AG (2020). Quantifying the causal pathways contributing to natural selection. Evolution (doi:10.1111/evo.14091)
The worked example concerns a hypothetical study of female antechinus. These are small carnivorous marsupials that use torpor to reduce energy consumption from late summer to early winter. They reproduce once per year in late winter or early spring, following which most individuals die. We suppose that researchers tracked female antechinus from mid summer to the end of the breeding season. They recorded the animals' body size, their date of last torpor, whether they survived to breed, their number of mates, and their fecundity. I simulated the dataset resulting from this hypothetical study in Wolfram Mathematica (see Methods below). In the above paper, we analyse the causal structure of natural selection in this dataset (the R code for the causal analysis is included here as 'AntechinusAnalysis.R').
The variables in the dataset are: body size in unspecified units (BodySize); the date of last torpor (TorporDate), standardized as the number of days before/after an unspecificed reference date; whether the individual survived to breed, given as a binary variable (Survival); an individual's number of mates (Mates); and her fecundity (Fecundity).
Methods
This dataset was simulated in Wolfram Mathematica version 12.1.0.0 using the following code, which has been uploaded to Dryad alongside the dataset (note that the details of generating this entirely hypothetical dataset are not important for understanding the worked example in the accompanying paper):
(* Functions that generate Poisson- and Bernoulli-distributed random variables with non-negative parameters *)
PoissonInteger[lambda_] :=
If[lambda > 0, RandomInteger[PoissonDistribution[lambda]], 0];
BernoulliInteger[p_] :=
If[0 < p < 1, RandomInteger[BernoulliDistribution[p]],
If[p >= 1, 1, 0]];
(* Sample size*)
n = 10000;
(* Simulate body size as a random normal variable *)
BodySize = Round[RandomReal[NormalDistribution[100, 5], n], .1];
(* Simulate torpor date as a random normal variable that is correlated with body size; round off to nearest integer *)
TorporDate =
Round[(BodySize - 100)*1/5 +
RandomReal[NormalDistribution[0, 4], n], 1];
(* Simulate survival to breeding as a Bernoulli random variable that depends on torpor date and body size *)
Survival =
BernoulliInteger /@ (-TorporDate/100 + (BodySize - 100)/150 + 0.6);
(* Simulate the number of mating as a Poisson integer depending on body size; the number of mates is necessarily zero for individuals that do not survive to breed *)
Mates = Survival*(PoissonInteger /@ (BodySize/30));
(* Simulate fecundity as a Poisson random variable depending on body size and the number of mates *)
Fecundity =
Table[PoissonInteger[
BodySize[[i]]*Mates[[i]]/(Mates[[i]] + 1)/20], {i, 1, n}];
(* Store results in a table *)
DataTable =
Join[{{"BodySize", "TorporDate", "Survival", "Mates", "Fecundity"}},
Transpose[{BodySize, TorporDate, Survival, Mates,
Fecundity}]];
本数据集(Antechinus.csv)对应论文附录中的实操案例:
Henshaw JM、Morrissey MB、Jones AG(2020)于期刊《Evolution》发表的论文《量化影响自然选择的因果通路》(Quantifying the causal pathways contributing to natural selection,DOI: 10.1111/evo.14091)。
该实操案例围绕一项假想的雌性宽足袋鼩(Antechinus)研究展开。这类小型肉食性有袋动物会在夏末至初冬期间通过蛰伏降低能量消耗。它们每年仅在晚冬或早春繁殖一次,繁殖后绝大多数个体便会死亡。
研究人员假想从仲夏开始追踪雌性宽足袋鼩直至繁殖季结束,记录了个体的体型、末次蛰伏日期、是否存活至繁殖季、交配对象数量以及繁殖力。本数据集由该假想研究生成,已通过Wolfram Mathematica软件模拟得到(详见下述方法)。在上述论文中,研究者针对该数据集的自然选择因果结构开展了分析(因果分析所用的R代码已随本数据集一同提供,文件名为"AntechinusAnalysis.R")。
数据集包含以下变量:
以无指定单位计量的体型(BodySize);
末次蛰伏日期(TorporDate),经标准化处理为相对于某一未指定参考日期的前后天数;
是否存活至繁殖季(Survival),为二分类变量;
个体的交配对象数量(Mates);
繁殖力(Fecundity)。
方法
本数据集于Wolfram Mathematica 12.1.0.0版本中模拟生成,所用代码已与数据集一同上传至Dryad数据仓储(需注意:理解该配套论文中的实操案例无需关注该完全假想数据集的生成细节):
(* 生成具有非负参数的泊松分布与伯努利分布随机变量的函数 *)
PoissonInteger[lambda_] :=
If[lambda > 0, RandomInteger[PoissonDistribution[lambda]], 0];
BernoulliInteger[p_] :=
If[0 < p < 1, RandomInteger[BernoulliDistribution[p]],
If[p >= 1, 1, 0]];
(* 样本量 *)
n = 10000;
(* 将体型模拟为正态分布随机变量 *)
BodySize = Round[RandomReal[NormalDistribution[100, 5], n], .1];
(* 将蛰伏日期模拟为与体型相关的正态分布随机变量,结果保留一位小数 *)
TorporDate =
Round[(BodySize - 100)*1/5 +
RandomReal[NormalDistribution[0, 4], n], 1];
(* 将存活至繁殖季的状态模拟为依赖于蛰伏日期与体型的伯努利分布随机变量 *)
Survival =
BernoulliInteger /@ (-TorporDate/100 + (BodySize - 100)/150 + 0.6);
(* 将交配对象数量模拟为依赖于体型的泊松分布整数;未存活至繁殖季的个体交配对象数量必然为0 *)
Mates = Survival*(PoissonInteger /@ (BodySize/30));
(* 将繁殖力模拟为依赖于体型与交配对象数量的泊松分布随机变量 *)
Fecundity =
Table[PoissonInteger[
BodySize[[i]]*Mates[[i]]/(Mates[[i]] + 1)/20], {i, 1, n}];
(* 将结果存储至数据表 *)
DataTable =
Join[{{"BodySize", "TorporDate", "Survival", "Mates", "Fecundity"}},
Transpose[{BodySize, TorporDate, Survival, Mates, Fecundity}]];
创建时间:
2020-09-18



