SimpLi: Simulation-Based Standardization of Serum Lithium Concentrations to 12 Hours
收藏资源简介:
Overview This repository provides the full simulation dataset and R code accompanying the study on standardization of serum lithium concentrations measured at non-12-hour time points to a 12-hour reference level. The project introduces SimpLi, a simulation-based and model-driven framework that allows recalculation of serum lithium concentrations measured at arbitrary times after the last dose to a standardized 12-hour level, which is the conventional reference in clinical practice. All data provided here are fully simulated and do not contain any real patient information. Contents Files SimpLi.RMain R script containing: generation of simulation datasets primary (sqrt-normal) and sensitivity (lognormal) scenarios dose generation with predefined correlation structure model training and validation multiplicative standardization formula final web-ready SimpLi() function dat_sqrt_with_discrete_dose_300.csvPrimary simulated dataset (n = 1000) with: discrete lithium doses (300 mg step) serum lithium concentrations time since last dose (hours) time bins matching published summary statistics Simulation Design Sample size: 1000 simulated observations Time since last dose: 0–24 hours Deterministic design ensuring interquartile range 11–14 hours Pronounced peak at 12 hours Serum lithium concentration (seLi, mEq/L): Primary scenario: sqrt-normal distribution Sensitivity scenario: lognormal distribution Dose (dose_mg, mg/day): Generated to match published mean and SD within time bins Target correlation with serum lithium: r ≈ 0.40 Discretized to 300 mg steps with within-bin recalibration Target summary statistics were derived from published aggregate data (Table 1 in the associated article). Statistical Modeling Outcome: serum lithium concentration (mEq/L) Predictors: time since last dose (hours) daily lithium dose (mg/day) Model: seLi=β0+βt⋅t+βd⋅dose\sqrt{\text{seLi}} = \beta_0 + \beta_t \cdot t + \beta_d \cdot \text{dose}seLi=β0+βt⋅t+βd⋅dose Validation strategy: 70/30 train–test split stratified by time bins 5-fold cross-validation on the training set Performance metrics: RMSE, MAE, R² Evaluation both overall and by time bin Multiplicative Standardization to 12 Hours Standardization from an observed concentration CmeasC_{\text{meas}}Cmeas at time tmeast_{\text{meas}}tmeas to a 12-hour level is performed as: C12=C^12×CmeasC^measC_{12} = \hat{C}_{12} \times \frac{C_{\text{meas}}}{\hat{C}_{\text{meas}}}C12=C^12×C^measCmeas where: C^meas\hat{C}_{\text{meas}}C^meas is the model-predicted concentration at the observed time C^12\hat{C}_{12}C^12 is the model-predicted concentration at 12 hours for the same dose This approach preserves individual deviations while adjusting for time-dependent pharmacokinetics. Example Usage (R) source("SimpLi.R") SimpLi( C_meas = 0.90, t_meas = 14.9, dose_mg = 450 ) Intended Use Methodological research on lithium pharmacokinetics Simulation studies and sensitivity analyses Reproducibility of results reported in the accompanying article Educational and methodological demonstration of standardization approaches This code and dataset are not intended for direct clinical decision-making without external validation. Data Availability All data in this repository are synthetic (simulated) and were generated exclusively for methodological and reproducibility purposes.No real patient data were used. Author Evgeny KasyanovEmail: i@kasyan.ru
### 概述 本仓库完整提供了配套于一项研究的模拟数据集与R代码,该研究旨在将非12小时采血时点测得的血清锂浓度(serum lithium concentration)校准至临床常用的12小时参考水平。 本项目提出了SimpLi——一款基于模拟与模型驱动的校准框架,可将末次给药后任意时点测得的血清锂浓度重新计算为标准化的12小时参考浓度,而12小时参考浓度是临床实践中的常规参考标准。 本仓库提供的所有数据均为完全模拟生成,未包含任何真实患者信息。 ### 内容 #### 文件 ##### SimpLi.R 主R脚本,包含以下功能: 1. 模拟数据集生成 2. 主效应(平方根正态)与敏感性分析(对数正态)场景构建 3. 具备预设相关结构的给药剂量生成 4. 模型训练与验证 5. 乘法校准公式实现 6. 最终可用于网页部署的SimpLi()函数 ##### dat_sqrt_with_discrete_dose_300.csv 主模拟数据集(样本量n=1000),包含以下字段: - 离散化锂给药剂量(300mg步长) - 血清锂浓度 - 末次给药后时长(小时) - 与已发表汇总统计量匹配的时间区间 #### 模拟设计 - 样本量:1000条模拟观测值 - 末次给药后时长范围:0~24小时 - 采用确定性设计确保四分位间距为11~14小时,在12小时时点处呈现显著浓度峰值 - 血清锂浓度(seLi,单位:mEq/L): - 主场景:服从平方根正态分布 - 敏感性场景:服从对数正态分布 - 每日锂给药剂量(dose_mg,单位:mg/day): - 生成时匹配各时间区间内已发表的均值与标准差 - 目标与血清锂浓度的相关系数r≈0.40 - 以300mg为步长离散化,并在区间内进行重新校准 - 目标汇总统计量源自已发表的汇总数据(见配套论文的表1) #### 统计建模 - 结局变量:血清锂浓度(单位:mEq/L) - 预测变量: 1. 末次给药后时长(小时) 2. 每日锂给药剂量(mg/day) - 模型设定为:$sqrt{ ext{seLi}} = eta_0 + eta_t cdot t + eta_d cdot ext{dose}$,其中$ ext{seLi}$代表血清锂浓度,$t$为末次给药后时长,$ ext{dose}$为每日锂给药剂量,$eta_0、eta_t、eta_d$为模型回归系数。 ##### 验证策略 1. 按时间区间分层的70/30训练集-测试集划分 2. 训练集上的5折交叉验证 3. 性能评估指标:均方根误差(Root Mean Square Error, RMSE)、平均绝对误差(Mean Absolute Error, MAE)、决定系数(R²) 4. 分别在整体队列与各时间区间内进行模型性能评估 #### 12小时乘法校准方法 将观测时点$t_{ ext{meas}}$处测得的浓度$C_{ ext{meas}}$校准至12小时参考水平的乘法校准公式如下: $$C_{12} = hat{C}_{12} imes frac{C_{ ext{meas}}}{hat{C}_{ ext{meas}}}$$ 其中: - $hat{C}_{ ext{meas}}$为模型在观测时点$t_{ ext{meas}}$处预测的浓度 - $hat{C}_{12}$为同一给药剂量下模型在12小时时点处预测的浓度 该方法在调整时间依赖性药代动力学(pharmacokinetics)特征的同时,保留个体间的浓度偏差。 #### R语言示例用法 r source("SimpLi.R") SimpLi( C_meas = 0.90, t_meas = 14.9, dose_mg = 450 ) #### 预期用途 1. 锂剂药代动力学的方法学研究 2. 模拟研究与敏感性分析 3. 复现配套论文中报告的研究结果 4. 用于展示校准方法的教学与方法学演示 本代码与数据集未经外部验证前,不得直接用于临床决策制定。 #### 数据可用性 本仓库中的所有数据均为合成(模拟)数据,仅用于方法学研究与结果复现目的,未使用任何真实患者数据。 #### 作者 Evgeny Kasyanov 电子邮箱:i@kasyan.ru



