specifyInput: create an object of class 'dataObj' required for further...

View source: R/specifyInput.R

specifyInputR Documentation

create an object of class 'dataObj' required for further processing

Description

create an standardized input object of class 'dataObj' containing information on weights, household ids, household sizes, person ids and optionally strata. Outputs of this function are typically used in simStructure.

Usage

specifyInput(
  data,
  hhid = NULL,
  hhsize = NULL,
  pid = NULL,
  weight = NULL,
  strata = NULL,
  population = FALSE
)

Arguments

data

a data.frame or data.table featuring sample data.

hhid

character vector of length 1 specifying variable containing household ids within slot data. If hhid=NULL a dummy hhid (hhid.simPop) will be created to ensure compatability with other methods/functions in this package.

hhsize

character vector of length 1 specifying variable containing household sizes within slot data. If NULL, household sizes are automatically calculated.

pid

character vector of length 1 specifying variable containing person ids within slot data. If NULL, person ids are automatically calculated.

weight

character vector of length 1 specifying variable holding sampling weights within slot data. If NULL dummy weights weights.simPop=1 will be created to ensure compatability with other methods/functions in this package.

strata

character vector of length 1 specifing variable name within slot data of variable holding information on strata, e.g. regions or NULL if such variable does not exist.

population

TRUE/FALSE vector of length 1 specifing if the data object is a sample or a population NULL if such variable does not exist.

Author(s)

Bernhard Meindl

References

M. Templ, B. Meindl, A. Kowarik, A. Alfons, O. Dupriez (2017) Simulation of Synthetic Populations for Survey Data Considering Auxiliary Information. Journal of Statistical Survey, 79 (10), 1–38. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.18637/jss.v079.i10")}

Examples

data(eusilcS)
inp <- specifyInput(data=eusilcS, hhid="db030", weight="rb050", strata="db040")
class(inp)
inp

statistikat/simPop documentation built on April 13, 2025, 12:59 a.m.