# 多层回归与后分层

多层回归与后分层（multilevel regression and poststratification，简称MRP，有时戏称为“Mister P”）是一种统计方法，用于估计小子群中的总体统计量——例如某个州的公众舆论——其做法是对调查数据拟合一个多层模型，并将模型的预测值按已知的人口单元格计数进行平均。它解决了这样一个问题：全国性调查在大多数地理或人口子群中受访者太少，无法直接估计。由于多层模型在组与组之间进行部分池化（partial pooling），MRP能够从一次约1,500名受访者的全国性民调中得出可用的州级估计——而在这种情形下，简单的调查加权会失效。<sup>[1](https://www.columbia.edu/~jrl2124/mrp2.pdf)</sup> 它被广泛应用于政治学、调查统计学和公共卫生领域。<sup>[2](https://websites.umich.edu/~yajuan/files/MrPbrownbag-YAJUANSI.pdf)</sup>

| 关键事实 | 详情 |
|---|---|
| 估计什么 | 从调查数据估计总体或子群均值（例如州级舆论），不确定性区间来自后验抽样<sup>[3](https://cran.r-project.org/web/packages/shinymrp/vignettes/method.html)</sup> |
| 核心估计量 | \( \theta^{\mathrm{MRP}} = \sum_{j} N_{j}\,\theta_{j} / \sum_{j} N_{j} \)，即基于模型的单元格估计按人口规模加权平均<sup>[4](https://bookdown.org/jl5522/MRP-case-studies/introduction-to-mrp.html)</sup> |
| 典型单元格数 | 帕克、格尔曼和巴富米的一个示例，使用性别、族裔、年龄（4个水平）、教育（4个水平）和50个州，共3,200个后分层类别（含华盛顿特区为3,264个）<sup>[5](https://sites.stat.columbia.edu/gelman/research/published/parkgelmanbafumi.pdf)</sup> |
| 人口数据来源 | 单元格计数 \( N_{j} \) 来自美国人口普查或美国社区调查（ACS）<sup>[4](https://bookdown.org/jl5522/MRP-case-studies/introduction-to-mrp.html)</sup> |
| 准确度基准 | 在1,400名受访者的情况下，州级估计与真实舆论的相关系数为0.74，平均绝对误差为4.9%<sup>[1](https://www.columbia.edu/~jrl2124/mrp2.pdf)</sup> |
| 起源 | 由格尔曼和利特尔于1997年提出；2004年由帕克、格尔曼和巴富米扩展至从全国民调得出州级估计<sup>[6](https://sites.stat.columbia.edu/gelman/research/published/poststrat3.pdf)</sup><sup> • </sup><sup>[7](https://doi.org/10.1093/pan/mph024)</sup> |
| 软件 | rstanarm（stan_glmer）、Stan用户指南、autoMrP以及shinymrp界面<sup>[4](https://bookdown.org/jl5522/MRP-case-studies/introduction-to-mrp.html)</sup><sup> • </sup><sup>[8](https://doi.org/10.1086/714777)</sup><sup> • </sup><sup>[3](https://cran.r-project.org/web/packages/shinymrp/vignettes/method.html)</sup> |

## 工作原理

MRP有两个相互对应的阶段。首先，一个多层回归模型根据人口学和地理预测变量（例如性别、种族、年龄、教育程度和州）预测个体响应，并为每个组设置变化效应。其次，后分层将拟合好的模型调整到总体上：总体按照相同的预测变量划分为若干单元格 \( j \)，模型为每个单元格产生一个估计 \( \theta_{j} \)，总体估计即为加权平均

\[ \theta^{\mathrm{MRP}} = \frac{\sum_{j} N_{j}\,\theta_{j}}{\sum_{j} N_{j}}, \]

其中 \( N_{j} \) 是单元格 \( j \) 中已知的人口计数。<sup>[4](https://bookdown.org/jl5522/MRP-case-studies/introduction-to-mrp.html)</sup> 较小的单元格被降低权重，较大的单元格被提高权重，从而校正不具代表性的样本。<sup>[9](https://pmc.ncbi.nlm.nih.gov/articles/PMC9203002/)</sup> 后分层是在模型拟合之后进行的，该方法由此得名。<sup>[10](https://mc-stan.org/docs/stan-users-guide/poststratification.html)</sup>

多层结构正是让“多单元格”问题变得可处理的关键。经典后分层无法估计空单元格或稀疏单元格；多层模型中的部分池化会自动将组估计向父分布正则化，因此即使是没有受访者的单元格也能获得基于模型的数值。<sup>[9](https://pmc.ncbi.nlm.nih.gov/articles/PMC9203002/)</sup> 池化的程度由数据通过模型来决定，正是这种组合推动了MRP的流行。<sup>[10](https://mc-stan.org/docs/stan-users-guide/poststratification.html)</sup> 稀疏性问题很具体：即使是一次有10,000名受访者的全国民调，分摊到50个州，平均每州也只剩约200名受访者。<sup>[11](https://mc-stan.org/docs/2_28/stan-users-guide/multilevel-regression-and-poststratification.html)</sup>

## 操作步骤

实践者需执行四个步骤。

1. 选择调查和人口普查中都存在的后分层变量。MRP仅限于两个来源中都有的个体层面变量；调查中有而人口普查中没有的宗教变量不能使用，不匹配的类别必须合并（例如合并为“其他”）。<sup>[4](https://bookdown.org/jl5522/MRP-case-studies/introduction-to-mrp.html)</sup>
2. 构建人口计数的后分层表 \( N_{j} \)，通常来自十年一次的人口普查或ACS。一个来自2014—2018年ACS的示例表，包含50个州、6个年龄、2个性别、4个种族和5个教育类别，共有12,000个单元格，多于实际观测到的调查单元数，因此空单元格频繁出现。<sup>[4](https://bookdown.org/jl5522/MRP-case-studies/introduction-to-mrp.html)</sup>
3. 对个体调查响应拟合多层模型。在R中，rstanarm包的stan_glmer()函数使用lme4风格的公式记号在Stan中拟合模型；推断为贝叶斯推断，95%可信区间由后验抽样计算得出。<sup>[4](https://bookdown.org/jl5522/MRP-case-studies/introduction-to-mrp.html)</sup><sup> • </sup><sup>[3](https://cran.r-project.org/web/packages/shinymrp/vignettes/method.html)</sup>
4. 将后验抽样在单元格上聚合：对每一个后验抽样，预测每个单元格中的 \( \theta_{j} \)（例如用posterior_epred()对约12,000个单元格做1,000次抽样），按 \( N_{j} \) 加权，再平均以得到估计值及其区间。<sup>[4](https://bookdown.org/jl5522/MRP-case-studies/introduction-to-mrp.html)</sup>

严格来说并不需要微观数据：可以将单元格层面的汇总数据建模为 \( y^{*}_{j} \sim \mathrm{binomial}(n_{j}, \theta_{j}) \)，也可以提供自定义的后分层数据（例如由ACS推导出的另一国目标人口计数）。<sup>[3](https://cran.r-project.org/web/packages/shinymrp/vignettes/method.html)</sup>

## 起源

MRP由安德鲁·格尔曼和托马斯·C. 利特尔在《使用分层逻辑回归进行多类别后分层》（1997）一文中提出，该文为给定后分层单元格条件下的二元响应均值构建了一个分层逻辑回归模型，并证明分层形式允许拟合比经典方法多得多的单元格。<sup>[6](https://sites.stat.columbia.edu/gelman/research/published/poststrat3.pdf)</sup> 该方法将小区域估计的建模方法与后分层中使用的人口信息结合起来，并被应用于按州及常规人口学变量后分层的美国选前民调。<sup>[6](https://sites.stat.columbia.edu/gelman/research/published/poststrat3.pdf)</sup>

戴维·K. 帕克、安德鲁·格尔曼和约瑟夫·巴富米在《带后分层的贝叶斯多层估计：来自全国民调的州级估计》（《政治分析》，2004年）中扩展了该方法。<sup>[7](https://doi.org/10.1093/pan/mph024)</sup> 他们在1988年和1992年的美国选前民调上进行了验证，按州、地区和人口学变量进行后分层，多层模型表现优于政治学中更常用的模型；他们认为该方法最重要的用途是估计州级议题舆论，而非预测选举。<sup>[5](https://sites.stat.columbia.edu/gelman/research/published/parkgelmanbafumi.pdf)</sup> 情境层面预测变量（如州级协变量）在1997年的论文中并未出现，但从2004年的论文起成为标准做法。<sup>[12](https://www.ipw.unibe.ch/unibe/portal/fak_wiso/c_dep_sowi/inst_pw/content/e39849/e49015/e952151/e953053/e965657/MrP_LWrevision1_ger.pdf)</sup> 更早的项目曾将全国民调与人口普查及投票数据结合，构建合成选民类型，而MRP借鉴了这些在调查研究中已显示出前景的正则化估计和后分层技术。<sup>[5](https://sites.stat.columbia.edu/gelman/research/published/parkgelmanbafumi.pdf)</sup><sup> • </sup><sup>[4](https://bookdown.org/jl5522/MRP-case-studies/introduction-to-mrp.html)</sup>

## 变体

若干有名称的扩展对模型或后分层步骤进行了修改。

- **深度MRP（Deep MRP）** 加入人口学变量与地理之间的所有双向交互项、人口学变量之间的三向交互项，以及州级非线性效应的样条。<sup>[13](https://doi.org/10.1017/s0003055423000035)</sup> 它由亚伊尔·吉察和安德鲁·格尔曼在《美国政治学杂志》（2013）中为分析深度交互的小型选举子群而详细阐述。<sup>[14](https://doi.org/10.1111/ajps.12004)</sup> 新的变分近似使深度MRP拟合很快，10,000个观测约需30秒，并表明深层分层模型几乎匹敌或优于机器学习替代方法。<sup>[13](https://doi.org/10.1017/s0003055423000035)</sup>
- **BARP** 用贝叶斯加性回归树（BART）替代回归，后者是一种树集成方法，由休·A. 奇普曼、爱德华·I. 乔治和罗伯特·E. 麦卡洛克在《应用统计学年鉴》（2010）中提出。<sup>[15](https://doi.org/10.1017/s0003055419000480)</sup><sup> • </sup><sup>[16](https://doi.org/10.1214/09-aoas285)</sup> 一项再评估发现，BART在平均绝对误差上仅比传统MRP好1%—4%，且优势随样本量增大而缩小，而深度MRP实际上与BART持平；这与早先报告的MAE改进20%—30%相矛盾。<sup>[13](https://doi.org/10.1017/s0003055423000035)</sup>
- **MrsP**（带合成后分层的多层回归），由卢卡斯·莱曼和法比奥·瓦瑟法伦在《美国政治学杂志》（2017）中提出，放宽了对精确联合人口普查分布的要求，改用边际或调整后的合成分布；在美国数据中，它相对于标准MRP将预测误差（MSE）降低了43%。<sup>[17](https://doi.org/10.1111/ajps.12319)</sup><sup> • </sup><sup>[18](https://www.ipw.unibe.ch/unibe/portal/fak_wiso/c_dep_sowi/inst_pw/content/e39849/e49015/e952151/e952152/e952993/e953006/leemann_wasserfallen_2017_ger.pdf)</sup> 一种相关的改编适用于只知道后分层变量边际分布的情形，同时对调查结果和子群人口规模建模，后分层变量少时使用泊松或负二项回归，多时使用BART。<sup>[19](https://pmc.ncbi.nlm.nih.gov/articles/PMC12967158/)</sup>
- **MRT**（带时间后分层的MRP）将时间作为后分层的一个维度加入；一项应用从68次全国民调的81,127名受访者中，生成了22年（1993—2014）间全部50个州的年度同性婚姻舆论估计。<sup>[20](https://columbia.edu/~jhp2121/workingpapers/MRT.pdf)</sup>
- **空间MRP（Spatial MRP）** 在由一阶邻接矩阵定义的地区单元上加入BYM2空间随机效应；在模拟中，它相对于经典MRP将地区级估计的绝对偏差降低约10%。<sup>[21](https://arxiv.org/html/2503.05915v2)</sup>
- **结构化先验（Structured priors）** 将层级结构编码进深度交互中，在各种数据情形下（包括极端无响应）降低绝对偏差和方差。<sup>[9](https://pmc.ncbi.nlm.nih.gov/articles/PMC9203002/)</sup><sup> • </sup><sup>[2](https://websites.umich.edu/~yajuan/files/MrPbrownbag-YAJUANSI.pdf)</sup>
- **autoMrP** 是一种机器学习集成方法，由菲利普·布罗涅茨基、卢卡斯·莱曼和雷托·维斯特在《政治学杂志》（2021）中提出，通过集成贝叶斯模型平均将多个MRP模型组合起来。<sup>[8](https://doi.org/10.1086/714777)</sup>

## 应用

MRP最著名的应用是舆论估计和选举预测。它已被用于非概率样本，包括2012年美国总统选举前45天招募的35万名Xbox用户。<sup>[2](https://websites.umich.edu/~yajuan/files/MrPbrownbag-YAJUANSI.pdf)</sup><sup> • </sup><sup>[12](https://www.ipw.unibe.ch/unibe/portal/fak_wiso/c_dep_sowi/inst_pw/content/e39849/e49015/e952151/e953053/e965657/MrP_LWrevision1_ger.pdf)</sup> 它还从约2,500名受访者的样本中得出了国会选区估计，从约5,000名受访者中得出了州参议院选区估计。<sup>[20](https://columbia.edu/~jhp2121/workingpapers/MRT.pdf)</sup>

在公共卫生领域，疾病控制与预防中心在“500城市”项目（2016—2019）中得出了城市和人口普查区级别的疾病患病率估计，该项目于2020年12月扩展并更名为PLACES；PLACES现在为全美提供县、居民点、人口普查区和ZCTA级别的估计。<sup>[2](https://websites.umich.edu/~yajuan/files/MrPbrownbag-YAJUANSI.pdf)</sup> MRP曾被应用并验证于使用行为风险因素监测系统对慢性阻塞性肺疾病患病率进行小区域估计。<sup>[22](https://doi.org/10.1093/aje/kwu018)</sup> 一项2023年之后的应用从受COVID-19干扰的2018—2021年CHAIN调查中，估计了纽约市HIV感染者的病毒载量抑制情况以及心理和身体健康量表均值。<sup>[19](https://pmc.ncbi.nlm.nih.gov/articles/PMC12967158/)</sup> 开源shinymrp界面将MRP扩展到时间变化、细粒度地理数据，从常规门诊PCR检测中追踪社区层面的SARS-CoV-2传播，单元格按性别、年龄、种族、邮政编码和周定义，单元格计数取自ACS。<sup>[23](https://link.springer.com/article/10.1186/s12963-026-00456-7)</sup><sup> • </sup><sup>[3](https://cran.r-project.org/web/packages/shinymrp/vignettes/method.html)</sup>

## 局限与替代方法

MRP的主要失效模式涉及稀疏性、收缩和假设。空的后分层单元格频繁出现，该方法依赖于模型对其进行合理正则化；贝叶斯多层模型常被优先选用，因为信息先验有助于处理稀疏组，而频率派多层模型在这些组中可能不可靠。<sup>[4](https://bookdown.org/jl5522/MRP-case-studies/introduction-to-mrp.html)</sup><sup> • </sup><sup>[24](https://library-drupal.internal.lib.virginia.edu/data/articles/getting-started-multilevel-regression-and-poststratification)</sup> MRP倾向于收缩各州之间的舆论差异，尤其是在小样本且没有州级预测变量的情况下。<sup>[1](https://www.columbia.edu/~jrl2124/mrp2.pdf)</sup> 当每个区都有一些响应时，它在区级可以工作，但在更细的粒度上会退化，因为小区域变得太小。<sup>[12](https://www.ipw.unibe.ch/unibe/portal/fak_wiso/c_dep_sowi/inst_pw/content/e39849/e49015/e952151/e953053/e965657/MrP_LWrevision1_ger.pdf)</sup> 应用于非调查数据时，它依赖于这样的假设：在给定已纳入调整的人口学和地理变量的条件下，样本选择是可忽略的。<sup>[23](https://link.springer.com/article/10.1186/s12963-026-00456-7)</sup> 一项现实检验发现，无论是经典MRP还是空间MRP，都未能复现疾病控制与预防中心对加利福尼亚州2021年6月30日县级第一剂疫苗接种率的估计，其中25—64岁年龄组的过度聚合以及缺乏用户代表性指标被认定为部分原因。<sup>[21](https://arxiv.org/html/2503.05915v2)</sup>

验证结果并不像模拟结果所暗示的那样一致有利。布蒂斯和海顿考察了比早先研究更多的案例和更广泛的舆论范围，发现在常规全国调查样本量下，MRP的表现存在很大差异，结论是获得良好表现所需的条件并不总能满足。<sup>[25](https://www.cambridge.org/core/journals/political-analysis/article/abs/how-does-multilevel-regression-and-poststratification-perform-with-conventional-national-surveys/113B73B46C65BFA037146C4A5FFDC7E9)</sup> 不确定性不可忽视：在同性婚姻应用中，标准MRP的平均置信区间约为10个百分点（最大州约8个，最小州约11个）。<sup>[20](https://columbia.edu/~jhp2121/workingpapers/MRT.pdf)</sup>

与经典后分层和基于设计的加权相比，MRP的优势在于部分池化，它能处理简单后分层无法处理的空单元格（通常的退路是只对边际分布进行后分层、忽略交互，或者合并单元格）。<sup>[9](https://pmc.ncbi.nlm.nih.gov/articles/PMC9203002/)</sup> 相对于耙梳法（raking，即迭代调查加权以匹配已知总体边际），模拟显示MRP产生更小的RMSE、更窄的95%置信区间和更好的覆盖率，并且在协变量重叠度低时，传播单元格计数估计中的不确定性可改善覆盖率。<sup>[19](https://pmc.ncbi.nlm.nih.gov/articles/PMC12967158/)</sup>

## References

1. [How Should We Estimate Sub-National Opinion (Lax & Phillips)](https://www.columbia.edu/~jrl2124/mrp2.pdf)
2. [Multilevel Regression and Poststratification (Yajuan Si, lecture slides)](https://websites.umich.edu/~yajuan/files/MrPbrownbag-YAJUANSI.pdf)
3. [MRP methodological guide (shinymrp vignette, CRAN)](https://cran.r-project.org/web/packages/shinymrp/vignettes/method.html)
4. [Chapter 1 Introduction to MRP | Multilevel Regression and Poststratification Case Studies](https://bookdown.org/jl5522/MRP-case-studies/introduction-to-mrp.html)
5. [Bayesian Multilevel Estimation with Poststratification: State-Level Estimates from National Polls (Park, Gelman & Bafumi; author's copy; published in Political Analysis)](https://sites.stat.columbia.edu/gelman/research/published/parkgelmanbafumi.pdf)
6. [Poststratification Into Many Categories Using Hierarchical Logistic Regression (Gelman & Little, September 30, 1997)](https://sites.stat.columbia.edu/gelman/research/published/poststrat3.pdf)
7. [David K. Park, Andrew Gelman, Joseph Bafumi (2004). Bayesian Multilevel Estimation with Poststratification: State-Level Estimates from National Polls. Political Analysis.](https://doi.org/10.1093/pan/mph024)
8. [Philipp Broniecki, Lucas Leemann, Reto Wüest (2021). Improved Multilevel Regression with Poststratification through Machine Learning (autoMrP). The Journal of Politics.](https://doi.org/10.1086/714777)
9. [Improving multilevel regression and poststratification with structured priors (PMC)](https://pmc.ncbi.nlm.nih.gov/articles/PMC9203002/)
10. [Poststratification | Stan User's Guide](https://mc-stan.org/docs/stan-users-guide/poststratification.html)
11. [30.5 Multilevel regression and poststratification | Stan User's Guide](https://mc-stan.org/docs/2_28/stan-users-guide/multilevel-regression-and-poststratification.html)
12. [Multilevel regression with post-stratification (MrP) chapter (Leemann and Wasserfallen)](https://www.ipw.unibe.ch/unibe/portal/fak_wiso/c_dep_sowi/inst_pw/content/e39849/e49015/e952151/e953053/e965657/MrP_LWrevision1_ger.pdf)
13. [MAX GOPLERUD (2023). Re-Evaluating Machine Learning for MRP Given the Comparable Performance of (Deep) Hierarchical Models. American Political Science Review.](https://doi.org/10.1017/s0003055423000035)
14. [Yair Ghitza, Andrew Gelman (2013). Deep Interactions with MRP: Election Turnout and Voting Patterns Among Small Electoral Subgroups. American Journal of Political Science.](https://doi.org/10.1111/ajps.12004)
15. [JAMES BISBEE (2019). BARP: Improving Mister P Using Bayesian Additive Regression Trees. American Political Science Review.](https://doi.org/10.1017/s0003055419000480)
16. [Hugh A. Chipman, Edward I. George, Robert E. McCulloch (2010). BART: Bayesian additive regression trees. The Annals of Applied Statistics.](https://doi.org/10.1214/09-aoas285)
17. [Lucas Leemann, Fabio Wasserfallen (2017). Extending the Use and Prediction Precision of Subnational Public Opinion Estimation. American Journal of Political Science.](https://doi.org/10.1111/ajps.12319)
18. [Extending the Use and Prediction Precision of Subnational Public Opinion Estimation (Leemann & Wasserfallen)](https://www.ipw.unibe.ch/unibe/portal/fak_wiso/c_dep_sowi/inst_pw/content/e39849/e49015/e952151/e952152/e952993/e953006/leemann_wasserfallen_2017_ger.pdf)
19. [Multilevel Regression and Poststratification Using Margins of Poststratifiers: Improving Inference for HIV Health Outcomes During the COVID-19 Pandemic (PMC)](https://pmc.ncbi.nlm.nih.gov/articles/PMC12967158/)
20. [Multilevel Regression with Time Poststratification (MRT) working paper (Warshaw, Lax, Phillips et al.)](https://columbia.edu/~jhp2121/workingpapers/MRT.pdf)
21. [Evaluating Multilevel Regression and Poststratification with Spatial Priors with a Big Data Behavioural Survey (arXiv preprint, 2025)](https://arxiv.org/html/2503.05915v2)
22. [X. Zhang and colleagues (2014). Multilevel Regression and Poststratification for Small-Area Estimation of Population Health Outcomes: A Case Study of Chronic Obstructive Pulmonary Disease Prevalence Using the Behavioral Risk Factor Surveillance System. American Journal of Epidemiology.](https://doi.org/10.1093/aje/kwu018)
23. [Multilevel regression and poststratification interface: an application to track community-level COVID-19 viral transmission (Population Health Metrics)](https://link.springer.com/article/10.1186/s12963-026-00456-7)
24. [Getting Started with Multilevel Regression and Poststratification | UVA Library](https://library-drupal.internal.lib.virginia.edu/data/articles/getting-started-multilevel-regression-and-poststratification)
25. [How Does Multilevel Regression and Poststratification Perform with Conventional National Surveys? (Buttice & Highton, Political Analysis 2013)](https://www.cambridge.org/core/journals/political-analysis/article/abs/how-does-multilevel-regression-and-poststratification-perform-with-conventional-national-surveys/113B73B46C65BFA037146C4A5FFDC7E9)

---
*Initially written Sep 29, 2026 · Edited: Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 统计学与概率论 › Statistical inference, estimation, sampling, and testing › Sampling design and survey methodology › Sampling designs and estimators › Ratio and regression estimators in surveys

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/multilevel-regression-and-poststratification

English original: https://www.edgepedia.org/multilevel-regression-and-poststratification
