• <Helps for 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
    • CSPro Statements and Functions
    • Templated Reporting System
    • Appendix
  • <Helps for CSEntry>
  • <Helps for CSBatch>
  • <Helps for CSTab>
  • <Helps for DataViewer>
  • <Helps for TextView>
  • <Helps for TblView>
  • <Helps for TRSWin>
  • <Helps for CSDeploy>
  • <Helps for CSPack>
  • <Helps for CSFreq>
  • <Helps for CSSort>
  • <Helps for CSExport>
  • <Helps for CSReFmt>
  • <Helps for CSDiff>
  • <Helps for CSConcat>
  • <Helps for TRSSetup>
  • <Helps for ParadataViewer>
  • <Helps for ParadataConcat>
  • <Helps for CSIndex>
  • <Helps for Excel2CSPro>
  • <Helps for CSWeb>

DeckArray Leftover Rows

When using unedited variables as parameters of your DeckArray, 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 hotdecks using a single array. An example will best explain this functionality.

This following is a hotdeck 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 hotdeck 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 hotdeck 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 hotdeck is called upon for an edit or imputation, having valid values for H8, H9, or H10 is not necessary to return a valid H6 value. This fundamentally makes the housing type DeckArray eight hotdecks combined into one. The table below explains what happens when executing a getdeck function call:

    impute(H6,getdeck(housingTypeHD));  

H8

H9

H10

Take the H6 value from the nearest neighbor with the same values for...

Valid

Valid

Valid

H8, H9, and H10

Valid

Valid

Invalid

H8 and H9

Valid

Invalid

Valid

H8 and H10

Valid

Invalid

Invalid

H8 only

Invalid

Valid

Valid

H9 and H10

Invalid

Valid

Invalid

H9 only

Invalid

Invalid

Valid

H10 only

Invalid

Invalid

Invalid

The previous valid household's value

Or in words:

  • If electricity is blank, use a hotdeck based on water and toilet.

  • If electricity and water are blank, use a hotdeck based on toilet.

  • If water is blank, use a hotdeck based on electricity and toilet.

  • If all three are blank, use a hotdeck based on the previous valid household.

  • Etc.

See also: DeckArrays, Getdeck Function, Putdeck Function