# 边际模型

边际模型是一种用于聚类数据或纵向数据的半参数回归模型，它将响应变量的总体平均均值描述为协变量的函数，同时将重复观测之间的簇内关联与均值分开处理。它是广义线性模型的半参数扩展：回归将均值响应与一组协变量联系起来，而簇内相依性由单独的结构处理，而不是由回归本身处理。<sup>[1](https://onlinelibrary.wiley.com/doi/10.1002/9781118445112.stat07847)</sup> “边际”一词意味着均值响应的模型只依赖于感兴趣的协变量，而不依赖于任何随机效应或先前响应。<sup>[2](https://pmc.ncbi.nlm.nih.gov/articles/PMC2971698/)</sup>

这一总体平均估计目标不同于混合效应模型的个体特异估计目标。混合模型的回归系数以随机效应为条件，而GEE估计是边际的或总体平均的；对于线性模型，这两种解释一致，但对于逻辑回归等非线性模型，它们通常不同。<sup>[2](https://pmc.ncbi.nlm.nih.gov/articles/PMC2971698/)</sup>

| 关键事实 | 细节 |
|---|---|
| 估计目标 | 总体平均均值 \( \mu = \mathrm{E}(Y) = h(\mathbf{x}^{\top}\boldsymbol{\beta}) \)，具有协方差结构，且不对数据假设分布形式<sup>[3](https://ar5iv.labs.arxiv.org/html/1610.01526)</sup> |
| 标准拟合方法 | 广义估计方程（GEE），它只需要均值函数和方差函数，而不需要完整似然<sup>[4](https://www.stat.cmu.edu/~brian/720-2007-source/week07-08-ideas/dalgaard-mixed-short-course/R-mixed-geeglm-Lecture.pdf)</sup> |
| 稳健性性质 | 即使时间相依性被错误设定，GEE解仍相合且渐近高斯<sup>[5](https://europepmc.org/article/MED/3719049)</sup> |
| 标准误 | 经验（三明治）方差估计量，即使工作相关被错误设定也相合<sup>[4](https://www.stat.cmu.edu/~brian/720-2007-source/week07-08-ideas/dalgaard-mixed-short-course/R-mixed-geeglm-Lecture.pdf)</sup> |
| 工作相关结构 | 独立、可交换、AR(1)和平稳（m-相依）形式<sup>[6](https://doi.org/10.1007/s00180-018-0800-4)</sup><sup> • </sup><sup>[7](https://bishtref.com/articles/10.1093/biomet/73.1.13)</sup> |
| 缺失数据假设 | GEE要求完全随机缺失（MCAR）；全似然模型只要求随机缺失（MAR）<sup>[2](https://pmc.ncbi.nlm.nih.gov/articles/PMC2971698/)</sup> |
| 小样本注意事项 | 在簇数很少时，三明治估计量向下偏倚，若不校正会膨胀I类错误<sup>[8](https://pmc.ncbi.nlm.nih.gov/articles/PMC4411204/)</sup> |

## 工作原理

对观测 \( y_{ij} \) 的边际模型包含三个组成部分：均值模型、方差函数和相关结构。<sup>[9](https://bookdown.org/cnguyen/ASM_Lecture_Notes/MarginalModels.html)</sup> 遵循梁庚义和泽格（Liang and Zeger）1986年发表于《Biometrika》的论文中的方法，分析者仅通过连接函数 \( g(\mathrm{E}(y)) = X \cdot \boldsymbol{\beta} \) 指定均值，并通过 \( \mathrm{Var}(y) = v(\mathrm{E}(y)) \) 指定方差，而不作完整的分布假设；该论文自身的方法是，对重复测量的边际分布使用一个工作广义线性模型，而不指定其联合分布的形式。<sup>[4](https://www.stat.cmu.edu/~brian/720-2007-source/week07-08-ideas/dalgaard-mixed-short-course/R-mixed-geeglm-Lecture.pdf)</sup><sup> • </sup><sup>[7](https://bishtref.com/articles/10.1093/biomet/73.1.13)</sup>

估计通过求解广义估计方程完成，该方程由将得分设为零得到：<sup>[9](https://bookdown.org/cnguyen/ASM_Lecture_Notes/MarginalModels.html)</sup>

\[ \boldsymbol{\psi}(\boldsymbol{\beta}) = \sum_{i} \left( \frac{\partial \boldsymbol{\mu}_{i}}{\partial \boldsymbol{\beta}} \right)^{\top} \Sigma_{i}^{-1} \left( \mathbf{y}_{i} - \boldsymbol{\mu}_{i}(\boldsymbol{\beta}) \right) \]

其中 \( \Sigma_{i} = A_{i}^{1/2} R(\alpha) A_{i}^{1/2} \)，\( A_{i} \) 为对角矩阵，包含方差 \( v(\mu_{ij}) \)，\( R(\alpha) \) 为工作相关矩阵。<sup>[4](https://www.stat.cmu.edu/~brian/720-2007-source/week07-08-ideas/dalgaard-mixed-short-course/R-mixed-geeglm-Lecture.pdf)</sup> GEE不需要完整的似然设定；工作相关结构 \( R_{i}(\alpha) \) 用于提高效率。<sup>[10](https://bookdown.org/epeterson_2010/bios526_book/Module_3B_GEEs.html)</sup>

推断使用稳健（三明治）方差估计量，而不是基于模型的估计量：

\[ \mathrm{Cov}(\hat{\boldsymbol{\beta}})_{e} = I_{0}^{-1} \cdot I_{1} \cdot I_{0}^{-1} \]

其中中间项涉及 \( M = \sum_{i} D_{i}^{\top} V_{i}^{-1} (\mathbf{y}_{i} - \boldsymbol{\mu}_{i})(\mathbf{y}_{i} - \boldsymbol{\mu}_{i})^{\top} V_{i}^{-1} \)，在实践中 \( \mathrm{Cov}(\mathbf{y}_{i}) \) 被经验乘积 \( (\mathbf{y}_{i} - \boldsymbol{\mu}_{i})(\mathbf{y}_{i} - \boldsymbol{\mu}_{i})^{\top} \) 替代。<sup>[4](https://www.stat.cmu.edu/~brian/720-2007-source/week07-08-ideas/dalgaard-mixed-short-course/R-mixed-geeglm-Lecture.pdf)</sup><sup> • </sup><sup>[10](https://bookdown.org/epeterson_2010/bios526_book/Module_3B_GEEs.html)</sup> 这使推断对工作协方差结构的选择具有稳健性。<sup>[9](https://bookdown.org/cnguyen/ASM_Lecture_Notes/MarginalModels.html)</sup> 1986年发表于《Biometrics》的配套论文指出，即使时间相依性被错误设定，GEE解仍相合且渐近高斯；在估计相关矩阵的平均值收敛到一个固定矩阵这一弱假设下，可以得到相合的方差估计。<sup>[5](https://europepmc.org/article/MED/3719049)</sup><sup> • </sup><sup>[7](https://bishtref.com/articles/10.1093/biomet/73.1.13)</sup> 文献中记录了一项限定：李和纳尔德（Lee and Nelder）指出，泽格、梁和阿尔伯特（Zeger, Liang and Albert，1988）的相合性断言被克劳德（Crowder，1995）指出尚未得到充分证明。<sup>[11](https://people.stat.sc.edu/hansont/stat770/LeeNelder2004.pdf)</sup>

## 实施方式

拟合算法在均值参数与相关参数之间迭代：<sup>[4](https://www.stat.cmu.edu/~brian/720-2007-source/week07-08-ideas/dalgaard-mixed-short-course/R-mixed-geeglm-Lecture.pdf)</sup>

1. 从普通广义线性模型计算 \( \boldsymbol{\beta} \) 的初始估计，即假设独立。
2. 根据当前皮尔逊残差估计工作相关 \( R(\alpha) \)。
3. 更新工作方差矩阵 \( \Sigma_{i} \)。
4. 用牛顿步更新 \( \boldsymbol{\beta} \)，并重复直至收敛。

这种在估计相关参数与均值参数之间迭代的做法，就是1986年工作中提出的方案。<sup>[12](https://research-management.mq.edu.au/ws/portalfiles/portal/340880271/Scandinavian_J_Statistics_2024_Muller_The_effect_of_the_working_correlation_on_fitting_models_to_longitudinal_data.pdf)</sup> 分析者必须选择一种工作结构。常见选择包括独立（\( R_{i} = I \)）、可交换（\( R_{i} = (1-\alpha)I + \alpha \mathbf{e}\mathbf{e}^{\top} \)）和一阶自回归AR(1)（\( R_{i} = (\alpha^{|k-l|}) \)，其中 \( -1 < \alpha < 1 \)）；1986年《Biometrika》论文还讨论了m-相依结构。<sup>[6](https://doi.org/10.1007/s00180-018-0800-4)</sup><sup> • </sup><sup>[7](https://bishtref.com/articles/10.1093/biomet/73.1.13)</sup>

这一选择影响效率，而不影响相合性。\( \hat{\boldsymbol{\beta}} \) 的渐近相对效率取决于工作相关结构与真实相关结构之间的差异、相关参数的估计方法，以及协变量和簇大小的设计。<sup>[6](https://doi.org/10.1007/s00180-018-0800-4)</sup><sup> • </sup><sup>[13](https://doi.org/10.1093/biomet/90.1.29)</sup> 一种需要人工检查的实际失效模式是：SAS中的PROC GENMOD和Stata中的xtgee等标准软件不会检查或警告那些使估计相关矩阵保持有效的参数约束是否被违反，因此实践者应自行核验这些约束。<sup>[14](https://www.stat.ubc.ca/~john/papers/ShultsSIM2009.pdf)</sup>

## 起源

纵向数据边际模型的GEE方法出现在梁庚义（Kung-Yee Liang）和斯科特·L·泽格（Scott L. Zeger）1986年的两篇论文中：发表于《Biometrika》的《使用广义线性模型的纵向数据分析》<sup>[7](https://bishtref.com/articles/10.1093/biomet/73.1.13)</sup><sup> • </sup><sup>[15](https://doi.org/10.1093/biomet/73.1.13)</sup>，以及发表于《Biometrics》的配套论文，后者提出了一类用于回归参数的广义估计方程，并在文中将其描述为准似然方法中所用估计方程的扩展。<sup>[5](https://europepmc.org/article/MED/3719049)</sup><sup> • </sup><sup>[16](https://doi.org/10.2307/2531734)</sup> 一篇历史综述将20世纪80年代GEE模型的发展归功于这两篇论文，认为它们是将广义线性模型扩展到相关数据的结果。<sup>[2](https://pmc.ncbi.nlm.nih.gov/articles/PMC2971698/)</sup> 泽格、梁和阿尔伯特（Zeger, Liang and Albert）1988年发表于《Biometrics》的论文《纵向数据模型：一种广义估计方程方法》（"Models for Longitudinal Data: A Generalized Estimating Equation Approach"）是与此区分相关的GEE框架论文。<sup>[16](https://doi.org/10.2307/2531734)</sup><sup> • </sup><sup>[11](https://people.stat.sc.edu/hansont/stat770/LeeNelder2004.pdf)</sup>

## 变体

GEE并非拟合边际模型的唯一方法。对于带有时变协变量的纵向数据，一种广义矩方法将协变量分为I型、II型和III型，其中类型决定哪些估计方程可以包含该协变量，并使用GMM最优地利用可用的估计方程。<sup>[17](https://ideas.repec.org/a/bla/jorssb/v69y2007i1p79-99.html)</sup>

条件模型框架内一种基于似然的替代方法是边际化多层模型，它在保留完整概率模型的同时估计边际系数；相关的《Statistical Science》论文由帕特里克·J·希格蒂（Patrick J. Heagerty）和斯科特·L·泽格（Scott L. Zeger）于2000年发表。<sup>[18](https://doi.org/10.1214/ss/1009212671)</sup><sup> • </sup><sup>[19](https://academic.oup.com/biostatistics/article/25/2/402/6935768)</sup> 小样本变体则修改估计量本身：偏差校正GEE（BCGEE）即使在工作相关结构被错误设定时也有效。<sup>[20](https://link.springer.com/article/10.1186/s12874-024-02368-2)</sup>

## 应用

边际模型用于任何出现重复观测或聚类观测的场合。在阶梯楔形试验和其他整群随机试验中，带小样本校正的GEE估计总体平均处理效应。<sup>[8](https://pmc.ncbi.nlm.nih.gov/articles/PMC4411204/)</sup>

软件实现包括SAS的PROC GENMOD和PROC GLIMMIX，后者使用R侧随机效应拟合边际GEE型模型，并用经验（三明治）估计量进行推断；<sup>[21](https://go.documentation.sas.com/api/docsets/statug/v_023/content/statug_glimmix_examples15.htm)</sup> Stata的xtgee；<sup>[14](https://www.stat.ubc.ca/~john/papers/ShultsSIM2009.pdf)</sup> 以及自2024年起的R包geessbin，它实现传统GEE加BCGEE，以及针对小样本二值聚类数据的PGEE，并配有11种偏差校正协方差估计量。<sup>[20](https://link.springer.com/article/10.1186/s12874-024-02368-2)</sup>

## 局限与替代方法

**小样本。** 当簇数很少时，三明治方差估计量有偏，且倾向于低估方差，导致置信区间覆盖不足和I类错误膨胀，尤其是对Wald检验。<sup>[8](https://pmc.ncbi.nlm.nih.gov/articles/PMC4411204/)</sup> 曼克尔和德鲁恩（Mancl and DeRouen）校正为簇数较少时的GEE提供近似有效的推断，而边际化多层模型对簇内关联的标准误仅略有低估，但对簇间关联的标准误可能严重低估。<sup>[22](https://onlinelibrary.wiley.com/doi/10.1002/sim.9126)</sup>

**缺失数据。** GEE假设缺失数据为完全随机缺失，而全似然模型只假设随机缺失。当退出与已观测响应相关时，GEE和混合模型可能产生相当不同的估计均值响应，这一比较更支持混合模型用于纵向数据；GEE再现观测数据的边际均值，并增大标准误以计入相关性的影响。<sup>[2](https://pmc.ncbi.nlm.nih.gov/articles/PMC2971698/)</sup>

**解释与模型范围。** 只有当受试者可以被视为来自总体的代表性随机样本时，边际均值才等于总体平均，而志愿者等研究样本往往并非如此。<sup>[11](https://people.stat.sc.edu/hansont/stat770/LeeNelder2004.pdf)</sup> 纯边际模型通常不是完全指定的生成模型，这使得模型检查、模型比较和个体层面预测变得困难；与GLMM相比，个体特异预测更难获得。<sup>[3](https://ar5iv.labs.arxiv.org/html/1610.01526)</sup> 边际化多层模型通过在条件模型内部提供基于似然的边际系数来解决这一问题，尽管模拟表明它们可能对相关结构的错误设定敏感；而当采用正确结构时，GEE和边际化多层模型表现出相似的小样本偏差。<sup>[19](https://academic.oup.com/biostatistics/article/25/2/402/6935768)</sup><sup> • </sup><sup>[22](https://onlinelibrary.wiley.com/doi/10.1002/sim.9126)</sup>

## References

1. [Wiley StatsRef: Marginal Models entry](https://onlinelibrary.wiley.com/doi/10.1002/9781118445112.stat07847)
2. [Advances in Analysis of Longitudinal Data (peer-reviewed historical review, PMC)](https://pmc.ncbi.nlm.nih.gov/articles/PMC2971698/)
3. [Marginally Interpretable GLMM (arXiv 1610.01526)](https://ar5iv.labs.arxiv.org/html/1610.01526)
4. [Generalized Estimating Equations (gee) for glm-type data (lecture notes, Peter Dalgaard short course)](https://www.stat.cmu.edu/~brian/720-2007-source/week07-08-ideas/dalgaard-mixed-short-course/R-mixed-geeglm-Lecture.pdf)
5. [Longitudinal data analysis for discrete and continuous outcomes (Zeger & Liang 1986, Biometrics)](https://europepmc.org/article/MED/3719049)
6. [Working correlation structure selection in generalized estimating equations](https://doi.org/10.1007/s00180-018-0800-4)
7. [Longitudinal data analysis using generalized linear models (Liang & Zeger, 1986, Biometrika 73(1):13-22, DOI 10.1093/biomet/73.1.13)](https://bishtref.com/articles/10.1093/biomet/73.1.13)
8. [Finite-Sample Corrected GEE of Population Average Treatment Effects in Stepped Wedge Cluster Randomized Trials](https://pmc.ncbi.nlm.nih.gov/articles/PMC4411204/)
9. [Advanced Statistical Modelling III, Marginal Models (lecture notes)](https://bookdown.org/cnguyen/ASM_Lecture_Notes/MarginalModels.html)
10. [Module 3B Marginal Models – BIOS 526 Modern Regression Analysis](https://bookdown.org/epeterson_2010/bios526_book/Module_3B_GEEs.html)
11. [Conditional and Marginal Models (Lee & Nelder, 2004)](https://people.stat.sc.edu/hansont/stat770/LeeNelder2004.pdf)
12. [The effect of the working correlation on fitting models to longitudinal data (Scandinavian Journal of Statistics, 2024)](https://research-management.mq.edu.au/ws/portalfiles/portal/340880271/Scandinavian_J_Statistics_2024_Muller_The_effect_of_the_working_correlation_on_fitting_models_to_longitudinal_data.pdf)
13. [Working correlation structure misspecification, estimation and covariate design: Implications for generalised estimating equations performance](https://doi.org/10.1093/biomet/90.1.29)
14. [A comparison of several approaches for choosing between working correlation structures in generalized estimating equation analysis of longitudinal binary data (Statistics in Medicine)](https://www.stat.ubc.ca/~john/papers/ShultsSIM2009.pdf)
15. [KUNG-YEE LIANG, SCOTT L. ZEGER (1986). Longitudinal data analysis using generalized linear models. Biometrika.](https://doi.org/10.1093/biomet/73.1.13)
16. [Scott L. Zeger, Kung-Yee Liang, Paul S. Albert (1988). Models for Longitudinal Data: A Generalized Estimating Equation Approach. Biometrics.](https://doi.org/10.2307/2531734)
17. [Marginal regression analysis of longitudinal data with time-dependent covariates: a generalized method-of-moments approach (JRSS-B 2007)](https://ideas.repec.org/a/bla/jorssb/v69y2007i1p79-99.html)
18. [Patrick J. Heagerty, Scott L. Zeger (2000). Marginalized multilevel models and likelihood inference (with comments and a rejoinder by the authors). Statistical Science.](https://doi.org/10.1214/ss/1009212671)
19. [Transformation perspective on marginal and conditional models (Biostatistics, Oxford Academic)](https://academic.oup.com/biostatistics/article/25/2/402/6935768)
20. [geessbin: an R package for analyzing small-sample binary data using modified generalized estimating equations with bias-adjusted covariance estimators (BMC Medical Research Methodology, 2024)](https://link.springer.com/article/10.1186/s12874-024-02368-2)
21. [PROC GLIMMIX documentation: Fitting a Marginal (GEE-Type) Model](https://go.documentation.sas.com/api/docsets/statug/v_023/content/statug_glimmix_examples15.htm)
22. [Fitting marginal models in small samples: A simulation study of marginalized multilevel models and generalized estimating equations (Statistics in Medicine, 2021, DOI 10.1002/sim.9126)](https://onlinelibrary.wiley.com/doi/10.1002/sim.9126)

---
*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/marginal-model

English original: https://www.edgepedia.org/marginal-model
