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 spsurvey from github with:

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

# install from repository
install_github('USEPA/spsurvey')
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. and Olsen, A. R. (2016). spsurvey: Spatial Survey
##   Design and Analysis. R package version 3.3.
## 
## A BibTeX entry for LaTeX users is
## 
##   @Manual{,
##     title = {spsurvey: Spatial Survey Design and Analysis},
##     author = {Thomas M. Kincaid and Anthony R. Olsen},
##     year = {2016},
##     note = {R package version 3.3},
##   }

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.0

License

GPL (>= 3)

Maintainer

Marc Weber

Last Published

August 30th, 2019

Functions in spsurvey (4.1.0)

SC_estuaries

Estuaries in South Carolina
SpatialDesign-class

Class SpatialDesign
NRSA_2009

Western Mountains Ecoregion Rivers and Streams
NLA_2007

Western Mountains Ecoregion Lakes
Luck_Ash_streams

Streams in the Luckiamute Watershed in Oregon
UT_ecoregions

Ecoregions in Utah
FL_lakes

Small Lakes in Florida
adjwgt

Adjust Survey Design Weights by Categories
NE_lakes

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

Streams in the Upper Wabash Basin in Indiana
attrisk.var

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

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

Compute the Attributable Risk Estimate
cdfvar.prop

Variance Estimate for Cumulative Distribution Function for a Proportion
attrisk.analysis

Attributable Risk Analysis for Probability Survey Data
constructAddr

Construct the Hierarchical Addresses for a Generalized Random-Tesselation Stratified (GRTS) Survey Design
cdf.size.total

Size-weighted Cumulative Distribution Funcition Estimate for Total
insideAreaGridCell

Calculate Clipped Feature Areas in a Set of Grid Cells
cont.cdftest

Cumulative Distribution Function Inference for a Probability Survey
cont.cdfplot

Plot Multiple Cumulative Distribution Functions
input.format

Format an Input Value
cdf.size.prop

Size-weighted Cumulative Distribution Function Estimate
cont.analysis

Continuous Variable Data Analysis for Probability Survey Data
interp.cdf

Interpolate CDF Values at a Set of Percentiles
dcdf.total

Deconvoluted Cumulative Distribution Function for Total
read.dbf

Read the dbf File of an ESRI Shapefile
irs

Select an Independent Random Sample (IRS)
examine

Examine Variables in a Data Frame
cdf.plot

Plot a Cumulatiave Distribution Function
albersgeod

Project Albers Projection in Plane to Latitude and Longitude (Spheroid)
cdfvar.size.total

Variance Estimate for Size-weighted Cumulative Distribution Function for a Total
ash1.wgt

Compute the Average Shifted Histogram (ASH) for Weighted Data
cdfvar.test

Variance-Covariance Matrix Estimate for Estimated Population Proportions
cdf.prop

Estimate of Cumulative Distribution Function for a Proportion
framesum

Summary of the Sample Frame for a Survey Design
read.sas

Read a SAS dataset or a SAS XPORT File
geodalbers

Project Latitude/Longitude to Albers Projection
irsarea

Select an Independent Random Sample (IRS) of an Area Resource
marinus

Marinus Cylindrical Map Projection
revisit_rand

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

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

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

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

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

Internal Function: Remove NAs from Data
selectframe

Internal Function: Select All Points in Survey Frame
dcdfvar.prop

Variance Estimate for Deconvoluted CDF for Proportion
cat.analysis

Categorical Data Analysis for Probability Survey Data
write.object

Write an Object to a Plot
plot_powerpaneldesign

Plot Power Curves for Panel Designs
panel_summary

Summary Characteristics of a Revisit Panel Design
numLevels

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

Create a Balanced Incomplete Block Panel Revisit Design
pickSamplePoints

Select Sample Points from a Simple Features Object
cdf.est

Cumulative Distribution Function Estimate for Survey Design
cdf.nresp

Internal Function: Count Number of Responses Less Than a Set of Values
cell.wt

Last Revised: September 24, 2018
cdfvar.total

Variance Estimate for Cumulative Distribution Function for a Total
revisit_dsgn

