Add Stratification columns to 'PSUSamplingParametersData'
Source:R/StoxAnalyticalBaselineFunctions.R
AddPsuStratificationVariables.Rd
Add additional variables to encode strata and its correspondance with census data (e.g. landings data).
Usage
AddPsuStratificationVariables(
PSUSamplingParametersData,
StratificationVariables,
StratificationVariablesTable = data.table::data.table()
)
Details
PSUSamplingParametersData
provide sampling parameters by strata.
Optionally, it may also contain additional variables that encode the stratification in terms of variables
available in other data sources, such as StoxLandingData
. This function allows
such variables to be added, if not already present.
More detailed encoding of stratification is useful for
encoding the sampling frame of the design provided by 'PSUSamplingParametersData'. By encoding all strata
in terms of variables that are available in census-data, the correspondance between sampling frame and
target population can be encoded. This information will be available in downstream estimates (e.g.
AnalyticalPopulationEstimate
) and allow for pragmatic inference to
out-of-frame strata (via ExtendAnalyticalSamplingFrameCoverage
).