When using unedited variables as parameters of your
DeckArrays, it may be useful to include a "leftover" (spillover) row for cases in which the variable is not valid. This functionality allows the user to simulate the use of many hot decks using a single array. An example will best explain this functionality.
This following is a hot deck for housing type, based on the source of drinking water (H8), the type of toilet (H9), and whether or not the household has electricity (H10).
Array housingTypeHD(H8_VS1(+), H9_VS1(+), H10_VS1(+)) save;
At the point that housing type (H6) is edited, none of the dependent variables in the hot deck have been edited, so the values can be blank or invalid. That is why, in the array definition, a (+) has been added after the value set names. The (+) gives an extra row for any value that is not in the value set.
When updating the hot deck in cases where the housing type value is valid, adding a (+) after the DeckArray name will update the "leftover" rows.
This means that when the hot deck is called upon for an edit or imputation, having valid values for H8, H9, or H10 is not necessary to return a valid value for H6. This fundamentally makes the housing type DeckArray eight hot decks combined into one. The table below explains what happens when executing a
getdeck function call:
To reiterate from the top of the page the variables being used:
H8=source of drinking water
H9=type of toilet
H10=does the HH have electricity
Row | H8 | H9 | H10 | Take the H6 value from the nearest neighbor with the same values for... |
1 | Valid | Valid | Valid | H8, H9, and H10 |
2 | Valid | Valid | Invalid | H8 and H9 |
3 | Valid | Invalid | Valid | H8 and H10 |
4 | Valid | Invalid | Invalid | H8 only |
5 | Invalid | Valid | Valid | H9 and H10 |
6 | Invalid | Valid | Invalid | H9 only |
7 | Invalid | Invalid | Valid | H10 only |
8 | Invalid | Invalid | Invalid | The previous valid HH's value |
To explain selected table rows in words:
- Row 1: All 3 values are valid, the hot deck will use all 3 parameters to retrieve a hot deck value.
- Row 2: If electricity is invalid, the hot deck will be based on valid values for water and toilet.
- Row 5: If water is invalid, use a hot deck based on electricity and toilet.
- Row 6: If water and electricity are invalid, the hot deck will be based on the value for toilet.
- Row 8: All 3 values are are invalid, the hot deck value will be based on the previous valid household's values.