spsurvey (version 4.1.4)

input.check: Check Input Values for Analytical Functions

Description

This function checks input values for errors, consistency, and compatibility with analytical functions.

Usage

input.check(nresp, wgt, sigma, var.sigma, xcoord, ycoord, stratum.ind,
  stratum, stratum.levels, nstrata, cluster.ind, cluster, cluster.levels,
  ncluster, wgt1, xcoord1, ycoord1, popsize, pcfactor.ind, pcfsize,
  N.cluster, stage1size, support, swgt.ind, swgt, swgt1, vartype, conf,
  cdfval = NULL, pctval = NULL, subpop = NULL)

Arguments

nresp

The number of response values.

wgt

Vector of the final adjusted weights.

sigma

Measurement error variance.

var.sigma

Variance of the measurement error variance.

xcoord

Vector of the x-coordinates for location.

ycoord

Vector of the y-coordinates for location.

stratum.ind

Logical value that indicates whether the sample is stratified, where TRUE = a stratified sample and FALSE = not a stratified sample.

stratum

Vector of the stratum codes.

stratum.levels

Levels of the stratum variable.

nstrata

Number of strata.

cluster.ind

Logical value that indicates whether the sample is a two- stage sample, where TRUE = a two-stage sample and FALSE = not a two- stage sample.

cluster

Vector of the stage one sampling unit codes.

cluster.levels

Factor levels of the stage one sampling unit codes.

ncluster

The number of stage one sampling units in the sample.

wgt1

Vector of the final adjusted stage one weights.

xcoord1

Vector of the stage one x-coordinates for location.

ycoord1

Vector of the stage one y-coordinates for location.

popsize

Known size of the resource.

pcfactor.ind

Logical value that indicates whether the population correction factor is used during variance estimation, where TRUE = use the population correction factor and FALSE = do not use the factor. To employ the correction factor for a single-stage sample, values must be supplied for arguments pcfsize and support. To employ the correction factor for a two-stage sample, values must be supplied for arguments N.cluster, stage1size, and support.

pcfsize

Size of the resource, which is required for calculation of finite and continuous population correction factors for a single-stage sample. For a stratified sample this argument must be a vector containing a value for each stratum and must have the names attribute set to identify the stratum codes.

N.cluster

Number of stage one sampling units in the resource.

stage1size

Known size of the stage one sampling units.

support

Vector of the support for each sampling unit.

swgt.ind

Logical value that indicates whether the sample is a size- weighted sample, where TRUE = a size-weighted sample and FALSE = not a size-weighted sample.

swgt

Vector of the size-weight for each site.

swgt1

Vector of the stage one size-weight for each site.

vartype

The choice of variance estimator, where "Local" = local mean estimator and "SRS" = SRS estimator.

conf

The confidence level.

cdfval

Vector of the set of values at which the CDF is estimated.

pctval

Vector of the set of values at which percentiles are estimated.

subpop

Data frame describing sets of populations and subpopulations for which estimates will be calculated.

Value

A list consisting of popsize, pcfsize, N.cluster, and stage1size.

Other Functions Required

vecprint

takes an input vector and outputs a character string with line breaks inserted