checkconstraints {NestedCategBayesImpute} | R Documentation |
Checking a data matrix of households for the possible/impossible status under a predefined set of structural zeros.
Description
Checking a data matrix of households for the possible/impossible status under a predefined set of structural zeros.
Usage
checkconstraints(data, neededpossiblehh, hh_size)
Arguments
data |
A household data matrix generated by calling |
neededpossiblehh |
The number of possible households needed before checking is stopped. |
hh_size |
The household size for the households in |
Details
Given an input household data matrix, these functions will check the possible/impossible status of each household and also output the desired number of possible and impossible households separately. checkconstraints
checks constraints when the household head is included as an individual within the household.
The predefined list of structural zeros currently included should be viewed as an example of a system of constraints. It was derived by treating a subset of the 2012 American Community Survey as a population, and identifying combinations involving the relationship variable that do not appear in the data. This list should not be interpreted as a “true” list of impossible combinations in the target population. We force the combinations of variables in this list to have zero probability to be consistent with the 2012 ACS public use file that we used in the example.
The structural zeros included are:
Each household must contain exactly one head and he/she must be at least 16 years old.
Each household cannot contain more than one spouse and he/she must be at least 16 years old.
Married couples are of opposite sex, and age difference between individuals in the couples cannot exceed 49.
The household head must be older than the oldest child by at least 7.
The youngest parent must be older than the household head by at least 10.
The youngest parent-in-law must be older than the household head by at least 4.
The age difference between the household head and siblings cannot exceed 37.
The household head must be at least 34 years old. Also, the household head must be older than the oldest grandchild by at least 26.
Users can modify the list of structural zeros by downloading the package source, making changes only to the checkconstraints_imp.cpp file and re-building the package. Please note that the structural zeros have been specified according to the structure of our example data so that the specific column indexes and levels of age, gender and relationship to household head variables in subsequent data sets must match those in our example data. For more information on the structure of the data, see the documentation of the RunModel
function.
Value
A list containing information on checking result.
outcome |
An indicator vector for the possible/impossible household status under constraints. |
Households |
A data matrix for impossible households. |
Index |
A vector for the original indexes of households when possible households are found. Generally not to be used. |
synHouseholds |
A data matrix for possible households. |
possible |
The actual number of possible households returned. |
Author(s)
Quanli Wang, Olanrewaju Akande