• <GetStart>
  • CSPro User's Guide
    • The CSPro System
    • Data Dictionary Module
    • The CSPro Language
    • Data Entry Module
    • Batch Editing Applications
      • Introduction to Batch Editing
      • Create a Batch Edit Application
      • Order of Editing
      • Correcting Errors
        • Methods of Correcting Data
        • Guidelines for Correcting Data
        • Imputation
        • Static Imputation
        • Dynamic Imputation (Hot Deck)
        • DeckArrays
        • DeckArray Leftover Rows
        • Types of Edits in Batch Editing
      • How to ...
      • Steps in Developing a Batch Editing Program
    • Tabulation Applications
    • Data Sources
    • CSPro Statements and Functions
    • Templated Reporting System
    • HTML and JavaScript Integration
    • Action Invoker
    • Appendix
  • <CSEntry>
  • <CSBatch>
  • <CSTab>
  • <DataViewer>
  • <TextView>
  • <TblView>
  • <CSFreq>
  • <CSDeploy>
  • <CSPack>
  • <CSDiff>
  • <CSConcat>
  • <Excel2CSPro>
  • <CSExport>
  • <CSIndex>
  • <CSReFmt>
  • <CSSort>
  • <ParadataConcat>
  • <ParadataViewer>
  • <CSCode>
  • <CSDocument>
  • <CSView>
  • <CSWeb>

DeckArray Leftover Rows

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.
putdeck(housingTypeHD(+),H6); 
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:
impute(H6,getdeck(housingTypeHD));
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
RowH8H9H10Take the H6 value from the nearest neighbor with the same values for...
1ValidValidValidH8, H9, and H10
2ValidValidInvalidH8 and H9
3ValidInvalidValidH8 and H10
4ValidInvalidInvalidH8 only
5InvalidValidValidH9 and H10
6InvalidValidInvalidH9 only
7InvalidInvalidValidH10 only
8InvalidInvalidInvalidThe 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.
See also: DeckArrays, GetDeck Function, PutDeck Function