simStructure.simRelation(simPopObj, relation = "relate", head = "head", direct = NULL,
additional = c("nation", "ethnic", "religion"),
limit = NULL, censor = NULL, maxit = 500,
MaxNWts = 2000, eps = NULL, nr_cpus=NULL, seed)simPopObj containing population and household survey data as well as optionally margins in standardized format.dataS and dataP, respectively, that define the relationships between the household members.relation that identifies the household head.relation. Simulated individuals with those categories directly inherit the values of the additional variables from the household head. The default is NULL such thadataS that should be simulated for the population data.data.frames should be supplied. The names of the list components specify the categories that should be censored. For eachNULL (the default). In the former case, estimated probabilities smaller than this are assumed to result from structural zeros and are set to exactly 0.simPopObj containing survey data as well as the simulated population data including the categorical variables specified by additional.direct) inherit the value of the latter. Third, the values of the remaining individuals are simulated with multinomial log-linear models in which the value of the respective household head is used as an additional predictor.
The number of cpus are selected automatically in the following manner. The number of cpus is equal the number of strata. However, if the number of cpus is less than the number of strata, the number of cpus - 1 is used by default.
This should be the best strategy, but the user can also overwrite this decision.simStructure, simCategorical,
simContinuous, simComponentsdata(ghanaS) # load sample data
samp <- specifyInput(data=ghanaS, hhid="hhid", strata="region", weight="weight")
ghanaP <- simStructure(data=samp, method="direct", basicHHvars=c("age", "sex", "relate"))
class(ghanaP)
ghanaP <- simRelation(simPopObj=ghanaP, relation="relate", head="head")
str(ghanaP)Run the code above in your browser using DataLab