Presentation is loading. Please wait.

Presentation is loading. Please wait.

Practical Solutions Comparing Proportions & Analysing Categorical Data.

Similar presentations


Presentation on theme: "Practical Solutions Comparing Proportions & Analysing Categorical Data."— Presentation transcript:

1 Practical Solutions Comparing Proportions & Analysing Categorical Data

2 2 Practical Solutions * Chi-square / Fisher’s test. CROSSTABS /TABLES=GROUP BY CAT2 /FORMAT= AVALUE TABLES /STATISTIC=CHISQ /CELLS= COUNT ROW /COUNT ROUND CELL /METHOD=EXACT TIMER(5). 1.Treatment group (GROUP) and the status at time 2 (CAT2) are nominal categorical variables and as they are not repeated measures of the same outcome we can the Chi-square test or Fisher’s exact test. (Analyze  Descriptive Statistics  Crosstabs…). The step by step instructions for doing this are contained in the notes but the syntax for this is included below:

3 3 Practical Solutions 1.The SPSS output is included below (the key sections are highlighted):

4 4 Practical Solutions 1.The presentation for this type of analysis was mentioned in the notes but you should include the cross-tabulation alongside only the most appropriate p value. As there are no cells with an expected count below 5 here (as shown by the highlighted footer in the SPSS output) we should use the Pearson Chi-square p value. There was found to be no significant association (Pearson Chi- square: p = 0.147) between HbA1c status at follow-up and treatment group. Difference in proportions and association are the same test and the names are often used interchangeably. Therefore as there was no association that means there is no significant difference in proportions.

5 5 Practical Solutions * Filtering the data to select only 2 treatment groups. USE ALL. COMPUTE filter_$=(GROUP=1 OR GROUP=3). VARIABLE LABEL filter_$ 'GROUP=1 OR GROUP=3 (FILTER)'. VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'. FORMAT filter_$ (f1.0). FILTER BY filter_$. EXECUTE. * Re running the Chi-square analysis. CROSSTABS /TABLES=GROUP BY CAT2 /FORMAT= AVALUE TABLES /STATISTIC=CHISQ /CELLS= COUNT ROW /COUNT ROUND CELL. * Turning off the filter. FILTER OFF. USE ALL. EXECUTE. 2.The selection of specific cases was covered earlier (Data  Select Cases…). One way of writing the syntax to select just 2 of the 3 treatment groups is given below:

6 6 Practical Solutions The Chi-square test is still the most appropriate and although the p value is now very close to 0.05 we still have the same conclusion. 2.The SPSS output is included below (the key sections are highlighted):

7 7 Practical Solutions (You should present these results in the same way as shown earlier) The CI shows that differences in either direction are just about possible (hence so is no difference), but that the difference could be as large as almost 27% 2.When we produce the 95% confidence interval for the difference in proportions of patients with HbA1c >= 7 you can see that the CI just includes zero at the lower end. This agrees with our borderline significant p value from SPSS earlier.

8 8 Practical Solutions * Computing the Chi-square / Fisher’s exact values. CROSSTABS /TABLES=GROUP BY SevCAT2 /FORMAT= AVALUE TABLES /STATISTIC=CHISQ /CELLS= COUNT ROW /COUNT ROUND CELL /METHOD=EXACT TIMER(5). 3.We use the same analysis as was used for question 1. The syntax for this is included below:

9 9 Practical Solutions 3.The SPSS output is included below (the key sections are highlighted):

10 10 Practical Solutions 3.Again, the presentation for this type of analysis was mentioned in the notes but you should include the cross-tabulation alongside only the most appropriate p value. This time there are 3 cells with an expected count below 5 here (as shown by the highlighted footer in the SPSS output). In this case we should use Fisher’s exact test p value. There was found to be no significant association (Fisher’s exact test: p = 0.641) between severe HbA1c status at follow-up and treatment group. Both tests indicate no significant difference but we should report the Fisher’s exact test result here. This is due to at least one expected count being below 5 and hence the Pearson Chi- square assumption is not met.

