simStructure: Simulate the household structure of population data

Description Usage Arguments Value Note Author(s) References See Also Examples

View source: R/simStructure.R

Description

Simulate basic categorical variables that define the household structure (typically variables such as household ID, age and gender) of population data by resampling from survey data.

Usage

1
2
simStructure(dataS, method = c("direct", "multinom", "distribution"),
  basicHHvars, seed = 1)

Arguments

dataS

an object of class dataObj containing household survey data that is usually generated with specifyInput.

method

a character string specifying the method to be used for simulating the household sizes. Accepted values are "direct" (estimation of the population totals for each combination of stratum and household size using the Horvitz-Thompson estimator), "multinom" (estimation of the conditional probabilities within the strata using a multinomial log-linear model and random draws from the resulting distributions), or "distribution" (random draws from the observed conditional distributions within the strata).

basicHHvars

a character vector specifying important variables for the household structure that need to be available in dataS. Typically variables such as age or sex may be used.

seed

optional; an integer value to be used as the seed of the random number generator, or an integer vector containing the state of the random number generator to be restored.

Value

An object of class simPopObj containing the simulated population household structure as well as the underlying sample that was provided as input.

Note

The function sample is used, which gives results incompatible with those from < 2.2.0 and produces a warning the first time this happens in a session.

Author(s)

Bernhard Meindl and Andreas Alfons

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. doi: 10.18637/jss.v079.i10

See Also

simCategorical, simContinuous, simComponents, simEUSILC

Examples

1
2
3
4
5
data(eusilcS)
inp <- specifyInput(data=eusilcS, hhid="db030", hhsize="hsize", strata="db040", weight="db090")
eusilcP <- simStructure(data=inp, method="direct", basicHHvars=c("age", "rb090"))
class(eusilcP)
eusilcP

simPop documentation built on May 29, 2018, 5:03 p.m.