View source: R/StoxAnalyticalBaselineFunctions.R
AssignPSUSamplingParameters | R Documentation |
Assigns data records to PSU Sampling Parameters, provides non-response adjustments for selected PSUs that was not sampled, and changes SamplingUnitId to that used to identify data records.
AssignPSUSamplingParameters(
PSUSamplingParametersData,
StoxBioticData,
SamplingUnitId = character(),
DataRecordId = character(),
DefinitionMethod = c("MissingAtRandom")
)
PSUSamplingParametersData |
|
StoxBioticData |
|
SamplingUnitId |
name of Variable in |
DataRecordId |
name of Variable in |
DefinitionMethod |
The method for dealing with non-response, e.g. 'MissingAtRandon' |
Some sampling parameters provided in PSUSamplingParametersData
are only
interpretable for sampling with complete response. This function adjusts these parameters, removes non-respondents from the
PSUSamplingParametersData
, and checks that all responding PSUs are present in data records.
After correcting for non-response, the SamplingUnitId in PSUSamplingParametersData
will be replaced
by an ID (argument 'DataRecordId') so that sampling units can be brought into correspondence with how they are identified in lower
level sampling (IndividualSamplingParametersData
)
If any respondents (rows of the SelectionTable of PSUSamplingParametersData that does not have NA for SamplingUnitId) are not found in 'SamplingUnitId', execution halts with an error.
Response after selection can generally be considered a process that modifies the sampling parameters that are set by design. Typically sample size, InclusionProbabilities and normalized SamplingWeights need to be adjusted as non-respondents are removed, since these are depend of the entire sample, not just the sampling unit they are assigned to. SelectionProbabilites are by definition set for a single draw of a single sampling unit from the population and are valid even when response is not complete.
Treatment of non-response requires some assumption about systematic differences between respondents and non-respondents. These assumptions are specified via the argument 'DefinitionMethod' and the following options are available:
A response propensity is estimated for each stratum as the fraction of the sample resonding, and sample size (n) and InclusionProbability are adjusted by multiplying with this propensity. Sampling weights are adjusted by dividing them with their sum over repsondents in a stratum.
PSUSamplingParametersData
without non-respondent and with 'SamplingUnitId' changed
ReadPSUSamplingParameters
, ComputePSUSamplingParameters
, AddPsuStratificationVariables
, ComputeIndividualSamplingParameters
, AnalyticalPopulationEstimate
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.