|
|
Chi-Squared Test Using Jamovi
A Chi-squared test is appropriate to examine the relationship between two categorical variables. It is most appropriate when both variables are nominal, such as:
The test is often used with data collected from questionnaires.
It can be used when one or both variables are ordinal, such as a response to a question that can range from strongly disagree to strongly agree, but other tests may be more appropriate in that case.
For help on “What test do I need” go to the sigma website statistical worksheets resources page.
Participants in a survey completed a personality questionnaire from which they were categorised as either introvert or extrovert. Participants were also asked to indicate their preferred colour, from red, yellow, green, or blue. We are interested in examining if colour preference differs (is associated) with personality. Both variables contain nominal data and so we can use a Chi-Squared test to examine the relationship between them.
The data shown below can be downloaded in a CSV file called personality_colours.csv. The data were recorded in Jamovi as numeric codes as shown below.
For personality, 1=introvert and 2=extrovert. For colour, 1=red, 2=yellow, 3=green, and 4=blue. These numbers still represent categories, and the order of the numbers is not relevant, so these are nominal data.
To perform the Chi-Squared test, from the main menu click the Analyses menu, then select Frequencies and then Independent Samples:
Move ‘personality’ into the Rows box and ‘colour’ into the Columns box. It doesn’t matter which way round we do them. Then click the Statistics button and tick the \(\chi^2\)(chi-squared) option.
The first table is the personality * colour cross-tabulation (or contingency table). The counts in the cells show that most introverts in our study prefer blue (chosen by 44 out of 100), whereas extroverts mostly prefer red (chosen by 180 out of 300).
But do the results provide evidence that colour preference is truly associated with personality type in the wider population (and not just amongst our participants)?
The Research Question is: Is there an association between personality and colour?
The Chi-Squared test answers this by testing the hypotheses:
H0: There is no association between colour preference and personality type
H1: There is an association between colour preference and personality type
The test results are in the second table above, the \(\chi^2\)(Chi-Square) Tests table. The two-sided p-value for the Pearson Chi-Squared test (in the first row of the table) is less than 0.05 so there is evidence in favour of H1 that there is an association between colour and personality type. In fact, the p-value is reported as less than 0.001 so we can say there is strong evidence of an association.
We could report the results as:
“A Chi-squared test was undertaken to examine the relationship between personality type and colour preference. There is strong evidence that colour preference is associated with personality type, \(\chi^2\)(3, N=400) = 71.20, p<0.001. Introverts seem more likely to prefer blue whereas extroverts are more likely to prefer red.”
Note that the number 3 refers to the degrees of freedom in the first row of the df column of the table, 400 is the sample size, 71.20 is the value of the Chi-Squared test statistic and p<0.001 indicates the p-value is less than 0.001.
We could also examine the results in terms of row or column percentages or effect sizes. For help on this see the resource called Chi-squared Tests Using SPSS Further Results on our sigma website statistical worksheets resources page.
Sometimes the Chi-Squared test is not valid because too many cells have low frequency counts. To solve this, you can either use a Fishers exact test, or combine some of the categories, such as yellow and green to create a yellow/green category, then run the Chi-Squared test again. See the resource Chi-Squared Tests Using Jamovi What to do if the Test is Not Valid on our sigma website statistical worksheets resources page.
For more
resources, see
sigma.coventry.ac.uk
Adapted from material developed by
Coventry University