The test for trend (also called the Cochran-Armitage trend test 1)2))is used to determine whether there is a trend in proportion for particular categories of an analysed variables (features). It is based on the data gathered in the contingency tables of 2 features. The first feature has the possible ordered categories: and the second one has 2 categories: , . The contingency table of observed frequencies
are the proportions , ,…, .
The test statistic is defined by:
This statistic asymptotically (for large expected frequencies) has the Chi-square distribution with 1 degree of freedom.
The settings window with the
Chi-square test for trend can be opened in
Statistics menu →
NonParametric tests →
Chi-square, Fisher, OR/RR →
Chi-square for trend.
We examine whether cigarette smoking is related to the education of residents of a village. A sample of 122 people was drawn. The data were recorded in a file. }
We assume that the relationship can be of two types i.e. the more educated people, the more often they smoke or the more educated people, the less often they smoke. Thus, we are looking for an increasing or decreasing trend.
Before proceeding with the analysis, we need to prepare the data, i.e., we need to indicate the order in which the education categories should appear. To do this, from the properties of the Education variable, we select Codes/Labels/Format… and assign the order by specifying consecutive natural numbers. We also assign labels.
A p-value=0.0091, which compared to a significance level of =0.05 indicates that the alternative hypothesis that a trend exists is true.
As the graph shows, the more educated people are, the less often they smoke. However, the result obtained by people with junior high school education deviates from this trend. Since there are only two people with lower secondary school education, it did not have much influence on the trend. Due to the very small size of this group, it was decided to repeat the analysis for the combined primary and lower secondary education categories.
A small value was again obtained p=0.0078 and confirmation of a statistically significant trend.
Because of the decrease in people watching some particular soap opera there was carried out an opinion survey. 100 persons were asked, who has recently started watching this soap opera, and 300 persons were asked, who has watched it regularly from the beginning. They were asked about the level of preoccupation with the character's life. The results are written down in the table below:
The new viewers consist of 25\% of all the analysed viewers. This proportion is not the same for each level of commitment, but looks like this:
The p-value=0.0004 which, compared to the significance level =0.05, proves the truth of the alternative hypothesis that there is a trend in the proportions . As can be seen from the contingency table of the percentages calculated from the sum of the columns, this is a decreasing trend (the more interested the group of viewers is in the fate of the characters of the series, the smaller part of it is made up of new viewers).