logo Epi Result

Good research. Valid results. Better decisions.


How to do a Chi-square test when you only have proportions and denominators?

How do you then do a cross-tabulation in SPSS when you do not have a dataset with the values of the two variables of interest? For example, if you do a critical appraisal of a published study and only have proportions and denominators. In this article it will be demonstrated how SPSS can come up with a cross table and do a Chi-square test in both situations. And you will see that the results are exactly the same.

In an earlier article I discussed how you do a cross-tabulation in a SPSS. But what if you do not have a dataset with the values of the two variables of interest? For example, if you do a critical appraisal of a published study and only have proportions and denominators. In this article it will be demonstrated how SPSS can come up with a cross table and do a Chi-square test in both situations. And you will see that the results are exactly the same.

‘Normal’ dataset

If you analyse a dataset and want to check if there is an association between two nominal variables you do a Chi-square test. In SPSS you just indicate that one variable (the independent one) should come in the row, and the other variable (the dependent one) should come in the column of the cross table. Then you ask for row percentages and the Chi-square statistic. The output will give you the cross table with the numbers and row percentages, and a table including the value of the Pearson Chi-square together with a p-value. [Don’t forget to check whether the Chi-square test is valid: at least 80% of the expected frequencies exceed 5 and all the expected frequencies exceed 1.]

For example, to see if the chance of getting a disease (e.g. an infection as complication after an operation) is different between those using medication A as prophylaxis and those using medication B, you would ask for a cross table of disease by medication. The SPSS output is printed below.

Crosstabs

Medication disease crosstabulation

Chi square tests

Only proportions and denominators available

But how do you do a Chi-square test when you only have proportions and denominators available? For example, you know from the literature that 33.0% of 276 people using medication A got the disease, while this is 34.4% of the 392 persons getting medication B. How do you know if this is significantly different or not?

The first step is to construct the cross table yourself. Determine what figure should come in the cell for which variable 1 (medication) equals 1 and variable 2 (disease) equals 1. This is 0.33 * 276 = 91. You do the same for the cell for which variable 1 equals 2 and variable 2 equals 1 (0.34 * 392 = 135). To get the figure for the cell for which variable 1 equals 1 and variable 2 equals 2, you deduct the 91 from the 276 and get 185. You follow the same procedure for the cell for which variable 1 equals 2 and variable 2 equals two (392 – 135 = 257).

You now have to enter these data into SPPS in the following way:

Data SPSS

In order to have SPSS produce the cross table and calculate the Chi-square value, you use the ‘weight by’ option. The SPSS syntax is printed below.

SPSS syntax

And you will get exactly the same output as with the ‘normal’ dataset. So when you need to know whether there is an association between two nominal variables and you do not have the original dataset, knowing the proportions and denominators is enough to get your answer.

Print this article

Continue reading...

Unique approach to conveying research results

Recently I was alerted on the website "They go to die" featuring a film documentary on the phenomenon that gold miners in South Africa contract diseases (especially HIV TB co-infection) at their workplace. When a worker becomes sick at the mine, their illness deems them "unfit for work" and subsequently they are sent home to the rural areas. Since these areas often have little or no access to medication/care, this process is termed, “sending them home to die” I was taken by this project for two reasons.

This article is published in the category:
Methods
No comments yet

Leave a Reply