read_panels: Use a data frame of strata and point counts to build a design...

View source: R/panels.r

read_panelsR Documentation

Use a data frame of strata and point counts to build a design object for spsurvey::grts()

Description

Use a data frame of strata and point counts to build a design object for spsurvey::grts()

Usage

read_panels(
  dataframe,
  stratum_field = "stratum",
  panel_names = NULL,
  oversample_field = NULL,
  oversample_proportion = 0.25,
  oversample_min = 3
)

Arguments

dataframe

Data frame. This must have at least a variable for the strata identities and one variable for each panel, e.g. "Stratum", "Year1", "Year2", "Year3", where each row is a stratum and the number of points desired in each panel for that stratum.

stratum_field

Character string. This must exactly match the name of the variable in dataframe that contains the stratum identities. Defaults to "stratum".

panel_names

Optional vector of character strings. Necessary if the data frame given in dataframe has additional fields beyond the ones for the strata, panels, and oversample. This character vector specifies which variables correspond to panels and must match those names exactly.

oversample_field

Optional character string. If used, this must exactly match the name of the variable in dataframe that contains the TOTAL number of oversample points desired for the stratum in the design. If not provided or specified as NULL, oversample point counts will be calculated using oversample_proportion and oversample_min. Defaults to NULL.

oversample_proportion

Optional numeric value. If not providing an oversample point count in a variable specified by oversample_field, this must be between 0 and 1, representing the minimum relative proportion of oversample points to allocate per stratum per panel using the formula panel point count * min.oversample_proportion. Defaults to 0.25.

oversample_min

Optional numeric value. If not providing an oversample point count in a variable specified by oversample_field, this must be a positive integer, representing the minimum number of oversample points to allocate per stratum per panel. This is only used if it is greater than ppanel point count * min.oversample_proportion. Defaults to 3.


nstauffer/sample.design documentation built on May 9, 2022, 3:21 a.m.