Learn R Programming

⚠️There's a newer version (5.5.1) of this package.Take me there.

spsurvey

spsurvey is comprised of functions which implement algorithms for design and analysis of probability surveys. The functions are tailored for Generalized Random Tessellation Stratified survey designs.

Installation

You can install the released version from CRAN using:

# install from CRAN
install.packages('spsurvey')
library(spsurvey)

You can install development version ofspsurvey from GitHub with the following:

# requires devtools to install
install.packages('devtools')
library(devtools)

# install from repository
install_github('USEPA/spsurvey')
library(spsurvey)

To install from GitHub with package vignettes:

library(devtools)
install_github('USEPA/spsurvey', build_vignettes=TRUE)
library(spsurvey)

Example

An overview of the spsurvey package is provided in the users guide that is included with the package. The documentation includes a number of vignettes for the design and analysis of survey designs for point (finite), linear and area (polygons) spatial features. Vignettes are also available for typical survey analyses.

Citation

citation(package = 'spsurvey')
## 
## To cite the spsurvey package in publications use:
## 
##   Kincaid, T. M., Olsen, A. R., and Weber, M. H. (2019).
##   spsurvey: Spatial Survey Design and Analysis. R package
##  version 4.1.0.
## 
## A BibTeX entry for LaTeX users is
## 
##  @Manual{,
##     title = {spsurvey: Spatial Survey Design and Analysis},
##     author = {Thomas M. Kincaid and Anthony R. Olsen and Marc H. Weber},
##     year = {2019},
##     note = {R package version 4.1.0},
##   }

Package Contributions

We encourage users to submit issues and enhancement requests so we may continue to improve our package.

EPA Disclaimer

The United States Environmental Protection Agency (EPA) GitHub project code is provided on an "as is" basis and the user assumes responsibility for its use. EPA has relinquished control of the information and no longer has responsibility to protect the integrity , confidentiality, or availability of the information. Any reference to specific commercial products, processes, or services by service mark, trademark, manufacturer, or otherwise, does not constitute or imply their endorsement, recommendation or favoring by EPA. The EPA seal and logo shall not be used in any manner to imply endorsement of any commercial product or activity by EPA or the United States Government.

License

This project is licensed under the GNU General Public License, GPL-2.

Copy Link

Version

Install

install.packages('spsurvey')

Monthly Downloads

776

Version

4.1.1

License

GPL (>= 3)

Maintainer

Marc Weber

Last Published

December 18th, 2019

Functions in spsurvey (4.1.1)

NRSA_2009

Western Mountains Ecoregion Rivers and Streams
SpatialDesign-class

Class SpatialDesign
SC_estuaries

Estuaries in South Carolina
IN_streams

Streams in the Upper Wabash Basin in Indiana
NLA_2007

Western Mountains Ecoregion Lakes
FL_lakes

Small Lakes in Florida
NE_lakes

Lakes in the Southern New England Region of the U.S.
Luck_Ash_streams

Streams in the Luckiamute Watershed in Oregon
adjwgt

Adjust Survey Design Weights by Categories
UT_ecoregions

Ecoregions in Utah
albersgeod

Project Albers Projection in Plane to Latitude and Longitude (Spheroid)
attrisk.est

Compute the Attributable Risk Estimate
attrisk.analysis

Attributable Risk Analysis for Probability Survey Data
attrisk.var

Compute the Variance Estimate for Attributable Risk
cat.analysis

Categorical Data Analysis for Probability Survey Data
ash1.wgt

Compute the Average Shifted Histogram (ASH) for Weighted Data
cdf.decon

Deconvolution Estimate of the Cumulative Distribution Function
catvar.size

Variance Estimates of the Estimated Size for Categorical Data
catvar.prop

Variance Estimates of Estimated Proportions
category.est

Category Proportion and Size Estimates
cdf.size.total

Size-weighted Cumulative Distribution Funcition Estimate for Total
cdf.size.prop

Size-weighted Cumulative Distribution Function Estimate
cdf.plot

Plot a Cumulatiave Distribution Function
cdf.prop

Estimate of Cumulative Distribution Function for a Proportion
cdf.test

Test for Difference Between Two Estimated Cumulative Distribution Functions
cdf.total

Estimate of Cumulative Distribution Function for a Total
cdf.test.size.prop

Size-Weighted Estimate of Population Proportion for Classes
cdf.test.prop

Estimate of Population Proportion for Classes
cdf.est

Cumulative Distribution Function Estimate for Survey Design
cdf.nresp

Internal Function: Count Number of Responses Less Than a Set of Values
cellWeight

Total Inclusion Probablity for a Grid Cell
change.analysis

Estimation of Change between Two Time Periods in a Probability Survey
cdfvar.size.prop

Variance Estimate for Size-Weighted Cumulative Distribution Function for a Proportion
cdfvar.prop

Variance Estimate for Cumulative Distribution Function for a Proportion
cov.panel.dsgn

Covariance Matrix for a Panel Design
dcdf.total

Deconvoluted Cumulative Distribution Function for Total
dcdf.prop

Deconvoluted Cumulative Distribution Function Estimate for Proportion
cdfvar.size.total

Variance Estimate for Size-weighted Cumulative Distribution Function for a Total
dcdfvar.prop

Variance Estimate for Deconvoluted CDF for Proportion
cont.cdfplot

Plot Multiple Cumulative Distribution Functions
cdfvar.test

Variance-Covariance Matrix Estimate for Estimated Population Proportions
change.est

Estimate Change between Two Surveys
cdfvar.total

Variance Estimate for Cumulative Distribution Function for a Total
changevar.mean

Covariance or Correlation Matrix Estimate of Change in Means between Two Surveys
cont.cdftest

Cumulative Distribution Function Inference for a Probability Survey
constructAddr

