Statistical significance testing
# Chi-squared test for trend

Undertake a chi-squared test for trend on a contingency table with 2 columns and 3 or more rows.

Undertake a chi-squared test for trend on a contingency table with 2 columns and 3 or more rows.

Inputs are:

- the desired level of confidence in the estimate;
- the desired precision of the results; and
- three columns of data. The first column represents group scores or values, while the remaining 2 columns are the respective counts for each combination of row and column categories. A header row of column names must be included but do not include row or column totals.

Outputs include:

- the table of observed counts, with row and column totals; and;
- chi-squared statistic, degrees of freedom and corresponding P-value for normal chi-square test, as well as for slope and linearity of the data:
- first row is a standard Pearson's Chi-squared test for association between predictor and outcome;
- second row is a Chi-squared test for linear trend. A significant result suggests that the slope of the trend line is non-zero; and;
- third row is a Chi-squarted test for linearity of the trend. A significant result suggests the trend is non-linear.