# 纵向数据分析

纵向数据分析是用于分析同一批研究对象随时间反复测量所得数据的统计方法总称，用于在医学、社会与行为研究中建模个体内的变化以及同一个体各次观测之间的相关性。相较于横断面分析，其核心优势在于能把个体随时间发生的变化与某一时点上个体之间的差异区分开来，而单次快照无法做到这一点。<sup>[1](https://scsru.github.io/Modules/introduction-to-longitudinal-data.html)</sup> 在线性混合模型中，一个系数（\( \beta_{1} \)）刻画横断面效应，即个体之间的差异；另一个系数（\( \beta_{2} \)）刻画纵向效应，即个体内随时间的平均变化。<sup>[2](https://pmc.ncbi.nlm.nih.gov/articles/PMC10507671/)</sup> 其核心统计问题在于：同一个人的反复观测之间是相关的，而标准回归推断假设观测相互独立。<sup>[3](https://sites.globalhealth.duke.edu/rdac/wp-content/uploads/sites/27/2020/08/Core-Guide_Correlation-Structures-in-Longitudinal-Data-Analysis_09-19-17.pdf)</sup>

| 关键事实 | 细节 |
|---|---|
| 估计的是什么 | 个体内随时间的变化，并与个体间（队列）差异区分开来<sup>[1](https://scsru.github.io/Modules/introduction-to-longitudinal-data.html)</sup> |
| 核心模型族 | 线性混合模型、广义线性混合模型（GLMM）、广义估计方程（GEE）<sup>[4](https://pmc.ncbi.nlm.nih.gov/articles/PMC2971698/)</sup> |
| 为什么相关性重要 | 忽略个体内的正相关，会使不随时间变化的协变量的第一类错误率膨胀，并使随时间变化的协变量的第二类错误率膨胀<sup>[3](https://sites.globalhealth.duke.edu/rdac/wp-content/uploads/sites/27/2020/08/Core-Guide_Correlation-Structures-in-Longitudinal-Data-Analysis_09-19-17.pdf)</sup> |
| 缺失数据 | 完全似然混合模型在随机缺失（MAR）下有效；GEE 要求完全随机缺失（MCAR）<sup>[4](https://pmc.ncbi.nlm.nih.gov/articles/PMC2971698/)</sup> |
| 样本量 | 在可交换相关 \( \rho \) 且每个个体有 \( n \) 次观测时，设计效应为 \( D_{\text{eff}} = \{1 + (n-1)\rho\}/n \)<sup>[5](https://bookdown.org/charlotte_micheloud93/Clinical_Biostatistics/analysis-of-longitudinal-outcomes.html)</sup> |
| 奠基性论文 | 莱尔德与韦尔，《Random-Effects Models for Longitudinal Data》，《生物统计学》，1982 年<sup>[6](https://doi.org/10.2307/2529876)</sup> |

## 工作原理

纵向模型同时设定两件事：一个关于结局均值的模型，以及一个关于个体内相关性的模型。有两套框架占据主导地位。GEE 设定一个边际均值模型 \( g(\mathrm{E}[Y_{ij} \mid x_{ij}]) = x_{ij} \cdot \beta \)，再加上一个工作相关模型 \( \mathrm{Corr}[Y_{ij}, Y_{ij0}] = \rho(\alpha) \)，用于同一个体上的观测 j 与 j₀。<sup>[7](https://si.biostat.washington.edu/sites/default/files/modules/11_notes.pdf)</sup> GLMM 则设定一个条件均值 \( g(\mathrm{E}[Y_{ij} \mid x_{ij}, b_i]) = x_{ij} \cdot \beta + z_{ij} \cdot b_i \)，其中随机效应 \( b_i \sim N(0, D) \) 诱导出相关性。<sup>[7](https://si.biostat.washington.edu/sites/default/files/modules/11_notes.pdf)</sup>

两套框架估计的是不同的量。GEE 估计总体平均的对比，而 GLMM 估计个体特异的对比；只有当结局服从高斯分布且使用恒等连接时，两者才重合。<sup>[7](https://si.biostat.washington.edu/sites/default/files/modules/11_notes.pdf)</sup><sup> • </sup><sup>[3](https://sites.globalhealth.duke.edu/rdac/wp-content/uploads/sites/27/2020/08/Core-Guide_Correlation-Structures-in-Longitudinal-Data-Analysis_09-19-17.pdf)</sup> GEE 在推导估计方程时并不指定同一个体各次观测的联合分布，而当结局服从多元高斯分布时，这些方程退化为通常的得分方程。<sup>[8](https://biostat.jhsph.edu/~fdominic/teaching/bio655/references/extra/liang.bka.1986.pdf)</sup>

如果个体内相关为正而被忽略，例如直接拟合普通最小二乘，标准误就会被低估。这会抬高性别、种族这类不随时间变化的协变量的第一类错误率，并抬高随时间变化的协变量的第二类错误率。<sup>[3](https://sites.globalhealth.duke.edu/rdac/wp-content/uploads/sites/27/2020/08/Core-Guide_Correlation-Structures-in-Longitudinal-Data-Analysis_09-19-17.pdf)</sup> 相关性既可以通过指定 G 结构的随机效应来处理，也可以直接在个体内误差的 R 矩阵上放置一个相关结构。<sup>[3](https://sites.globalhealth.duke.edu/rdac/wp-content/uploads/sites/27/2020/08/Core-Guide_Correlation-Structures-in-Longitudinal-Data-Analysis_09-19-17.pdf)</sup>

## 实施方式

设计先行：研究者要先确定研究时长、访视频率，以及样本量、功效和每个个体的观测次数。<sup>[2](https://pmc.ncbi.nlm.nih.gov/articles/PMC10507671/)</sup> 在固定的治疗期内增加等间隔测量，通常并不会提高检出真实治疗效应的概率，因此访视频率应当服务于模型，而不是反过来。<sup>[2](https://pmc.ncbi.nlm.nih.gov/articles/PMC10507671/)</sup>

推荐的拟合流程是：清洗数据、检查假设、建模时间趋势、选择协方差结构，然后进行变量选择，并按需迭代中间步骤。<sup>[1](https://scsru.github.io/Modules/introduction-to-longitudinal-data.html)</sup> 对线性混合模型而言，限制最大似然（REML）是首选的估计方法，因为在最大似然（ML）下标准误会被低估。<sup>[3](https://sites.globalhealth.duke.edu/rdac/wp-content/uploads/sites/27/2020/08/Core-Guide_Correlation-Structures-in-Longitudinal-Data-Analysis_09-19-17.pdf)</sup> 协方差结构设定错误，通常使标准误和假设检验产生偏差，而非使固定效应估计本身产生偏差，因此常用 AIC 或似然比检验来比较候选结构。<sup>[19](https://www.tandfonline.com/doi/abs/10.1080/00273170701540537)</sup><sup> • </sup><sup>[3](https://sites.globalhealth.duke.edu/rdac/wp-content/uploads/sites/27/2020/08/Core-Guide_Correlation-Structures-in-Longitudinal-Data-Analysis_09-19-17.pdf)</sup>

对 GEE 而言，无论选择何种工作相关，回归系数估计随样本量增大总体上仍然有效，但基于模型的标准误要求相关模型正确；经验（三明治）标准误作为标准功能报告，可提供有效的不确定性估计。<sup>[9](https://faculty.washington.edu/heagerty/Courses/VA-longitudinal/private/LDAchapter.pdf)</sup> 按照高斯—马尔可夫最优估计理论，估计效率最高的工作相关选择就是真实的相关结构。<sup>[9](https://faculty.washington.edu/heagerty/Courses/VA-longitudinal/private/LDAchapter.pdf)</sup>

两组纵向比较的样本量要用设计效应来校正。在可交换相关 \( \rho \) 且每位患者有 \( n \) 次观测时，

\[ D_{\text{eff}} = \{1 + (n-1)\rho\}/n, \]

所需样本量等于标准横断面样本量乘以该因子。<sup>[5](https://bookdown.org/charlotte_micheloud93/Clinical_Biostatistics/analysis-of-longitudinal-outcomes.html)</sup> 对任意相关矩阵 R，设计因子为 \( D_{\text{eff}} = \{\boldsymbol{1}^\top \cdot \boldsymbol{R}^{-1} \cdot \boldsymbol{1}\}^{-1} \)。<sup>[5](https://bookdown.org/charlotte_micheloud93/Clinical_Biostatistics/analysis-of-longitudinal-outcomes.html)</sup> 当观测在时间上分布得更开时，纵向效应的标准误更小；而当访视依次进行时，截距和横断面项的标准误更小；随着个体数和观测数的增加，这些标准误都会下降。<sup>[2](https://pmc.ncbi.nlm.nih.gov/articles/PMC10507671/)</sup>

## 起源

纵向数据的两阶段随机效应框架由南·M. 莱尔德与詹姆斯·H. 韦尔在论文《Random-Effects Models for Longitudinal Data》中提出，发表于 1982 年的《生物统计学》。<sup>[6](https://doi.org/10.2307/2529876)</sup><sup> • </sup><sup>[10](https://people.stat.sc.edu/hansont/stat740/LairdWare1982.pdf)</sup> 该文提出一个一般性的模型族，把增长模型和重复测量模型都作为特例纳入其中，适用于高度不平衡、难以应用一般协方差结构多元模型的数据，并提出了一种统一的拟合方法，结合经验贝叶斯与最大似然估计，使用 EM 算法。<sup>[10](https://people.stat.sc.edu/hansont/stat740/LairdWare1982.pdf)</sup> 多层模型是同一模型族的别名，自 1995 年起见于文献。<sup>[4](https://pmc.ncbi.nlm.nih.gov/articles/PMC2971698/)</sup>

GEE 模型于 20 世纪 80 年代发展起来，是广义线性模型向相关数据的扩展<sup>[4](https://pmc.ncbi.nlm.nih.gov/articles/PMC2971698/)</sup>；1986 年《生物计量学》上提出该方法的论文建模的是边际均值而非条件均值，并讨论了独立、m-相依和可交换工作相关结构。<sup>[8](https://biostat.jhsph.edu/~fdominic/teaching/bio655/references/extra/liang.bka.1986.pdf)</sup> 在这些方法出现之前，分析依赖重复测量方差分析和 MANOVA 型增长曲线模型。<sup>[4](https://pmc.ncbi.nlm.nih.gov/articles/PMC2971698/)</sup>

## 变体

混合效应回归模型曾以多个名称发展起来，包括随机效应模型、方差成分模型、多层模型、两阶段模型、随机系数模型和分层线性模型。<sup>[4](https://pmc.ncbi.nlm.nih.gov/articles/PMC2971698/)</sup> 其扩展包括用于非高斯结局的广义线性混合模型，以及非线性混合效应模型。<sup>[11](https://www.ncbi.nlm.nih.gov/books/NBK385371/)</sup>

增长曲线模型分为两类。潜变量曲线（LC）方法把重复测量视为多元（“宽”格式），用结构方程建模软件拟合；混合效应（ME）方法把重复测量视为一元（“长”格式），用回归软件拟合，把截距和时间系数建模为随机效应。<sup>[12](https://link.springer.com/article/10.3758/s13428-017-0976-5)</sup> ME 方法适合模型简单而数据结构复杂的情形，例如小样本、时间结构不规则的数据，或存在多层级嵌套；LC 方法适合模型复杂而数据结构简单的情形，例如模型拟合评估、随时间变化的协变量，以及复杂的方差函数。<sup>[12](https://link.springer.com/article/10.3758/s13428-017-0976-5)</sup> 类似地，当数据不平衡或不完整，但变化函数和误差协方差相同时，线性混合效应模型更可取；而当数据大多完整、变化函数复杂、误差结构灵活时，潜变量曲线模型更可取。<sup>[11](https://www.ncbi.nlm.nih.gov/books/NBK385371/)</sup>

随机截距加上时间的随机斜率，会诱导出个体内相关性，且测量间隔越远，相关性幅度越小。<sup>[3](https://sites.globalhealth.duke.edu/rdac/wp-content/uploads/sites/27/2020/08/Core-Guide_Correlation-Structures-in-Longitudinal-Data-Analysis_09-19-17.pdf)</sup> 常见的工作结构包括无结构、可交换（单一参数 \( \rho \)）、等间隔观测下元素为 \( \rho^{|j-l|} \) 的 AR(1)，以及指数相关 \( \rho_{jl} = \exp(-\phi|t_{ij} - t_{il}|) \)，后者在观测等间隔时退化为 AR(1)。<sup>[1](https://scsru.github.io/Modules/introduction-to-longitudinal-data.html)</sup>

## 应用

纵向方法在临床试验中是标准做法，反复测量的结局指标在既定期间内追踪治疗效应；在队列研究中同样如此，关于访视时长和频率的设计选择必须与样本量和功效相权衡。<sup>[2](https://pmc.ncbi.nlm.nih.gov/articles/PMC10507671/)</sup> 在生命历程研究中，线性混合效应模型和潜变量曲线模型都能在不做插补、也不做完整病例限制的情况下处理不完整数据，并支持多元、多组和潜类别扩展。<sup>[11](https://www.ncbi.nlm.nih.gov/books/NBK385371/)</sup> 在遗传流行病学中，纵向全基因组关联方法分为四类：混合效应或随机回归模型、贝叶斯方法、潜类别轨迹模型，以及多变异或多性状方法。<sup>[13](https://www.annualreviews.org/content/journals/10.1146/annurev-biodatasci-092724-035434)</sup> 联合模型把纵向子模型与生存子模型连接起来，将纵向过程作为生存风险中的时变协变量。<sup>[14](https://www.annualreviews.org/content/journals/10.1146/annurev-statistics-112723-034334)</sup> 使用马尔可夫链蒙特卡洛（吉布斯与 Metropolis–Hastings 抽样器）的贝叶斯估计，为密集纵向数据的动态结构方程模型提供了基础。<sup>[15](https://www.statmodel.com/download/DSEM.pdf)</sup>

## 局限与替代方法

缺失机制分为完全随机缺失（MCAR）、随机缺失（MAR）和非随机缺失（MNAR，也称信息性缺失或不可忽略缺失）。<sup>[7](https://si.biostat.washington.edu/sites/default/files/modules/11_notes.pdf)</sup> 有效性的分界取决于似然：在 MCAR 下，GEE 和混合效应模型都有效；在 MAR 下，只有完全似然混合模型有效，因为 GEE 是部分似然（拟似然）方法；在 MNAR 下，若不对缺失机制做进一步建模，两者都无效。<sup>[7](https://si.biostat.washington.edu/sites/default/files/modules/11_notes.pdf)</sup><sup> • </sup><sup>[4](https://pmc.ncbi.nlm.nih.gov/articles/PMC2971698/)</sup> 莱尔德与韦尔 1982 年的框架表明，混合效应回归可以在 MAR 下分析所有可用数据，从而取代末次观测结转和变化评分分析等方法。<sup>[4](https://pmc.ncbi.nlm.nih.gov/articles/PMC2971698/)</sup>

在不可忽略脱落下的失效模式可通过模拟来量化：加权最小二乘、尤其是随机效应估计，倾向于把标志物变化的平均速率低估约 10%，而未加权最小二乘、条件似然和联合模型随机效应估计的偏倚只有 3% 到 5%。<sup>[16](https://onlinelibrary.wiley.com/doi/10.1002/sim.1114)</sup> 这是文献中一处尚未解决的张力：混合模型被推崇为在 MAR 下有效，但模拟显示当缺失实际上不可忽略时会出现相当大的偏倚。<sup>[16](https://onlinelibrary.wiley.com/doi/10.1002/sim.1114)</sup><sup> • </sup><sup>[4](https://pmc.ncbi.nlm.nih.gov/articles/PMC2971698/)</sup> 在有小样本且存在缺失数据时，修正协方差估计量会有帮助；曼克尔与德鲁恩的估计量在各类修正估计量中表现最佳，其次是 费伊与格劳巴德的估计量，其表现几乎等同于使用无结构协方差的肯沃德—罗杰方法。<sup>[17](https://onlinelibrary.wiley.com/doi/10.1111/insr.12447)</sup> 对时间结构化的设计，模拟研究认为单层（宽格式）多重插补比多层插补更灵活，因为它所需假设更少，能容纳更广泛的分析模型。<sup>[18](https://www.tandfonline.com/doi/full/10.1080/00273171.2026.2710728)</sup>

与替代方法相比，一元重复测量方差分析假设复合对称，即各时间点方差相等、协方差相等，而一旦设计不平衡、有受试者中途退出便会失效；基于这些局限，它不应再用于纵向数据。<sup>[4](https://pmc.ncbi.nlm.nih.gov/articles/PMC2971698/)</sup> MANOVA 增长曲线模型允许一般相关，但要求数据完整，剔除不完整受试者则有偏倚风险。<sup>[4](https://pmc.ncbi.nlm.nih.gov/articles/PMC2971698/)</sup> 纵向分析与时间序列分析如何比较，以及转移模型的详细处理，此处不予覆盖。

## References

1. [Introduction to Longitudinal Data | Topics in Statistical Consulting (SCSRU)](https://scsru.github.io/Modules/introduction-to-longitudinal-data.html)
2. [Design Issues in Longitudinal Studies (PMC)](https://pmc.ncbi.nlm.nih.gov/articles/PMC10507671/)
3. [Core Guide: Correlation Structures in Longitudinal Data Analysis (Duke Global Health RDAC)](https://sites.globalhealth.duke.edu/rdac/wp-content/uploads/sites/27/2020/08/Core-Guide_Correlation-Structures-in-Longitudinal-Data-Analysis_09-19-17.pdf)
4. [Advances in Analysis of Longitudinal Data (Hedeker et al., review)](https://pmc.ncbi.nlm.nih.gov/articles/PMC2971698/)
5. [Chapter 14: Analysis of longitudinal outcomes | Clinical Biostatistics](https://bookdown.org/charlotte_micheloud93/Clinical_Biostatistics/analysis-of-longitudinal-outcomes.html)
6. [Nan M. Laird, James H. Ware (1982). Random-Effects Models for Longitudinal Data. Biometrics.](https://doi.org/10.2307/2529876)
7. [Module 11: Mixed-effects Models for Longitudinal Data Analysis (Fitzmaurice course notes, UW Biostatistics)](https://si.biostat.washington.edu/sites/default/files/modules/11_notes.pdf)
8. [Longitudinal data analysis using generalized linear models (Liang & Zeger, 1986, Biometrika)](https://biostat.jhsph.edu/~fdominic/teaching/bio655/references/extra/liang.bka.1986.pdf)
9. [Longitudinal Data Analysis (Heagerty, chapter)](https://faculty.washington.edu/heagerty/Courses/VA-longitudinal/private/LDAchapter.pdf)
10. [Random-Effects Models for Longitudinal Data (Laird & Ware, Biometrics 1982)](https://people.stat.sc.edu/hansont/stat740/LairdWare1982.pdf)
11. [Chapter 8: Linear Mixed-Effects and Latent Curve Models for Longitudinal Life Course Analyses (NCBI Bookshelf)](https://www.ncbi.nlm.nih.gov/books/NBK385371/)
12. [Differentiating between mixed-effects and latent-curve approaches to growth modeling (Behavior Research Methods)](https://link.springer.com/article/10.3758/s13428-017-0976-5)
13. [Statistical Methods for Understanding Trajectories in Genetic Epidemiology (Annual Review of Biomedical Data Science)](https://www.annualreviews.org/content/journals/10.1146/annurev-biodatasci-092724-035434)
14. [Joint Modeling of Longitudinal and Survival Data (Annual Review of Statistics and Its Application)](https://www.annualreviews.org/content/journals/10.1146/annurev-statistics-112723-034334)
15. [Dynamic Structural Equation Models (Mplus documentation)](https://www.statmodel.com/download/DSEM.pdf)
16. [Impact of missing data due to drop-outs on estimators for rates of change in longitudinal studies: a simulation study (Statistics in Medicine)](https://onlinelibrary.wiley.com/doi/10.1002/sim.1114)
17. [Practical Review and Comparison of Modified Covariance Estimators for Linear Mixed Models in Small-sample Longitudinal Studies with Missing Data (International Statistical Review)](https://onlinelibrary.wiley.com/doi/10.1111/insr.12447)
18. [Flexible Multiple Imputation of Missing Data in Time-Structured Longitudinal Designs (Multivariate Behavioral Research, 2026)](https://www.tandfonline.com/doi/full/10.1080/00273171.2026.2710728)
19. [tandfonline.com](https://www.tandfonline.com/doi/abs/10.1080/00273170701540537)

---
*Initially written Sep 29, 2026 · Reviewed: Sep 30, 2026 · Edited: Sep 30, 2026 · Last review: Sep 30, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 统计学与概率论 › Statistical inference, estimation, sampling, and testing › Regression analysis › Panel data regression

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/longitudinal-data-analysis

English original: https://www.edgepedia.org/longitudinal-data-analysis
