Package: spsurvey 5.6.1

Michael Dumelle

spsurvey: Spatial Sampling Design and Analysis

A design-based approach to statistical inference, with a focus on spatial data. Spatially balanced samples are selected using the Generalized Random Tessellation Stratified (GRTS) algorithm. The GRTS algorithm can be applied to finite resources (point geometries) and infinite resources (linear / linestring and areal / polygon geometries) and flexibly accommodates a diverse set of sampling design features, including stratification, unequal inclusion probabilities, proportional (to size) inclusion probabilities, legacy (historical) sites, a minimum distance between sites, and two options for replacement sites (reverse hierarchical order and nearest neighbor). Data are analyzed using a wide range of analysis functions that perform categorical variable analysis, continuous variable analysis, attributable risk analysis, risk difference analysis, relative risk analysis, change analysis, and trend analysis. spsurvey can also be used to summarize objects, visualize objects, select samples that are not spatially balanced, select panel samples, measure the amount of spatial balance in a sample, adjust design weights, and more. For additional details, see Dumelle et al. (2023) <doi:10.18637/jss.v105.i03>.

Authors:Michael Dumelle [aut, cre], Tom Kincaid [aut], Anthony R. Olsen [aut], Marc Weber [aut], Don Stevens [ctb], Denis White [ctb], Amanda M. Nahlik [ctb], Sarah Lehmann [ctb]

spsurvey_5.6.1.tar.gz
spsurvey_5.6.1.zip(r-4.7)spsurvey_5.6.1.zip(r-4.6)spsurvey_5.6.1.zip(r-4.5)
spsurvey_5.6.1.tgz(r-4.6-any)spsurvey_5.6.1.tgz(r-4.5-any)
spsurvey_5.6.1.tar.gz(r-4.7-any)spsurvey_5.6.1.tar.gz(r-4.6-any)
spsurvey_5.6.1.tgz(r-4.6-emscripten)
manual.pdf |manual.html
card.svg |card.png
spsurvey/json (API)
NEWS

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

Bug tracker:https://github.com/usepa/spsurvey/issues

Pkgdown/docs site:https://usepa.github.io

Datasets:

On CRAN:

Conda:

ordresearch

8.37 score 22 stars 2 packages 445 scripts 921 downloads 34 exports 35 dependencies

Last updated from:0914fcd071. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64OK251
source / vignettesOK226
linux-release-x86_64OK242
macos-release-arm64OK146
macos-oldrel-arm64OK152
windows-develOK205
windows-releaseOK191
windows-oldrelOK191
wasm-releaseOK138

Exports:adjwgtadjwgtNRash1_wgtattrisk_analysiscat_analysiscdf_plotchange_analysiscont_analysiscont_cdfplotcont_cdftestcov_panel_dsgndiffrisk_analysiserrorprntgrtsirslocalmean_covlocalmean_varlocalmean_weightpd_summarypower_dsgnppd_plotrelrisk_analysisrevisit_bibdrevisit_dsgnrevisit_randsp_balancesp_framesp_plotsp_rbindsp_summarysp_unframestopprnttrend_analysiswarnprnt

Dependencies:AlgDesignbootclassclassIntcrossdesDBIdeldire1071gtoolsKernSmoothlatticelme4lpSolveMASSMatrixminqamitoolsnlmenloptrnumDerivproxyrbibutilsRcppRcppArmadilloRcppEigenRdpackreformulasrlangs2samplingsfsurveysurvivalunitswk

Start Here

Rendered fromstart-here.Rmdusingknitr::rmarkdownon May 16 2026.

Last update: 2025-09-29
Started: 2021-10-05

Readme and manuals

Help Manual

Help pageTopics
spsurvey: Spatial Sampling Design and Analysisspsurvey-package spsurvey
Adjust survey design weights by categoriesadjwgt
Adjust survey design weights for non-response by categoriesadjwgtNR
Compute the average shifted histogram (ASH) for one-dimensional weighted dataash1_wgt
Attributable risk analysisattrisk_analysis
Categorical variable analysiscat_analysis
Plot a cumulative distribution function (CDF)cdf_plot
Change analysischange_analysis
Continuous variable analysiscont_analysis
Create a PDF file containing cumulative distribution functions (CDF) plotscont_cdfplot
Cumulative distribution function (CDF) inference for a probability surveycont_cdftest
Create a covariance matrix for a panel designcov_panel_dsgn
Risk difference analysisdiffrisk_analysis
Print errors from analysis functionserrorprnt
Select a generalized random tessellation stratified (GRTS) samplegrts
Illinois River dataIllinois_River
Illinois River legacy dataIllinois_River_Legacy
Select an independent random sample (IRS)irs
Lake Ontario dataLake_Ontario
Internal Function: Variance-Covariance Matrix Based on Local Mean Estimatorlocalmean_cov
Internal Function: Local Mean Variance Estimatorlocalmean_var
Internal Function: Local Mean Variance Neighbors and Weightslocalmean_weight
New England Lakes dataNE_Lakes
New England Lakes data (as a data frame)NE_Lakes_df
New England Lakes legacy dataNE_Lakes_Legacy
NLA PNW dataNLA_PNW
NRSA EPA7 dataNRSA_EPA7
Summary characteristics of a panel revisit designpd_summary
Plot sampling frames, design sites, and analysis data.plot plot.sp_design plot.sp_frame
Plot a cumulative distribution function (CDF)plot.sp_CDF
Power calculation for multiple panel designspower_dsgn
Plot power curves for panel designsppd_plot
Relative risk analysisrelrisk_analysis
Create a balanced incomplete block panel revisit designrevisit_bibd
Create a panel revisit designrevisit_dsgn
Create a revisit design with random assignment to panels and time periodsrevisit_rand
Calculate spatial balance metricssp_balance
'sp_frame' objectssp_frame sp_unframe
Plot sampling frames, design sites, and analysis data.sp_plot sp_plot.default sp_plot.sp_design
Combine rows from GRTS or IRS samples.sp_rbind
Summarize sampling frames, design sites, and analysis data.sp_summary sp_summary.default sp_summary.sp_design
Print grts() and irs() errors.stopprnt
Summarize sampling frames, design sites, and analysis data.summary summary.sp_design summary.sp_frame
Trend analysistrend_analysis
Print grts(), irs()), and analysis function warningswarnprnt