One reason for conducting a hypothesis test is to determine whether there is a statistically significant relationship between two or more variables. The appropriate test depends on the types of variables being analysed. This page explains two of the most common tests for assessing the relationship between two variables.

In brief, it covers the following:

Chi-square test of independence

The chi-square test of independence is a non-parametric test used to determine whether there is a statistically significant association between two categorical variables. For example, it could be used to test whether there is a statistically significant association between employment status (full time or part time) and owning a pet. In this case, the hypotheses would be:

\(\textrm{H}_\textrm{0}\): There is no association between employment status and owning a pet
\(\textrm{H}_\textrm{A}\): There is an association between employment status and owning a pet

Before conducting a chi-square test of independence, you need to check that the following assumptions are met:

Assumption 1: The categories used for the variables are mutually exclusive. This means that each person or item can only fit into one category for each variable.

Assumption 2: The categories used for the variables are exhaustive. This means that there is an appropriate category for every person or item.

Assumption 3: The observations are independent. This means that each person or item only contributes to one cell in the cross-tabulation.

Assumption 4: No more than \(20\%\) of the expected frequencies are less than \(5\). If this assumption is not met, Fisher’s exact test may be an appropriate alternative.

The first two assumptions require appropriate categories for both variables. Independence depends on how the data were collected. Information about the expected frequencies should be provided with the results of the test. In this example, the \(0.0\%\) shown below the second table indicates that none of the expected frequencies are less than \(5\).

If the assumptions for the chi-square test are met, you can conduct the test using statistical software, such as SPSS. The results should include the following statistics:

When analysing the results, first look at the descriptive statistics to get an idea of what is happening in the sample. In this example, the differences between the Counts and Expected Counts in the cross-tabulation indicate that there is some association between the variables in the sample.

To determine whether this association is statistically significant, we need to look at the \(p\) value for Pearson’s chi-square test. This is shown as ‘Asymptotic Significance (2-sided)’. If we are using a level of significance of \(.05\):

  • If \(p \leqslant .05\) we reject \(\textrm{H}_\textrm{0}\) and conclude that there is a statistically significant association between the variables.
  • If \(p > .05\) we do not reject \(\textrm{H}_\textrm{0}\) and conclude that there is not a statistically significant association between the variables.

In this case, our \(p\) value of \(.015\) indicates that the association between employment status and owning a pet is statistically significant.

Note that the chi-square value and degrees of freedom (\(df\)) should generally be reported as part of your results. However, you do not need to interpret these when deciding whether the association is statistically significant.

If you would like to practise interpreting the results of a chi-square test for statistical significance, have a go at the following activity.

Several statistics can be used to calculate effect size, and therefore evaluate practical significance, when conducting a chi-square test of independence. The appropriate statistic depends on factors such as the number of categories for each variable, the type of variables (nominal or ordinal), and the nature of the study.

When there are only two categories for each variable, effect size can be measured using phi (\(\phi\)). An extension of phi for nominal variables with more than two categories is Cramer’s V, while other measures of effect size include relative risk and odds ratio. These statistics can also usually be obtained using statistical software. For example, phi for our employment status and pet ownership example is included in the following output:

The value of \(0.39\) indicates a medium to large effect. As a general guide, a phi with a magnitude of \(0.1\) is considered small, \(0.3\) medium, and \(0.5\) or above large.

Pearson’s correlation

A hypothesis test of Pearson’s correlation coefficient is used to determine whether there is a statistically significant linear correlation between two continuous variables. For example, it could be used to test whether there is a statistically significant linear correlation between heart rates before and after exercise. In this case, the hypotheses would be:

\(\textrm{H}_\textrm{0}\): There is no linear correlation between heart rates before and after exercise in the population
\(\textrm{H}_\textrm{A}\): There is a linear correlation between heart rates before and after exercise in the population

Before conducting a hypothesis test of Pearson’s correlation coefficient, you need to check that the following assumptions are met:

Assumption 1: The observations are independent. This means that the measurements for one subject do not affect the measurements for any other subject.

Assumption 2: Both variables are normally distributed, or the sample size is large enough that the sampling distribution approximates a normal distribution.

Assumption 3: There is a linear relationship between the variables, as shown by the scatter plot. Pearson’s correlation coefficient can still be calculated if the relationship is not linear, but it will not provide an appropriate measure of the relationship.

Assumption 4: There is a homoscedastic relationship between the variables. This means that the variability in one variable is similar across the values of the other variable. In a scatter plot, the dots should have a similar spread around the line of best fit along its length.

If the assumptions for Pearson’s correlation are not met, or if the data are ordinal rather than continuous, Spearman’s rho or Kendall’s tau-\(b\) may be appropriate non-parametric alternatives.

If the assumptions for Pearson’s correlation are met, you can conduct the test using statistical software, such as SPSS. The results should include the following statistics:

When analysing the results, first look at Pearson’s correlation coefficient (\(r\)) to get an idea of what is happening in the sample. In this example, \(r=.316\). The positive value indicates a positive linear correlation, while the relatively small magnitude indicates that the correlation is fairly weak.

To determine whether this linear correlation is statistically significant, we need to look at the \(p\) value, which is shown as ‘Sig. (2-tailed)’ in the table. If we are using a level of significance of \(.05\):

  • If \(p \leqslant .05\) we reject \(\textrm{H}_\textrm{0}\) and conclude that there is a statistically significant linear correlation between the variables.
  • If \(p > .05\) we do not reject \(\textrm{H}_\textrm{0}\) and conclude that there is not a statistically significant linear correlation between the variables.

In this case, our \(p\) value of \(.047\) indicates that the linear correlation between the before and after heart rates is statistically significant.

If you would like to practise interpreting the results of a Pearson’s correlation hypothesis test for statistical significance, have a go at the following activity.

Finally, note that the correlation coefficient itself can be used as a measure of effect size, so a separate measure does not need to be calculated to evaluate practical significance. As a general guide, an \(r\) with a magnitude of \(0.1\) is considered small, \(0.3\) medium, and \(0.5\) or above large.

The coefficient of determination, \(r^2\), can also be calculated. This tells us the percentage of variation in the dependent variable that can be accounted for by variation in the independent variable.

In our heart rate example, the correlation coefficient of \(.316\) indicates a medium effect. The coefficient of determination of \(.0999\) indicates that \(9.99\%\) of the variation in heart rate after exercise can be accounted for by variation in heart rate before exercise.