11 11 Practical Solutions * Calculating the one variable Chi-square. NPAR TEST /CHISQUARE=CAT1 /EXPECTED= 0.6 0.4 /MISSING ANALYSIS /METHOD=EXACT TIMER(5). 4.This time we are looking at testing one variable against an expected set of proportions. To do this wee need to use the one variable Chi-square (Analyze  Nonparametric tests  Chi- square..). The key element here is realising that category 0 is =7 and is expected to be 40%, hence we need to enter 0.6 first and then 0.4. Again a step by step guide for this is included in the notes but the syntax has been included below:

12 12 Practical Solutions There is highly significant evidence that the sample does not have 60% of patients with a HbA1c =7. We can use the Chi- square (Asymp. Sig. value) here as the expected count assumption is met. 4.The SPSS output is included below (the key sections are highlighted):

13 13 Practical Solutions The CI also indicates that the proportion is higher than 0.4, with the minimum likely value being 48.8% (0.488). 4.From looking at the CIA confidence interval we can see that (with >=7 as the ‘feature’) the confidence interval for the ‘feature’ excludes the test value of 0.4, hence agreeing with our SPSS finding.

14 14 Practical Solutions * McNemar test. CROSSTABS /TABLES=CAT1 BY CAT2 /FORMAT= AVALUE TABLES /STATISTIC=MCNEMAR /CELLS= COUNT TOTAL /COUNT ROUND CELL. 5.The status variables at time 1 and time 2 (CAT1 & CAT2) are nominal categorical variables that are repeated measures of the same outcome. Due to this we need to use McNemars test to assess if there was a significant change in response (Analyze  Descriptive Statistics  Crosstabs…). The step by step instructions for doing this are contained in the notes but the syntax for this is included below:

15 15 Practical Solutions It can be seen that the percentages that are changing in each direction are quite different (27.3% and 0.4%), so it is no surprise to see a highly significant McNemar p value (p < 0.001). 5.The SPSS output is included below (the key sections are highlighted):

16 16 Practical Solutions (You should present these results in the same way as shown earlier) The CI shows that there are quite large differences in favour of a reduction in HbA1c levels, with at least 21.1% more of patients improving than getting worse. 5.When we produce the 95% confidence interval for the difference in proportions of patients changing HbA1c status in each direction it can be seen that the CI is quite a long way from zero. This agrees with our highly significant p value from SPSS earlier.

17 17 Practical Solutions 5.Yet again the presentation for this type of analysis was mentioned in the notes but it should include the cross-tabulation, alongside the McNemar p value and a confidence interval for the difference in proportions changing in each direction. There was found to be a highly significant change in HbA1c control status (McNemar test: p < 0.001) between the two measurements in favour of improving control or a lowering of HbA1c levels (Difference 26.9%, 95% CI: 21.1% to 32.5%).

18 18 Practical Questions 6.We need to enter the data as a summary table in SPSS in the following fashion:

19 19 Practical Questions 6.Remember that we also need to weight the cases by the count variable: Having applied the weights we can move on to assess the agreement between the raters. We should use the Kappa technique to do this and step by step instructions were included in the session notes. Syntax for both of these steps is included above. * Weighting the cases. WEIGHT BY Count. * Producing the Kappa. CROSSTABS /TABLES=Rater1 BY Rater2 /FORMAT= AVALUE TABLES /STATISTIC=KAPPA /CELLS= COUNT TOTAL /COUNT ROUND CELL.

20 20 Practical Solutions The outlined cells indicate agreement between the two raters. The absolute agreement is 78% (20+24+34=78). The Kappa statistic of 0.685 indicates that there is a good level of agreement. 6.The SPSS output is included below (the key sections are highlighted):

21 21 Practical Solutions The CI shows that in the worst case the agreement between the raters may only be 0.491 (or of moderate level). 6.Using CIA we can get a 95% CI for the Kappa statistic:


Download ppt "Practical Solutions Comparing Proportions & Analysing Categorical Data."

Similar presentations


Ads by Google