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

648

Version

4.1.4

License

GPL (>= 3)

Maintainer

Marc Weber

Last Published

September 18th, 2020

Functions in spsurvey (4.1.4)

UT_ecoregions

Ecoregions in Utah
NLA_2007

Western Mountains Ecoregion Lakes
NE_lakes

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

Estuaries in South Carolina
Luck_Ash_streams

Streams in the Luckiamute Watershed in Oregon
FL_lakes

Small Lakes in Florida
NRSA_2009

Western Mountains Ecoregion Rivers and Streams
SpatialDesign-class

Class SpatialDesign
IN_streams

Streams in the Upper Wabash Basin in Indiana
adjwgt

Adjust Survey Design Weights by Categories
category.est

Category Proportion and Size Estimates
cdf.est

Cumulative Distribution Function Estimate for Survey Design
cdf.plot

Plot a Cumulatiave Distribution Function
cdf.decon

Deconvolution Estimate of the Cumulative Distribution Function
albersgeod

Project Albers Projection in Plane to Latitude and Longitude (Spheroid)
cdf.nresp

Internal Function: Count Number of Responses Less Than a Set of Values
ash1.wgt

Compute the Average Shifted Histogram (ASH) for Weighted Data
attrisk.var

Compute the Variance Estimate for Attributable Risk
cdfvar.size.total

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

Size-weighted Cumulative Distribution Function Estimate
catvar.size

Variance Estimates of the Estimated Size for Categorical Data
cat.analysis

Categorical Data Analysis for Probability Survey Data
cdf.test.prop

Estimate of Population Proportion for Classes
cdf.size.total

Size-weighted Cumulative Distribution Funcition Estimate for Total
attrisk.analysis

Attributable Risk Analysis for Probability Survey Data
attrisk.est

Compute the Attributable Risk Estimate
cdfvar.test

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

Estimate Change between Two Surveys
cont.cdfplot

Plot Multiple Cumulative Distribution Functions
cdf.prop

Estimate of Cumulative Distribution Function for a Proportion
cont.cdftest

Cumulative Distribution Function Inference for a Probability Survey
changevar.mean

Covariance or Correlation Matrix Estimate of Change in Means between Two Surveys
dcdf.total

Deconvoluted Cumulative Distribution Function for Total
dcdf.size.prop

Deconvoluted Size-Weighted Cumulative Distribution Function for Proportion
input.format

Format an Input Value
dcdfvar.size.prop

Variance Estimate for Deconvoluted Size-weighed CDF for Proportion
irslin

Select an Independent Random Sample (IRS) of a Linear Resource
dcdfvar.prop

Variance Estimate for Deconvoluted CDF for Proportion
catvar.prop

Variance Estimates of Estimated Proportions
dcdf.size.total

Deconvoluted Size-weighted Cumulative Distribution function for Total
numLevels

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

Select a Generalized Random-Tesselation Stratified (GRTS) Sample of a Linear Resource
cell.wt

Last Revised: September 24, 2018
cdfvar.total

Variance Estimate for Cumulative Distribution Function for a Total
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
insideAreaGridCell

Calculate Clipped Feature Areas in a Set of Grid Cells
cdf.test

Test for Difference Between Two Estimated Cumulative Distribution Functions
constructAddr

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

Internal Function: Print the Warnings Data Frame
framesum

Summary of the Sample Frame for a Survey Design
examine

Examine Variables in a Data Frame
revisit_bibd

Create a Balanced Incomplete Block Panel Revisit Design
cellWeight

Total Inclusion Probablity for a Grid Cell
input.check

Check Input Values for Analytical Functions
grtspts

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

Project Latitude/Longitude to Albers Projection
decon_data

Small Lakes in Florida for Examining CDF Deconvolution
interp.cdf

Interpolate CDF Values at a Set of Percentiles
irs

Select an Independent Random Sample (IRS)
change.analysis

Estimation of Change between Two Time Periods in a Probability Survey
dcdfvar.total

Variance Estimate of Deconvoluted CDF for Total
cont.analysis

Continuous Variable Data Analysis for Probability Survey Data
cdfvar.prop

Variance Estimate for Cumulative Distribution Function for a Proportion
changevar.size

Covariance or Correlation Matrix Estimate of Change in Class Resource Sizes between Two Surveys
spsurvey-package

spsurvey: Spatial Survey Design and Analysis
cdf.test.size.prop

Size-Weighted Estimate of Population Proportion for Classes
localmean.cov

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

Select Sample Points from a Simple Features Point Object
pickGridCells

Identify Grid Cells from which Sample Points Will Be Selected
sbcsamp

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

Internal Function: Local Mean Variance Estimator
grts

Select a Generalized Random-Tesselation Stratified (GRTS) Sample
read.dbf

Read the dbf File of an ESRI Shapefile
mdmlin

Internal Function: GRTS Multipliers for Multi-Density Categories for Linear Network
mdmpts

Internal Function: GRTS Multipliers for Multi-Density Categories for Points
cdfvar.size.prop

Variance Estimate for Size-Weighted Cumulative Distribution Function for a Proportion
relrisk.est

Relative Risk Estimate for 2x2 Table
power.dsgn

Power Calculation for Multiple Panel Designs
ranho

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

Create an Object of Class spsurvey.analysis
read.sas

Read a SAS dataset or a SAS XPORT File
dcdfvar.size.total

Variance Estimate of Deconvoluted Size-weighted CDF for Total
selectframe

Internal Function: Select All Points in Survey Frame
revisit_dsgn

Create a Panel Revisit Design
selectpts

Internal Function: Select Probability Sample from a Set of Cells
total.est

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

Variance Estimate for Population Total, Mean, Variance, and Standard Deviation
localmean.weight

Internal Function: Local Mean Variance Neighbors and Weights
localmean.df

Internal Function: Degrees of Freedom for Local Mean Variance-Covariance Estimator
relrisk.analysis

Relative Risk Analysis for Probability Survey Data
grtsarea

Select a Generalized Random-Tesselation Stratified (GRTS) Sample of an Area Resource
cdf.total

Estimate of Cumulative Distribution Function for a Total
localmean.weight2

Internal Function: Recovery from a Singular Value Decomposition Error
sp2shape

Create an ESRI shapefile from an sp package object
insideLinearGridCell

Calculate Clipped Feature Lengths in a Set of Grid Cells
make_grid

Create the Grid for a GRTS 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
panel_summary

Summary Characteristics of a Revisit Panel Design
wnas

Internal Function: Remove NAs from Data
read.shape

Read an ESRI Shapefile
write.object

Write an Object to a Plot
revisit_rand

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

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

Select Sample Points from a Simple Features Object
cov.panel.dsgn

Covariance Matrix for a Panel Design
dsgnsum

Summary of a Survey Design
spbalance

Calculate Spatial Balance Metrics for a Survey Design
mdmarea

Internal Function: GRTS Multipliers for Multi-Density Categories for Areas
dcdf.prop

Deconvoluted Cumulative Distribution Function Estimate for Proportion
dframe.check

Internal Check on Survey Analysis Data Frames
interp.axis

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

Internal Function: Isotonic Regression
irspts

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

Marinus Cylindrical Map Projection
simex

Internal Function: Extrapolation for Simulation-Extrapolation Function
sorted

Internal Function: Determine if a Vector is Sorted
uniqueID

Internal Function: Create Unique IDs for a Survey Design
plot_powerpaneldesign

Plot Power Curves for Panel Designs
vecprint

Internal Function: Create Vector to Print