Create a Panel Revisit Design
dcdf.size.prop

Deconvoluted Size-Weighted Cumulative Distribution Function for Proportion
spsurvey-package

spsurvey: Spatial Survey Design and Analysis
spbalance

Calculate Spatial Balance Metrics for a Survey Design
category.est

Category Proportion and Size Estimates
catvar.prop

Variance Estimates of Estimated Proportions
cdf.test.size.prop

Size-Weighted Estimate of Population Proportion for Classes
catvar.size

Variance Estimates of the Estimated Size for Categorical Data
dcdfvar.size.prop

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

Deconvoluted Size-weighted Cumulative Distribution function for Total
cdf.decon

Deconvolution Estimate of the Cumulative Distribution Function
cdf.total

Estimate of Cumulative Distribution Function for a Total
dcdfvar.size.total

Variance Estimate of Deconvoluted Size-weighted CDF for Total
insideLinearGridCell

Calculate Clipped Feature Lengths in a Set of Grid Cells
localmean.var

Internal Function: Local Mean Variance Estimator
localmean.weight

Internal Function: Local Mean Variance Neighbors and Weights
interp.axis

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

Internal Function: Select Probability Sample from a Set of Cells
mdmlin

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

Internal Function: GRTS Multipliers for Multi-Density Categories for Points
change.est

Estimate Change between Two Surveys
cov.panel.dsgn

Covariance Matrix for a Panel Design
dcdf.prop

Deconvoluted Cumulative Distribution Function Estimate for Proportion
changevar.mean

Covariance or Correlation Matrix Estimate of Change in Means between Two Surveys
cdf.test

Test for Difference Between Two Estimated Cumulative Distribution Functions
cdf.test.prop

Estimate of Population Proportion for Classes
ranho

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

Power Calculation for Multiple Panel Designs
cellWeight

Total Inclusion Probablity for a Grid Cell
change.analysis

Estimation of Change between Two Time Periods in a Probability Survey
uniqueID

Internal Function: Create Unique IDs for a Survey Design
sorted

Internal Function: Determine if a Vector is Sorted
total.var

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

Internal Function: Extrapolation for Simulation-Extrapolation Function
dcdfvar.total

Variance Estimate of Deconvoluted CDF for Total
decon_data

Small Lakes in Florida for Examining CDF Deconvolution
grtslin

Select a Generalized Random-Tesselation Stratified (GRTS) Sample of a Linear Resource
localmean.cov

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

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

Covariance or Correlation Matrix Estimate of Change in Class Proportions between Two Surveys
changevar.size

Covariance or Correlation Matrix Estimate of Change in Class Resource Sizes between Two Surveys
dframe.check

Internal Check on Survey Analysis Data Frames
dsgnsum

Summary of a Survey Design
grtspts

Select a Generalized Random-Tesselation Stratified (GRTS) Sample of a Finite Resource
localmean.df

Internal Function: Degrees of Freedom for Local Mean Variance-Covariance Estimator
localmean.weight2

Internal Function: Recovery from a Singular Value Decomposition Error
make_grid

Create the Grid for a GRTS Survey Design
relrisk.est

Relative Risk Estimate for 2x2 Table
vecprint

Internal Function: Create Vector to Print
relrisk.var

Variance-Covariance Estimate for the Relative Risk Estimator
warnprnt

Internal Function: Print the Warnings Data Frame
irspts

Select an Independent Random Sample (IRS) of a Finite Resource
input.check

Check Input Values for Analytical Functions
isotonic

Internal Function: Isotonic Regression
pickGridCells

Identify Grid Cells from which Sample Points Will Be Selected
spsurvey.analysis

Create an Object of Class spsurvey.analysis
read.shape

Read an ESRI Shapefile
sbcsamp

Calculate Spatial Balance Grid Cell Extent and Proportions for a Survey Design
pickFiniteSamplePoints

Select Sample Points from a Simple Features Point Object
relrisk.analysis

Relative Risk Analysis for Probability Survey Data
selectFeatureID

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

Estimators for Population Total, Mean, Variance, and Standard Deviation