Construct the Hierarchical Addresses for a Generalized Random-Tesselation Stratified (GRTS) Survey Design
cont.analysis

Continuous Variable Data Analysis for Probability Survey Data
input.check

Check Input Values for Analytical Functions
irslin

Select an Independent Random Sample (IRS) of a Linear Resource
grtspts

Select a Generalized Random-Tesselation Stratified (GRTS) Sample of a Finite Resource
changevar.prop

Covariance or Correlation Matrix Estimate of Change in Class Proportions between Two Surveys
irsarea

Select an Independent Random Sample (IRS) of an Area Resource
cell.wt

Last Revised: September 24, 2018
dframe.check

Internal Check on Survey Analysis Data Frames
changevar.size

Covariance or Correlation Matrix Estimate of Change in Class Resource Sizes between Two Surveys
examine

Examine Variables in a Data Frame
dsgnsum

Summary of a Survey Design
framesum

Summary of the Sample Frame for a Survey Design
pickFiniteSamplePoints

Select Sample Points from a Simple Features Point Object
insideAreaGridCell

Calculate Clipped Feature Areas in a Set of Grid Cells
input.format

Format an Input Value
dcdfvar.total

Variance Estimate of Deconvoluted CDF for Total
decon_data

Small Lakes in Florida for Examining CDF Deconvolution
pickGridCells

Identify Grid Cells from which Sample Points Will Be Selected
relrisk.est

Relative Risk Estimate for 2x2 Table
dcdf.size.prop

Deconvoluted Size-Weighted Cumulative Distribution Function for Proportion
insideLinearGridCell

Calculate Clipped Feature Lengths in a Set of Grid Cells
grts

Select a Generalized Random-Tesselation Stratified (GRTS) Sample
geodalbers

Project Latitude/Longitude to Albers Projection
interp.axis

Create Right-Side y-Axis Lables for a CDF Plot
sbcsamp

Calculate Spatial Balance Grid Cell Extent and Proportions for a Survey Design
relrisk.var

Variance-Covariance Estimate for the Relative Risk Estimator
selectFeatureID

Identify a Feature in an sf Object for Selecting a Sample Point
dcdf.size.total

Deconvoluted Size-weighted Cumulative Distribution function for Total
dcdfvar.size.prop

Variance Estimate for Deconvoluted Size-weighed CDF for Proportion
dcdfvar.size.total

Variance Estimate of Deconvoluted Size-weighted CDF for Total
irspts

Select an Independent Random Sample (IRS) of a Finite Resource
isotonic

Internal Function: Isotonic Regression
numLevels

Determine the Number of Levels for Hierarchical Randomization for a Generalized Random-Tesselation Stratified (GRTS) Survey Design
localmean.var

Internal Function: Local Mean Variance Estimator
localmean.weight

Internal Function: Local Mean Variance Neighbors and Weights
relrisk.analysis

Relative Risk Analysis for Probability Survey Data
panel_summary

Summary Characteristics of a Revisit Panel Design
read.shape

Read an ESRI Shapefile
localmean.cov

Internal Function: Variance-Covariance Matrix Based on Local Mean Estimator
selectframe

Internal Function: Select All Points in Survey Frame
localmean.df

Internal Function: Degrees of Freedom for Local Mean Variance-Covariance Estimator
warnprnt

Internal Function: Print the Warnings Data Frame
grtslin

Select a Generalized Random-Tesselation Stratified (GRTS) Sample of a Linear Resource
irs

Select an Independent Random Sample (IRS)
interp.cdf

Interpolate CDF Values at a Set of Percentiles
grtsarea

Select a Generalized Random-Tesselation Stratified (GRTS) Sample of an Area Resource
marinus

Marinus Cylindrical Map Projection
ranho

Construct Randomized Hierarchical Addresses for a Generalized Random-Tesselation Stratified (GRTS) Survey Design
mdmlin

Internal Function: GRTS Multipliers for Multi-Density Categories for Linear Network
power.dsgn

Power Calculation for Multiple Panel Designs
mdmpts

Internal Function: GRTS Multipliers for Multi-Density Categories for Points
mdmarea

Internal Function: GRTS Multipliers for Multi-Density Categories for Areas
wnas

Internal Function: Remove NAs from Data
localmean.weight2

Internal Function: Recovery from a Singular Value Decomposition Error
make_grid

Create the Grid for a GRTS Survey Design
pickSamplePoints

Select Sample Points from a Simple Features Object
revisit_bibd

Create a Balanced Incomplete Block Panel Revisit Design
plot_powerpaneldesign

Plot Power Curves for Panel Designs
simex

Internal Function: Extrapolation for Simulation-Extrapolation Function
spsurvey-package

spsurvey: Spatial Survey Design and Analysis
selectpts

Internal Function: Select Probability Sample from a Set of Cells
spsurvey.analysis

Create an Object of Class spsurvey.analysis
revisit_dsgn

Create a Panel Revisit Design
read.dbf

Read the dbf File of an ESRI Shapefile
read.sas

Read a SAS dataset or a SAS XPORT File
uniqueID

Internal Function: Create Unique IDs for a Survey Design
revisit_rand

Create a Revisit Design with Random Assignment to Panels and Time Periods
sorted

Internal Function: Determine if a Vector is Sorted
write.object

Write an Object to a Plot
vecprint

Internal Function: Create Vector to Print
total.est

Estimators for Population Total, Mean, Variance, and Standard Deviation
total.var

Variance Estimate for Population Total, Mean, Variance, and Standard Deviation
sbcframe

Calculate Spatial Balance Grid Cell Extent and Proportion for a Survey Frame
sp2shape

Create an ESRI shapefile from an sp package object
spbalance

Calculate Spatial Balance Metrics for a Survey Design