# TWINSPAN

**TWINSPAN**（Two-Way INdicator SPecies ANalysis，双向指示种分析）是一种用于群落生态学数据的层次划分分类方法，由 M. O. Hill 于 1979 年以 FORTRAN 程序形式提出，该程序通过对样本（如植被样地）及其所含物种同时进行分类，将多元数据排列成有序双向表<sup>[1](https://books.google.com/books/about/TWINSPAN.html?id=xRlFAAAAYAAJ)</sup>。它通过沿对应分析（一种沿梯度轴对样本和物种进行排序的统计方法）第一轴反复分裂分组，来划分站点×物种数据矩阵，并为每次划分确定指示种<sup>[2](https://www.sciencedirect.com/topics/earth-and-planetary-sciences/twinspan)</sup>。

| 关键事实 | 详情 |
|---|---|
| 起源 | M. O. Hill 编写的 FORTRAN 程序，康奈尔大学生态学与系统学系，1979 年，90 页，属康奈尔生态学程序系列<sup>[1](https://books.google.com/books/about/TWINSPAN.html?id=xRlFAAAAYAAJ)</sup> |
| 方法类型 | 基于单一对应分析（CA）或去趋势对应分析（DCA）轴逐步细化的层次划分（多特征）分类<sup>[2](https://www.sciencedirect.com/topics/earth-and-planetary-sciences/twinspan)</sup> |
| 双向输出 | 先对样本分类；再基于样本分类对物种分类，生成类似传统植物社会学表格的有序双向表<sup>[3](https://www.ceh.ac.uk/data/software-models/decorana-and-twinspan)</sup> |
| 伪种 | 物种多度按用户选择的截断水平（默认 0、2、5、10、20）转换为二元存在水平；出现在不足 1/5 样方中的伪种被降权<sup>[4](https://jarioksa.r-universe.dev/twinspan/doc/manual.html)</sup> |
| 指示值 | \( I_{j} = n_{j}^{+}/n^{+} - n_{j}^{-}/n^{-} \)，从完美正指示种的 1 到完美负指示种的 −1<sup>[2](https://www.sciencedirect.com/topics/earth-and-planetary-sciences/twinspan)</sup> |
| 停止规则 | 划分持续到组变得非常小；通常包含 4 个或更少对象的组不再进一步划分<sup>[2](https://www.sciencedirect.com/topics/earth-and-planetary-sciences/twinspan)</sup> |
| 现代变体 | 改良 TWINSPAN（Roleček 等 2009）先划分异质性最大的组；R 实现包括 Oksanen 的 twinspan 包（调用 Hill 的 FORTRAN 代码）和原生 R 重实现<sup>[5](https://matutosi.github.io/ecan/reference/twinspan.html)</sup><sup> • </sup><sup>[6](https://github.com/jarioksa/twinspan)</sup> |

## 算法工作原理

TWINSPAN 从所有样本归为一组开始，将其一分为二，然后依次划分每个子集，产生嵌套类别的层次结构<sup>[7](https://uw.pressbooks.pub/appliedmultivariatestatistics/chapter/isa/)</sup>。每次分裂基于当前子集的对应分析（也称互平均）第一轴，该轴进一步优化以使二分更清晰<sup>[8](https://github.com/jarioksa/twinspan/blob/master/README.md)</sup>。

**伪种。** 分析前，每个物种的多度被转换为若干二元变量，称为伪种，每个多度截断水平对应一个；物种达到该阈值处伪种记为 1<sup>[4](https://jarioksa.r-universe.dev/twinspan/doc/manual.html)</sup>。这使得半定量盖度-多度尺度可用于原本只处理存在/缺失的排序。出现在不足 1/5 样方中的伪种被降权，以减少稀有物种的影响，因为对应分析对稀有物种敏感<sup>[4](https://jarioksa.r-universe.dev/twinspan/doc/manual.html)</sup>。

**划分与指示种。** 沿第一排序轴进行分裂，方法随后找出最能指示该划分的伪种<sup>[8](https://github.com/jarioksa/twinspan/blob/master/README.md)</sup>。对每侧的忠实度用指示值衡量

\[ I_{j} = \frac{n_{j}^{+}}{n^{+}} - \frac{n_{j}^{-}}{n^{-}} \]

其中 \( n^{+} \) 和 \( n^{-} \) 是分裂正侧和负侧的站点数，\( n_{j}^{+} \)、\( n_{j}^{-} \) 分别计数每侧含伪种 \( j \) 的站点数。一侧所有站点都有而另一侧没有的伪种得分为 1 或 −1；处处都有的得分为 0<sup>[2](https://www.sciencedirect.com/topics/earth-and-planetary-sciences/twinspan)</sup>。指示伪种用于安置位于切点附近临界区的边界样本，每个样本的指示得分（对所选指示种带符号求和）决定其加入哪一侧<sup>[4](https://jarioksa.r-universe.dev/twinspan/doc/manual.html)</sup><sup> • </sup><sup>[8](https://github.com/jarioksa/twinspan/blob/master/README.md)</sup>。

**物种分类。** 样本分类后，物种用相同的二分编码分类，使用每个物种区分样本类的忠实度数据而非伪种表本身。这使物种分类与样本分类一致，并将良好指示种聚在一起，生成赋予该方法名称的有序双向表<sup>[4](https://jarioksa.r-universe.dev/twinspan/doc/manual.html)</sup>。最终表格类似传统植物社会学的结构化表格<sup>[2](https://www.sciencedirect.com/topics/earth-and-planetary-sciences/twinspan)</sup>。

## 用途及与其他方法的比较

TWINSPAN 被生态学家广泛用于植被和其他群落数据的分类，与其配套排序程序 DECORANA 配合使用<sup>[3](https://www.ceh.ac.uk/data/software-models/decorana-and-twinspan)</sup>。应用研究从植被调查到动物数据，例如对 1991 至 2015 年间业余博物学家收集的什罗普郡小鳞翅目记录的分析，其中大多数输出组可从生态学角度加以解释，反映了季节性、土壤类型、海拔和生境管理的影响<sup>[9](https://www.field-studies-council.org/resources/field-studies-journal/using-twinspan-to-extract-ecological-trends-from-opportunistic-data-gathered-by-amateurs-a-case-study-of-shropshire-microlepidoptera/)</sup>。

与凝聚聚类相比，同一数据集的分类通常大致对应但细节不同。当聚类同质性为主要目标时首选凝聚聚类，而 TWINSPAN 更好地反映输入数据物种组成的主要梯度<sup>[2](https://www.sciencedirect.com/topics/earth-and-planetary-sciences/twinspan)</sup>。M. B. Dale 在《植被科学杂志》评论分类策略比较时认为，由于对应分析在识别梯度方面已有一定成功，基于它的分类方法可能比方差最小化方法更好地反映植物社会学家直觉寻求的东西，且 TWINSPAN 内置的指示种表征本身就有价值<sup>[10](https://www.researchgate.net/publication/229710247_Evaluating_classification_strategies)</sup>。

性能取决于底层排序。在 1992 年一项使用已知结构模拟植被数据的研究中，H. van Groenewoud 发现对应分析和去趋势对应分析对第二植被梯度的恢复很差，并将其与 TWINSPAN 表现不佳联系起来，尤其是在第一次划分之后<sup>[11](https://documentsdelivered.com/source/031/140/031140064.php)</sup>。在一项使用 CASI 机载反射率数据对马尼托巴北部泥炭地复合体的遥感研究中，TWINSPAN 聚类与光谱反射率对应不佳，在所研究方法中分类精度最低；最佳类别结合了 TWINSPAN、对应分析和特征可分性分析，但统计上并不优于单独的可分性分析<sup>[12](https://www.sciencedirect.com/science/article/abs/pii/S0034425702000998)</sup>。

## 批评与修改

已记录的问题包括<sup>[2](https://www.sciencedirect.com/topics/earth-and-planetary-sciences/twinspan)</sup>：

1. 指示值只能为 TWINSPAN 自身产生的分类计算；无法提供站点的外部分类来识别物种组。
2. 伪种编码由对多度值应用指定截断水平决定，多度值不必是相对多度；使用相对多度时，它们取决于站点上的其他物种，对于以不同效率采样的移动生物，这种编码可能不稳定。
3. Belbin 和 McDonald（1993）认为该方法假设存在强主导梯度，因此可能遗漏次级梯度，且切点总是放在被分裂组的质心而非数据的大间隙处。

质心问题由 Roleček、Tichý、Zelený 和 Chytrý（2009）的改良 TWINSPAN 解决<sup>[2](https://www.sciencedirect.com/topics/earth-and-planetary-sciences/twinspan)</sup>。在改良算法中，先划分异质性最大的组，异质性由选定的相异性或 beta 多样性度量衡量，用户指定目标聚类数而非层次水平数<sup>[5](https://matutosi.github.io/ecan/reference/twinspan.html)</sup>。

## 软件

原始 1979 年 FORTRAN 程序仍是参考实现。英国生态与水文中心分发 DOS 版本（1994 年更新，带 MS-DOS 界面）以及 Windows 版本 WinTWINS（Hill & Šmilauer 2005）<sup>[3](https://www.ceh.ac.uk/data/software-models/decorana-and-twinspan)</sup>。当前 R 选项包括 Jari Oksanen 的 twinspan 包，直接调用 Hill 的 FORTRAN 代码，结果与原始程序一致<sup>[6](https://github.com/jarioksa/twinspan)</sup>；David Zelený 的 twinspanR 包，是围绕从原始代码编译的 twinspan.exe 的封装，用于 JUICE 和 MEGATAB，实现经典和改良 TWINSPAN<sup>[13](https://rdrr.io/github/zdealveindy/twinspanR/)</sup>；以及 ecan 包中的原生纯 R 实现，逐步遵循 Hill 的程序，并在若干标准 vegan 数据集上精确重现其分组、划分和特征值<sup>[5](https://matutosi.github.io/ecan/reference/twinspan.html)</sup>。

## References

1. [M. O. Hill (1979). TWINSPAN: A FORTRAN Program for Arranging Multivariate Data in an Ordered Two-way Table by Classification of the Individuals and Attributes. Cornell University.](https://books.google.com/books/about/TWINSPAN.html?id=xRlFAAAAYAAJ)
2. [TWINSPAN – an overview, ScienceDirect Topics (Developments in Environmental Modelling, Legendre & Legendre)](https://www.sciencedirect.com/topics/earth-and-planetary-sciences/twinspan)
3. [DECORANA and TWINSPAN, UK Centre for Ecology & Hydrology](https://www.ceh.ac.uk/data/software-models/decorana-and-twinspan)
4. [Package 'twinspan' reference manual, J. Oksanen](https://jarioksa.r-universe.dev/twinspan/doc/manual.html)
5. [Two-way indicator species analysis (TWINSPAN) — twinspan • ecan](https://matutosi.github.io/ecan/reference/twinspan.html)
6. [jarioksa/twinspan: R package for Two-Way Indicator Species Analysis (Hill 1979), GitHub](https://github.com/jarioksa/twinspan)
7. [ISA – Applied Multivariate Statistics in R](https://uw.pressbooks.pub/appliedmultivariatestatistics/chapter/isa/)
8. [twinspan/readme.md at master · jarioksa/twinspan · github](https://github.com/jarioksa/twinspan/blob/master/README.md)
9. [Using TWINSPAN to extract ecological trends from opportunistic data: Shropshire microlepidoptera, Field Studies Journal](https://www.field-studies-council.org/resources/field-studies-journal/using-twinspan-to-extract-ecological-trends-from-opportunistic-data-gathered-by-amateurs-a-case-study-of-shropshire-microlepidoptera/)
10. [M. B. Dale. Evaluating classification strategies, Journal of Vegetation Science 6(3): 437–440](https://www.researchgate.net/publication/229710247_Evaluating_classification_strategies)
11. [H. van Groenewoud (1992). The robustness of correspondence, detrended correspondence and TWINSPAN analysis, Journal of Vegetation Science 3(2): 239–246](https://documentsdelivered.com/source/031/140/031140064.php)
12. [Image classification of a northern peatland complex using spectral and plant community data, Remote Sensing of Environment](https://www.sciencedirect.com/science/article/abs/pii/S0034425702000998)
13. [zdealveindy/twinspanR: TWo-way INdicator SPecies ANalysis (and its modified version) in R](https://rdrr.io/github/zdealveindy/twinspanR/)

---
*Initially written Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 统计学与概率论 › Multivariate association and dimension reduction › Factor analysis and latent variable methods

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/twinspan

English original: https://www.edgepedia.org/twinspan
