Defining Your Own Rules

Figure 1. Validate Data dialog box, Single-Variable Rules tab
Validate Data dialog box, Single-Variable Rules tab

The validation rules that were copied from patient_los.sav have been very useful, but you need to define a few more rules to finish the job. Additionally, sometimes patients that are dead on arrival are accidentally marked as having died at the hospital. Single-variable validation rules cannot catch this situation, so you need to define a cross-variable rule to handle the situation.

  1. Click the Dialog Recall toolbar button and choose Validate Data.
  2. Click the Single-Variable Rules tab. (You need to define rules for Hospital size, the variables that measure Rankin scores, and the variables corresponding to the unrecoded Barthel indices.)
  3. Click Define Rules.

    The currently defined rules are shown with 0 to 1 Dichotomy selected in the Rules list and the rule's properties displayed in the Rule Definition group.

  4. To define a rule, click New.
  5. Type 1 to 3 Categorical as the rule name.
  6. For Valid Values, choose In a list.
  7. Type 1, 2, and 3 as the values.
  8. Deselect Allow system-missing values.
  9. To define the rule for Rankin scores, click New.
  10. Type 0 to 5 Categorical as the rule name.
  11. For Valid Values, choose In a list.
  12. Type 0, 1, 2, 3, 4, and 5 as the values.
  13. Deselect Allow system-missing values.
  14. To define the rule for Barthel indices, click New.
    Figure 2. Define Validation Rules dialog box, Single-Variable Rules tab (0 to 100 by 5 defined)
    Define Validation Rules dialog box, Single-Variable Rules tab (0 to 100 by 5 defined)
  15. Type 0 to 100 by 5 as the rule name.
  16. For Valid Values, choose In a list.
  17. Type 0, 5, ..., and 100 as the values.
  18. Deselect Allow system-missing values.
  19. Click Continue.
    Figure 3. Validate Data dialog box, Single-Variable Rules tab (0 to 100 by 5 defined)
    Validate Data dialog box, Single-Variable Rules tab (0 to 100 by 5 defined)

    Now you need to apply the defined rules to analysis variables.

  20. Apply 1 to 3 Categorical to Hospital size.
  21. Apply 0 to 5 Categorical to Initial Rankin score and Rankin score at 1 month through Rankin score at 6 months.
  22. Apply 0 to 100 by 5 to Barthel index at 1 month through Barthel index at 6 months.
  23. Click the Cross-Variable Rules tab.

    There are no currently defined rules.

  24. Click Define Rules.
    Figure 4. Define Validation Rules dialog box, Cross-Variable Rules tab
    Define Validation Rules dialog box, Cross-Variable Rules tab

    When there are no rules, a new placeholder rule is automatically created.

  25. Type DiedTwice as the name of the rule.
  26. Type (doa=1) & (dhosp=1) as the logical expression. This will return a value of 1 if the patient is recorded as both dead on arrival and died in the hospital.
  27. Click Continue.
    Figure 5. Validate Data: Cross-Variable Rules tab
    Validate Data: Cross-Variable Rules tab

    The newly defined rule is automatically selected in the Cross-Variable Rules tab.

  28. Click OK.

Next