Guide: Conducting a Chi Square Test for Non-Parametric, Categorical Data


We were interested in knowing if the job turnover rates of public-school principals in a particular state were different before and after the COVID19 pandemic. We had publicly available data from the state that showed whenever individual principals left their position.

The Data

We had turnover data for over 1,500 principals. The data set included a binary variable for turnover from one year to the next (yes or no). We treated before the pandemic as the academic years 2018-19 and 2019-20. Even though the pandemic started in March 2020, the school systems basically shut down at that point which was close to the end of the academic year. We treated after the pandemic as 2022-23 and 2023-24. Below is a screenshot of the data set in Excel. There were other demographic variables in the data set, but we removed them and cleaned up the data. We then uploaded the data into Julius.

User Prompt: This data shows school principals leaving their job position as a binary variable either yes or no. The following four academic years are included: 2018-19, 2019-20, 2022-23, and 2023-24. Show frequency counts for turnover for each of the four academic years.


The data from the Excel file has been successfully loaded, and it contains information on school principals’ turnover across four academic years: 2018-19, 2019-20, 2022-23, and 2023-24. The turnover is indicated as a binary variable (“YES” for turnover and “NO” for no turnover) for each year.

For the academic year 2018-19, there were 303 instances of turnover and 1193 instances where there was no turnover. - In 2019-20, there were 248 instances of turnover and 1265 instances of no turnover. - The academic year 2022-23 saw 329 instances of turnover and 1242 instances of no turnover. - Lastly, in 2023-24, there were 245 instances of turnover and 1339 instances of no turnover.

This data provides insight into the turnover rates of school principals before and after the pandemic, indicating fluctuations in turnover rates across the years.

User Prompt: Conduct a statistical comparison of turnover rates before the pandemic (AY 2018-19 and 2019-2020) and after the pandemic (AY 2022-23 and 2023-24)

Julius: To conduct a statistical comparison of turnover rates before and after the pandemic, we can use a Chi-square test for independence. This test is appropriate because we are comparing categorical data (turnover: yes or no) across two independent groups (before and after the pandemic).

The assumptions for the Chi-square test are: - The samples are randomly selected. - The variables are categorical. - The expected frequency count for at least 80% of the cell in the contingency table is at least 5.

We will create a contingency table with the turnover counts for the two periods: - Before the pandemic (AY 2018-19 and 2019-20) - After the pandemic (AY 2022-23 and 2023-24)

Let’s proceed with the calculation.

The Chi-square test for independence resulted in a Chi-square statistic of 0.0076 and a p-value of 0.9304.

Given the high p-value (greater than 0.05), we fail to reject the null hypothesis. This suggests that there is no statistically significant difference in the turnover rates of school principals before and after the pandemic based on the data provided. This analysis indicates that the observed fluctuations in turnover rates across the academic years are not statistically significant when comparing the periods before and after the pandemic.

User Prompt: Show the contingency table.


The contingency table used for the Chi-square test is as follows:

The first row represents the counts for “Before Pandemic” with 551 turnovers (YES) and 2458 instances of no turnover (NO). - The second row represents the counts for “After Pandemic” with 574 turnovers (YES) and 2581 instances of no turnover (NO).

This table was used to assess the statistical significance of the difference in turnover rates before and after the pandemic.


Julius was able to read the data file and make sense of the fact that we wanted it to combine the two years before and two years after the pandemic into discreet time periods. It recognized the categorical nature of the turnover data and agreed that a chi square test was the appropriate test. Julius ran a contingency table to check for cell sample size as one of the test assumptions, but we had to ask it to produce the table with a prompt.

The process for running this nonparametric test in Julius was fairly straightforward and it provided the results quickly confirming what we already suspected – school principal turnover rates did not significantly vary before and after the pandemic. In another part of our study, we did find that turnover rates dropped considerably during the pandemic as principals tended to stay put for two years.


Awesome guide! You did a lovely job at explaining how to prompt and run the chi-square test in Julius! I also love how you explained why your data was suitable for this test. I find that a lot of people get very overwhelmed when it comes to picking the right test that suits their dataset, so the way you connected why your data was suitable for this test was perfect.

I’m just curious about your other study: you said you found that turnover rates dropped considerably during the pandemic, but this one we do not see that same trend. Do you happen to know why you may have gotten different results? Also, do you think that if you added in those different demographics in this dataset, that your test results may be different?

Again, thank you for making and sharing this post! :slight_smile:


Thanks for the kind words and glad you found this useful. You’re right that one of the keys is having an understanding of types of data and the best kinds of analyses.

In our other study, we did include the pandemic years and principal turnover dropped dramatically during that period. We suspect school leaders were overwhelmed and stayed put to avoid change. For this particular study reported here with the chi square, we were only interested to see if turnover rates changed from before to after the pandemic. We did not include the pandemic years. And come to find out that there were no significant differences.


Oh I see, thank you for the insight. The pandemic was quite an intense time for a lot of people, so it would make logical sense to see people choosing to avoid any additional change since the pandemic was a very fluid situation. Very interesting! Thank you for sharing :slight_smile:

1 Like