Package: SPAS 2026.12.3

Carl James Schwarz

SPAS: Stratified-Petersen Analysis System

The Stratified-Petersen Analysis System ('SPAS') is designed to estimate abundance in two-sample capture-recapture experiments where the capture and recaptures are stratified. This is a generalization of the simple 'Lincoln-Petersen' estimator. Strata may be defined in time or in space or both, and the s strata in which marking takes place may differ from the t strata in which recoveries take place. When s=t, 'SPAS' reduces to the method described by 'Darroch' (1961) <doi:10.2307/2332748>. When s<t, 'SPAS' implements the methods described in 'Plante', 'Rivest', and 'Tremblay' (1998) <doi:10.2307/2533994>. 'Schwarz' and 'Taylor' (1998) <doi:10.1139/f97-238> describe the use of SPAS in estimating return of salmon stratified by time and geography. A related package, 'BTSPAS', deals with temporal stratification where a spline is used to model the distribution of the population over time as it passes the second capture location. This is the R-version of the (now obsolete) standalone Windows program of the same name.

Authors:Carl James Schwarz [aut, cre, cph]

SPAS_2026.12.3.tar.gz
SPAS_2026.12.3.zip(r-4.7-x86_64)SPAS_2026.12.3.zip(r-4.7-arm64)SPAS_2026.12.3.zip(r-4.6-x86_64)SPAS_2026.12.3.zip(r-4.6-arm64)
SPAS_2026.12.3.tar.gz(r-4.7-arm64)SPAS_2026.12.3.tar.gz(r-4.7-x86_64)SPAS_2026.12.3.tar.gz(r-4.6-arm64)SPAS_2026.12.3.tar.gz(r-4.6-x86_64)
SPAS_2026.12.3.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
SPAS/json (API)

# Install 'SPAS' in R:
install.packages('SPAS', repos = c('https://cran.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/cschwarz-stat-sfu-ca/spas/issues

Uses libs:
  • c++– GNU Standard C++ Library v3

On CRAN:

Conda:

cpp

5.20 score 38 scripts 167 downloads 6 mentions 3 exports 28 dependencies

Last updated from:7c0e7bd80d. Checks:10 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-arm64OK173
linux-devel-x86_64OK196
source / vignettesOK279
linux-release-arm64OK183
linux-release-x86_64OK186
windows-devel-arm64OK404
windows-devel-x86_64OK184
windows-release-arm64OK395
windows-release-x86_64OK157
wasm-releaseOK125

Exports:SPAS.autopoolSPAS.fit.modelSPAS.print.model

Dependencies:backportscheckmatecliexpmgenericsgluelatticelifecyclemagrittrMASSMatrixmsmmvtnormnumDerivpillarpkgconfigplyrRcppRcppEigenreshape2rlangstringistringrsurvivaltibbleTMButf8vctrs

Automatic Pooling
Introduction | Example. | Load the SPAS package | Import the data. | Automate Pooling | Fitting allowing for automated pooling. | References

Last update: 2026-12-01
Started: 2023-04-20

Conne River 1991 Data
Introduction | Load the SPAS package | Import the data. | Fitting the Stratified-Petersen model | Results from model 1 (no pooling). | Physically pooling some rows and columns | Pooling the first two rows, the last two rows, and the last two columns | Physically pooling to a single row and complete pooling | Comparing different physical pooling | Logical pooling | Logical pooling the first two rows, the last two rows, and physical pooling of the last two columns | References

Last update: 2026-12-01
Started: 2019-02-18

Conne River 1992 Data
Introduction | Load the SPAS package | Import the data. | Fitting the Stratified-Petersen model | Results from model 1 (no pooling). | Physically pooling some rows and columns | Pooling to a single row and complete pooling | Comparing different pooling | References

Last update: 2026-12-01
Started: 2019-02-18

Harrison River Female Chinook 2011 Data
Introduction | Load the SPAS package | Import the data. | Fitting the Stratified-Petersen model | Results from model 1 (no pooling). | Pooling some rows and columns | Physically pooling first two rows and last two rows | Physical pooling to a single row and complete pooling | Logically pooling the first two rows and last two rows. | Logical pooling to a single row and complete pooling | Logically pooling every successive pair of rows | Comparing the different estimates: | References

Last update: 2026-12-01
Started: 2019-02-18

Pooling Columns
Why it is not possible to compare different column poolings. | A sample dataset | Models with 2 rows and different number of columns | Full 2x4 stratified analysis | Reducing to a 2x3 matrix by pooling columns 3 and 4. | Reducing to a 2x2 matrix by pooling columns 1 and 2, and then 3 and 4. | Comparing the estimates | Comparing results with 1 row and different number of columns | Pooling over all rows using physical pooling | Pooling over all rows using logical pooling | Pooling over all rows and last two columns using physical pooling | Complete physical pooling (Pooled Petersen Estimator) | Comparing the estimates of abundance | References

Last update: 2026-12-01
Started: 2019-12-02

Testing for Pooled Petersen
Testing if a Pooled Petersen is appropriate | Fitting the models | Reading in the data | Fully 3x3 stratified analysis | Pooling over all rows using physical pooling | Pooling over all rows and last two columns using physical pooling | Complete physical pooling (Pooled Petersen Estimator) | Get the model objects fitted by TMB and create a report | References

Last update: 2026-12-01
Started: 2019-12-02

Things that can go wrong
Things that can go wrong. | Rows are proportional | Rows are approximately proportional | Columns that are all zero | References

Last update: 2026-12-01
Started: 2019-12-02