CHAPTER 10/HYPOTHESIS TESTING: CATEGORICAL DATA 229
10.38 First we need to create an indicator variable for each observation, ‘PS inc’= if(‘Pansecpt’>’Pansecpr’,1,0),
which takes value 1 if pancreatic secretion values post > pre, and 0 otherwise. Then using MINITAB, we
can perform a Chi-Sq test with 4 df.
Tabulated statistics: Hormone, PS Inc
Rows: Hormone Columns: PS Inc
0 1 All
10.39 After creating the new variable ‘BS inc’ in a similar fashion to ‘PS inc’, we get the following results
Tabulated statistics: Hormone, BS Inc
Rows: Hormone Columns: BS Inc
0 1 All
10.40 We need to use a Chi-Sq test for trend within each hormone group. In this case, it makes sense to use the
dosage level as the score value for each group. STATA will perform these trend tests with the nptrend
command. Results are shown below.