grts {psurvey.design}R Documentation

Generalized Random-Tessellation Stratified (GRTS) Survey Design

Description

Selects a sample using a generalized random tessellation stratified (GRTS) survey design. The GRTS survey design may include stratification, unequal probability using categories, unequal selection proportional to an auxiliary variable, survey over time structures, and provision for an oversample.

Usage

grts(design, DesignID="Site", SiteBegin=1, type.frame="finite",
   src.frame="shapefile", in.shape=NULL, xy.frame=NULL, xy.frame.units=NULL,
   att.frame=NULL, id=NULL, stratum=NULL, mdcaty=NULL, elmsize=NULL,
   startlev=NULL, maxlev=12, maxtry=1000, shift.grid=TRUE, do.sample=TRUE,
   shapefile=TRUE, prjfilename=NULL, out.shape="sample")

Arguments

design named list of stratum design specifications which are also lists. Stratum names must be subset of values in stratum argument. Each stratum list has four list components:
panel = named vector of sample sizes for each panel in stratum;
seltype = the type of random selection, which must be one of following: "Equal" - equal probability selection, "Unequal" - unequal probability selection by the categories specified in caty.n and mdcaty, or "Continuous" - unequal probability selection proportional to auxiliary variable mdcaty;
caty.n = if seltype equals "Unequal", a named vector of sample sizes for each category specified by mdcaty, where sum of the sample sizes must equal sum of the panel sample sizes, and names must be a subset of values in mdcaty;
over = number of replacement sites ("oversample" sites) for the entire design, which is set equal to 0 if none are required.
DesignID character name for the design, which is used to create a site ID for each site. The default is "Site".
SiteBegin number to use for first site in the design. The default is 1.
type.frame the type of frame, which must be one of following: "finite", "linear", or "area". The default is "finite"
src.frame source of the frame, which equals "shapefile" if frame is to be read from a shapefile and otherwise is equal to NULL. The default is "shapefile".
in.shape name (without any extension) of the input shapefile. If src.frame equal "shapefile" and in.shape equals NULL, then the shapefile or shapefiles in the currrent directory are used. The default is NULL.
xy.frame name of the data structure containing xy-coordinates for elements in the frame, where format depends on type.frame. If src.frame equals "shapefile", then equal to NULL. The default is NULL.
xy.frame.units xy-coordinate system units (e.g., m, km, ft, or NULL). The default is NULL.
att.frame a data frame composed of attributes associated with elements in the frame, which must contain the columns used for stratum and mdcaty (if required). If xy.frame is provided, then rows in att.frame must match list elements in xy.frame. If src.frame equals "shapefile" and att.frame equals NULL, then att.frame is created from the dbf file(s) in the current directory. The default is NULL.
id name of the column from att.frame that identifies the ID value for each element in the frame. If id equals NULL, a column named "id" that contains the values 1:nrow(att.frame) is added to att.frame. The default is NULL.
stratum name of the column from att.frame that identifies stratum membership for each element in the frame. If stratum equals NULL, the design is unstratified, and a column named "stratum" (with all its elements equal to the stratum name specified in design) is added to att.frame. The default is NULL.
mdcaty name of the column from att.frame that identifies the unequal probability category for each element in the frame. The default is NULL.
elmsize name of the column from att.frame that contains length of frame elements when type.frame equals "linear" or area of frame elements when type.frame equals "area". If src.frame equals "shapefile", then this argument is not used. The default is NULL.
startlev initial number of hierarchical levels to use for the GRTS grid, which must be less than or equal to maxlev (if maxlev is specified) and cannot be greater than 12. The default is NULL.
maxlev maximum number of hierarchical levels to use for the GRTS grid, which cannot be greater than 12. The default is 12.
maxtry maximum number of iterations for randomly generating a point within a grid cell to select a site when type.frame equals "area". The default is 1000.
shift.grid option to randomly shift the hierarchical grid, where TRUE means shift the grid and FALSE means do not shift the grid, which is useful if one desires strict spatial stratification by hierarchical grid cells. The default is TRUE.
do.sample option to select a sample, where TRUE means select a sample and FALSE means return the entire sample frame in reverse hierarchical order. Note that FALSE can only be used when resource.type equals "points" and seltype equals "Equal". The default is TRUE.
shapefile option to create a shapefile containing the survey design information, where TRUE equals create a shapefile and FALSE equals do not create a shapefile. The default is TRUE.
prjfilename name (without any extension) of the project file for an input shapefile. The default is NULL.
out.shape name (without any extension) of the output shapefile containing the survey design information. The default is "sample".

Details

The GRTS survey design process selects a spatially balanced sample based on the survey design specification.

Function dsgnsum(), can be used to summarize the sites selected for a survey design.

Value

An sp package object containing the survey design information and any additional attribute variables that were provided. The object is assigned class "SpatialPointsDataFrame". For further information regarding the output object, see documentation for the sp package. Optionally, a shapefile can be created that contains the survey design information.

Author(s)

Tony Olsen Olsen.Tony@epa.gov
Tom Kincaid Kincaid.Tom@epa.gov

References

Stevens, D.L., Jr., and A.R. Olsen. (2004). Spatially-balanced sampling of natural resources. Journal of the American Statistical Association 99: 262-278.

See Also

grtspts grtslin grtsarea albersgeod dsgnsum

Examples

## Not run: 
# The following example will select a sample from an area resource.  The design
# includes two strata.  For Stratum 1, an equal probability sample of size 50
# will be selected for a single panel.  For Stratum 2, an unequal probability
# sample of size 50 will be selected for each of two panels.  The sample for
# Stratum 2 will be approportioned into samples of size 25 for each of four
# unequal probability categories.  In addition both strata will include
# oversamples (size 10 for Stratum 1 and size 75 for Stratum 2).  It is assumed
# that a shapefile defining the polygons for the area resource is located in the
# folder from which R is started.  Attribute data for the design will be read
# from the dbf file of the shapefile, which is assumed to have variables named
# "test.stratum" and "test.mdcaty" that specify stratum membership value and
# unequal probability category, respectively, for each record in the shapefile.
# A shapefile named "test.sample" containing the survey design information will
# be created.
test.design <- list(Stratum1=list(panel=c(PanelOne=50),
   seltype="Equal", over=10), Stratum2=list(panel=c(PanelOne=50,
   PanelTwo=50), seltype="Unequal", caty.n=c(CatyOne=25, CatyTwo=25,
   CatyThree=25, CatyFour=25), over=75)
test.attframe <- read.dbf("test.shapefile")
test.sample <- grts(design=test.design, DesignID="Test.Site", type.frame="area",
   src.frame="shapefile", in.shape="test.shapefile", att.frame=test.attframe,
   stratum="test.stratum", mdcaty="test.mdcaty", shapefile=TRUE,
   out.shape="test.sample")
## End(Not run)

[Package psurvey.design version 2.2.1 Index]