Learn R Programming

spsurvey (version 4.0.0)

dcdfvar.total: Variance Estimate of Deconvoluted CDF for Total

Description

This function calculates variance estimates of the estimated, deconvoluted cumulative distribution function (CDF) for the total of a discrete or a continuous resource. Either the simple random sampling (SRS) variance estimator or the local mean variance estimator is calculated, which is subject to user control. The SRS variance estimator uses the independent random sample approximation to calculate joint inclusion probabilities. When variance of the estimated measurement error variance is nonzero, a correction factor is added to the estimated variance of the CDF. The function can accomodate single-stage and two-stage samples. Finite population and continuous population correction factors can be utilized in variance estimation.

Usage

dcdfvar.total(g, dg, var.sigma, wgt, x, y, cdfest, stratum.ind,
  stratum.level, cluster.ind, cluster, wgt1, x1, y1, popsize, pcfactor.ind,
  pcfsize, N.cluster, stage1size, support, vartype, warn.ind, warn.df,
  warn.vec)

Arguments

g

Vector of the values of the deconvolution function g(.) evaluated at a specified value for the response value for each site.

dg

Vector of the derivative of the deconvolution function g(.) evaluated at val for the response value for each site.

var.sigma

Variance of the measurement error variance.

wgt

Vector of the final adjusted weight (inverse of the sample inclusion probability) for each site, which is either the weight for a single- stage sample or the stage two weight for a two-stage sample.

x

Vector of x-coordinate for location for each site, which is either the x-coordinate for a single-stage sample or the stage two x-coordinate for a two-stage sample.

y

Vector of y-coordinate for location for each site, which is either the y-coordinate for a single-stage sample or the stage two y-coordinate for a two-stage sample.

cdfest

The CDF estimate.

stratum.ind

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

stratum.level

The stratum level.

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 (primary sampling unit or cluster) code for each site.

wgt1

Vector of the final adjusted stage one weight for each site.

x1

Vector of the stage one x-coordinate for location for each site.

y1

Vector of the stage one y-coordinate for location for each site.

popsize

Known size of the resource, which is used to perform ratio adjustment to estimators expressed using measurement units for the resource. For a finite resource, this argument is either the total number of sampling units or the known sum of size-weights. For an extensive resource, this argument is the measure of the resource, i.e., either known total length for a linear resource or known total area for an areal resource. For a stratified sample this variable must be a vector containing a value for each stratum and must have the names attribute set to identify the stratum codes.

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

The number of stage one sampling units in the resource, which is required for calculation of finite and continuous population correction factors for a two-stage sample. For a stratified sample this variable must be a vector containing a value for each stratum and must have the names attribute set to identify the stratum codes.

stage1size

Size of the stage one sampling units of a two-stage sample, which is required for calculation of finite and continuous population correction factors for a two-stage sample and must have the names attribute set to identify the stage one sampling unit codes. For a stratified sample, the names attribute must be set to identify both stratum codes and stage one sampling unit codes using a convention where the two codes are separated by the & symbol, e.g., "Stratum 1&Cluster 1".

support

Vector of the support value for each site - the value one (1) for a site from a finite resource or the measure of the sampling unit associated with a site from a continuous resource, which is required for calculation of finite and continuous population correction factors.

vartype

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

warn.ind

Logical value that indicates whether warning messages were generated, where TRUE = warning messages were generated and FALSE = warning messages were not generated.

warn.df

Data frame for storing warning messages.

warn.vec

Vector that contains names of the population type, the subpopulation, and an indicator.

Value

An object in list format composed of a vector named varest, which contains variance estimates, a logical variable named warn,ind, which is the indicator for warning messges, and a data frame named warn.df, which

Other Functions Required

localmean.weight

calculate the weighting matrix for the local mean variance estimator

localmean.var

calculate the local mean variance estimator