Defining Your Own Rules

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.
- Click the Dialog Recall toolbar button and choose Validate Data.
- 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.)
- 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.
- To define a rule, click New.
- Type 1 to 3 Categorical as the rule name.
- For Valid Values, choose In a list.
- Type 1, 2, and 3 as the values.
- Deselect Allow system-missing values.
- To define the rule for Rankin scores, click New.
- Type 0 to 5 Categorical as the rule name.
- For Valid Values, choose In a list.
- Type 0, 1, 2, 3, 4, and 5 as the values.
- Deselect Allow system-missing values.
- 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) - Type 0 to 100 by 5 as the rule name.
- For Valid Values, choose In a list.
- Type 0, 5, ..., and 100 as the values.
- Deselect Allow system-missing values.
- Click Continue.
Figure 3. 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.
- Apply 1 to 3 Categorical to Hospital size.
- Apply 0 to 5 Categorical to Initial Rankin score and Rankin score at 1 month through Rankin score at 6 months.
- Apply 0 to 100 by 5 to Barthel index at 1 month through Barthel index at 6 months.
- Click the Cross-Variable Rules tab.
There are no currently defined rules.
- Click Define Rules.
Figure 4. Define Validation Rules dialog box, Cross-Variable Rules tab When there are no rules, a new placeholder rule is automatically created.
- Type DiedTwice as the name of the rule.
- 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.
- Click Continue.
Figure 5. Validate Data: Cross-Variable Rules tab The newly defined rule is automatically selected in the Cross-Variable Rules tab.
- Click OK.